summaryrefslogtreecommitdiff
path: root/samsung/exynos_drm_dsim.c
AgeCommit message (Collapse)Author
2021-12-26Merge android12-gs-pixel-5.10-sc-qpr2 into android12-gs-pixel-5.10-sc-v2android-s-qpr3-beta-2_r0.5android-s-qpr3-beta-1_r0.6android-s-qpr3-beta-1_r0.5android-12.1.0_r0.40android-gs-raviole-5.10-s-qpr3-beta-2android-gs-bluejay-5.10-android12L-d2PixelBot AutoMerger
SBMerger: 410055097 Change-Id: Ic816f82f5c85093c8628757161ad016c11b0ed11 Signed-off-by: SecurityBot <android-nexus-securitybot@system.gserviceaccount.com>
2021-12-22drm: samsung: Don't return error if RX fifo is not emptyandroid-s-v2-beta-3_r0.6android-12.1.0_r0.6android-12.1.0_r0.22android-12.1.0_r0.16android-gs-raviole-5.10-s-v2-beta-3android-gs-raviole-5.10-android12LKen Huang
In some cases, RX fifo gets not only correct data but also an unknown data from panel side that makes RX fifo not emmpty. This commit is to ignore the error if RX fifo is not empy after reading data from panel successfully. Bug: 207113942 Test: check read back data Change-Id: I6294c93ed87335b44c3e879dc640e3632ddc761e Signed-off-by: Ken Huang <kenbshuang@google.com>
2021-12-05Merge android12-gs-pixel-5.10-sc-qpr2 into android12-gs-pixel-5.10-sc-v2PixelBot AutoMerger
SBMerger: 410055097 Change-Id: If2392bb39ceaab8e96bea5b4b5e279d41466c752 Signed-off-by: SecurityBot <android-nexus-securitybot@system.gserviceaccount.com>
2021-11-18drm: samsung: recalculate underrun LP time when switching modeMidas Chien
Refresh rate is one factor to calculate underrun LP time. Recalculate underrun LP time when switching mode to ensure the setting is sutiable. Also adjust te_idle_us for s6e3fc3 panel. Bug: 205791683 Test: Youtube Change-Id: Ifcdd9484984efca9559aebf3dcd62e9961e12453 Signed-off-by: Midas Chien <midaschieh@google.com>
2021-09-23drm: samsung: support dual dsiKwanghyun Chung
This patch supports dual dsi for the panel spec below. 1. Video mode 2. No DSC 3. 2 ports, 8lanes, DPHY Bug: 193602257 Signed-off-by: Kwanghyun Chung <khyun.chung@samsung.com> Change-Id: I224013682aebab9afdf6cec13fa7d3ca60389e53 Signed-off-by: Ken Huang <kenbshuang@google.com>
2021-08-13drm: samsung: set power.must_resume to true in the suspend pathChris Lu
dsim_suspend/resume relies on matching pair of calls to prevent stuck in a specific state. Need to set the power.must_resume status bit to true to avoid skipping resume. Bug: 196158811 Test: idle in AOD mode without USB connection Change-Id: I6e52621309d9777182e9a9f871dae05974f75a17 Signed-off-by: Chris Lu <luchris@google.com>
2021-08-13drm: samsung: set power.must_resume to true in the suspend pathChris Lu
dsim_suspend/resume relies on matching pair of calls to prevent stuck in a specific state. Need to set the power.must_resume status bit to true to avoid skipping resume. Bug: 196158811 Test: idle in AOD mode without USB connection Change-Id: I6e52621309d9777182e9a9f871dae05974f75a17 Signed-off-by: Chris Lu <luchris@google.com>
2021-07-26drm: samsung: add to dump a bufferJiun Yu
If a problem like sysmmu fault or FBC error occurs while AFBC is enabled, it's necessary to check the contents of the input buffer. It'll be helpful to debug the problem. Bug: 191729561 Signed-off-by: Jiun Yu <jiun.yu@samsung.com> Change-Id: I83ae1e424ab75f29508d7975c9b103d4023c21cc
2021-07-23panel: samsung: allow cmd sets to be sent out in batchAdrian Salido
This ensures that cmd set is sent all at once. Bug: 193867296 Change-Id: I81d70d51d7f684b5af666439f14bbc1d4d748f61 Signed-off-by: Adrian Salido <salidoa@google.com>
2021-07-21drm: samsung: dsim: keep device link attached after disableAdrian Salido
Currently device link is removed and recreated every time pipeline is being disabled. This causes the device link to be recreated every time display turns off/on, moreover we don't currently check whether the device link creation was successful, and this could lead to hw failures. Ensure that device link is created and maintained across enable/disable but only destroy/recreate the link if dsim is reattached to a different decon. Bug: 194141566 Signed-off-by: Adrian Salido <salidoa@google.com> Change-Id: I0613e0750aaa402c083010f80ef219befc63ae71
2021-07-15drm: samsung: ensure device link between dsim and deconAdrian Salido
Device link between dsim and decon must be maintained in order for runtime pm to propagate to power domain and to maintain DPU hw enabled while dsim is still active. In order to do this ensure device link is always obtained regardless of state of connectors_changed. Bug: 192777580 Change-Id: Ia5afb542913b1974354c32bf4b32f7805bb3f1f9 Signed-off-by: Adrian Salido <salidoa@google.com>
2021-06-23samsung: update protected SFRs via smcLong Ling
Some SFRs are not writable when rendering protected content. Add a write_protected flag for register block and use smc to write the protected registers when the flag is set. Bug: 178245442 Signed-off-by: Long Ling <longling@google.com> Change-Id: Ie376d70f8d09195dab83af3117ebffa3a75c70ba
2021-06-17drm: samsung: dump interested DPU event when FIFO timeout occursChris Lu
Dump DPU event logs when DSIM PH or PL FIFO empty timeout occurs to know related DPU/DSIM behavior. Bug: 187448793 Test: reduce the timeout value and check the dump logs Change-Id: I384a7bc208d1956bfba4039236e5d8c99ba70c9d Signed-off-by: Chris Lu <luchris@google.com>
2021-06-11drm: samsung: use pm late suspend/resume for dsim ulps enter/exitAdrian Salido
Given the device topology (decon is a supplier to dsim), DSIM device pm suspend happens before DECON, and this could happen before DECON has had a chance to properly halt any ongoing operations. This may lead to DSIM being transitioned to ULPS while DECON may still be operating and/or supplying data. In order to prevent this, move dsim ulps enter/exit to late pm callbacks once the device is in quiesced mode. Bug: 189484436 Signed-off-by: Adrian Salido <salidoa@google.com> Change-Id: Ifbfbf3d35ecca7a55a8622fa752d02527a93f436
2021-05-04drm: samsung: refactor hibernation into self refresh modeAdrian Salido
Replace hibernation global functions and implement using drm core provided self refresh state. The self refresh state can be propagated to all components in the display pipeline including connectors/bridges. Bug: 180539030 Signed-off-by: Adrian Salido <salidoa@google.com> Change-Id: Ia533b08be9402793539d2ddaa650a6daa09da22c
2021-04-15samsung: dsim: handle bypass mode in dsimAdrian Salido
Bypass mode is used to prevent any access to dsim while in this state. This can be set when TUI is enabled. Bug: 183596626 Signed-off-by: Adrian Salido <salidoa@google.com> Change-Id: Idf3701ffda8ce40365feb850b97df0b6e9b5beb9
2021-04-15drm: samsung: dump interested dpu event when underrun occursMidas Chien
Dump dpu underrun related events to know the circumstances in which underruns occurred. Bug: 174711846 Test: simulate underrun to check kernel log Signed-off-by: Midas Chien <midaschieh@google.com> Change-Id: Id78b5bd262eef1b15a4b55c8c2367066b95d6e1d
2021-04-14drm: samsung; handle pm suspend callsAdrian Salido
Handle suspend calls by speeding up hibernation or failing to suspend if display is currently busy. Bug: 185027212 Change-Id: I1e2f869d6b067c2962ec169943d212004216af1f Signed-off-by: Adrian Salido <salidoa@google.com>
2021-04-07drm: samsung: enable dsim runtime pmAdrian Salido
This allows dsim to handle it's own power state without the need for entire DPU to get out of hibernation. Bug: 183049257 Signed-off-by: Adrian Salido <salidoa@google.com> Change-Id: I9140e7037ecb8d51008cf710353762a3c99ec38e
2021-03-30drm: samsung: add to wait for packet header fifo emptyJiun Yu
It is added to wait for packet header fifo empty in case of long packet. Sometimes, it is not enough to wait payload fifo empty only for long packets related to LCD partial update. Bug: 151111908 Signed-off-by: Jiun Yu <jiun.yu@samsung.com> Change-Id: Iaf49be949005883d5d97e778e6e7e34182fa810a
2021-02-25drm: samsung: support secondary panel selectionWeizhung Ding
Add module parameter to receive secondary panel info. Bug: 161948888 Test: display work Change-Id: I6439c2f610338087b773583bc6aad3174845ece8 Signed-off-by: Weizhung Ding <weizhungding@google.com>
2021-02-16drm: samsung: replace tui private mode flagAdrian Salido
With private flags getting deprecated, replace the usage of TUI mode flag with the use of crtc state flags such that: * self_refresh_active: indicates that panel should remain in self refresh mode with regulators/power on * bypass: decon should remain in bypass mode with power on Bug: 165347448 Bug: 178988232 Change-Id: I2b708ec102477dd97495b821922d0d5a1ff80066 Signed-off-by: Adrian Salido <salidoa@google.com>
2021-02-11drm: samsung: add symlink from panel to dsimLong Ling
A dsim device is primary or secondary is decided by the panel connected to it. Add this symlink so user space could locate the primary or secondary dsim device. Bug: 171729515 Signed-off-by: Long Ling <longling@google.com> Change-Id: I119c83d9593940969c2a0ae010e51a3b47774567
2021-02-11drm: samsung: update hs_clock sysfsLong Ling
Add a second parameter to apply hs_clock immediately or at next wakeup. Bug: 171729515 Signed-off-by: Long Ling <longling@google.com> Change-Id: I67f87dbeaf6d5463d8763ae4e505632e4f02bd87
2021-02-11drm: samsung: avoid pinctrl during TUIAdrian Salido
When transitioning to TUI TE gpio should remain the same. Avoid performing any pinctrl change while in TUI. Bug: 178988232 Signed-off-by: Adrian Salido <salidoa@google.com> Change-Id: I8cfba2394ca9293fbfcb8db50a07586867a1959e
2021-02-10drm: samsung: send multi dsi command at onceJiun Yu
When sending a command, if LASTCOMMAND is not set in flags, the command must be stacked and sent at once. At this time, the command(s) should be sent all in one vblank period. Bug: 177100504 Signed-off-by: Jiun Yu <jiun.yu@samsung.com> Change-Id: I5b26ff42ab356402a14a57b878f0ea4d0e37c523
2021-02-10drm: samsung: dsi command read/write function refactoringJiun Yu
The dsi command transfer function is refactored. Bug: 177100504 Signed-off-by: Jiun Yu <jiun.yu@samsung.com> Change-Id: If9e1873bad69070993cd11c3eaa9330aee8fb686
2021-01-26drm: samsung: use framestart irq as vblank instead of VT_STATUSJiun Yu
The vblank must be enabled and disabled dynamically in video mode. This prevents that this interrupt continuously wakes up cpu to handle it. However, disabling the interrupt of dsim causes a problem that doesn't handle other interrupts of dsim. So, the framestart interrupt of decon will replace VT_STATUS interrupt of dsim. Bug: 156411983 Signed-off-by: Jiun Yu <jiun.yu@samsung.com> Change-Id: Id07c7aa6fececdd5d55308ce8468d51a4c5ee16d
2021-01-09drm: samsung: change hibernation entry scheme based on timeJiun Yu
Hibernation entry scheme is changed based on time instead of TE. It can eliminate the association between vblank and hibernation operation. Signed-off-by: Jiun Yu <jiun.yu@samsung.com> Change-Id: I4549ee538a4a4bc87d7a3f2f202c207e73e77cec
2020-12-23drm: samsung: update underrun and cmd_te ctl when fps is changedMidas Chien
DSIM_UNDERRUN_CTRL, DSIM_CMD_TE_CTRL0 and DSIM_CMD_TE_CTRL1 need to be updated base on fps when refresh rate is changed to make underrun detection work correctly. Calculate underrun_lp_ref at runtime based on current refresh rate if cmd_underrun_cnt is not specified. Bug: 174830564 Test: enable `Smooth Display` do some test without noise rectangle noise and underrun occurs. Test includes launch apps, scrolling, video playing, youtube, suspend/resume, rotation, AoD Test: limit DISP max clock to reproduce noise rectangle symptom and check underrun count keep increasing Signed-off-by: Midas Chien <midaschieh@google.com> Change-Id: Ie88bd689e03c487b0e3287bfbf7ad94f08e0b1e5
2020-12-22drm: samsung: get decon trigger information from panel/dsimAdrian Salido
The way that decon is configured should be dependent on the connected panel and/or encoders, that way decon can be reused for different displays. Remove Decon's parsing of these panel/dsim dependent values and obtain directly. Bug: 161557612 Signed-off-by: Adrian Salido <salidoa@google.com> Change-Id: Ia3ee52b6a51bc113e8783d3905db10029177fcbe
2020-12-09limit the underrun logsKen Huang
To avoid a flood of underrun log, limit the underrun logs. Bug: 175093232 Test: check log Signed-off-by: Ken Huang <kenbshuang@google.com> Change-Id: I5f7022991fb4d6d42210d27767d0bfe9f10a6b22
2020-12-07drm: samsung: get decon output type dynamicallyAdrian Salido
Get output type from connected encoders instead of having to hard code from device tree. Bug: 161557612 Signed-off-by: Adrian Salido <salidoa@google.com> Change-Id: Id23bf90126f3c1c3ba68d70b56dc2b1b1fb359b0
2020-11-30drivers/exynos_drm: display mipi phy diagLong Ling
Parse the phy diag settings from dts. Create debugfs nodes for each phy diag item. If dsim is in enabled status, restart dsim to apply user's input. Otherwise user's input will be applied the next time dsim is enabled. User's input will override the phy default settings before pll is enabled. Bug: 139663511 Change-Id: Ib00bccab0ee89c11e23d6690785bfe962536cc7f Signed-off-by: Long Ling <longling@google.com>
2020-11-30drivers/drm/samsung: Update underrun_lp_ref calculationLong Ling
1. Use te_var/te_idle from panel config instead of PLL config. 2. Use the max vrefresh rate instead of current mode's vrefresh rate. Signed-off-by: Long Ling <longling@google.com> Change-Id: I9cde460e7548ab5d1426b63a4b83cc03ed6ecbb0
2020-11-18samsung: move mode private info to connector stateAdrian Salido
Mode private info is getting removed, move this info into connector state and replace all references with references to connector state. Bug: 165347448 Change-Id: Idee838764e19f96fc530d72528b59b7033118e63 Signed-off-by: Adrian Salido <salidoa@google.com>
2020-11-18drm: samsung: dsim: remove mode references in hs clk calculationsAdrian Salido
Information needed to calculate hs clk parameters can be obtained from current dsim configuration instead of looking at drm display mode. Signed-off-by: Adrian Salido <salidoa@google.com> Change-Id: I04c8edde9f29fc76129f154829f65f812748997b
2020-11-17drm: samsung: add dpu underrun traceMidas Chien
Put dpu underrun info to ftrace for collecting metrics. Bug: 171381940 Test: use trace_processor_shell to check metrics Change-Id: Ia0023b57805d963a48419a7adf7c77884543e07c Signed-off-by: Midas Chien <midaschieh@google.com>
2020-10-16drivers/drm/samsung: add sysfs node to change dsi hs clockLong Ling
Add sysfs node to change dsi hs clock rate, and use state_lock to guard dsim state. Bug: 139663511 Change-Id: I1d1ef3c5b45255305ee75f246cde9112d99f88d5 Signed-off-by: Long Ling <longling@google.com>
2020-10-16drivers/drm/samsung: parse pll features from device treeLong Ling
These features are used to config PLL at run time. Bug: 139663511 Change-Id: I5afdd20534a8264f319463049b9bd116ec0e6628 Signed-off-by: Long Ling <longling@google.com>
2020-10-14drm: samsung: default to first panel in device treeAdrian Salido
If no panel name is provided through command line, default to first device found in device tree. Bug: 166284707 Signed-off-by: Adrian Salido <salidoa@google.com> Change-Id: I76a078f8cd839de2c4f9c5129d9efdf133a4540d
2020-10-08drm: samsung: add support for seamless mode setAdrian Salido
Allow seamless mode set without requiring full enable/disable during typical mode set operations. Add proper checks to make sure that the mode changes result in minimal decon/dsim changes that allow for a seamless mode change. Bug: 139370280 Change-Id: I20df8187a26f3b3a91493fb72ed0f52975079aa5 Signed-off-by: Adrian Salido <salidoa@google.com>
2020-10-05drm: samsung: add ecc and crc events for debugKen Huang
Add debug node to get the counts for ecc and crc events. Bug: 161090580 Test: cat /d/dri/0/crtc-0/crc_cnt and /d/dri/0/crtc-0/ecc_cnt Signed-off-by: Ken Huang <kenbshuang@google.com> Change-Id: Ia2f056455c377aaf10f105081a183bfdd2deddcb
2020-10-02samsung: port drm driver to gs-mainlineAdrian Salido
Make updates to build on top of android-gs-pixel-mainline branch: * Replace struct timeval with struct timespec64 * Remove usage of mode vrefresh * Update changed DRM/KMS framework APIs Signed-off-by: Adrian Salido <salidoa@google.com> Change-Id: I0e41b0c46cdd7427cd25112045c3d25d1a294588
2020-10-01drm: samsung: build exynos-drm driver as moduleAdrian Salido
Make changes to ensure exynos-drm and panel drivers can be built on top of android-gs-pixel-5.4 kernel: * Add relevant Makefiles * Correct header files inclusions * Fix all compiler warnings Signed-off-by: Adrian Salido <salidoa@google.com> Change-Id: Ie02e2602d4104b888d3621164eb340543d83f760
2020-09-29drm: samsung: allow pll mode lookup by prefixAdrian Salido
This allows refresh rate information to be included in mode name and but still pll mode can be shared between different modes with same resolution and different refresh rates. Bug: 160613796 Signed-off-by: Adrian Salido <salidoa@google.com> Change-Id: Ie227140ef8b108951c093f9c6c7dbbf84aec0918
2020-09-29drivers/drm/samsung: enable video mode refresh rate changeLong Ling
Remove the 60Hz hardcoded video mode refresh rate and set the current refresh rate in display mode. Bug: 160733271 Signed-off-by: Long Ling <longling@google.com> Change-Id: I4ec9a7ae4dac57392835da0aa02cc301cc60c07b
2020-09-29drm: samsung: dsim: remove duplicate variablesAdrian Salido
DSIM currently has some duplicate fields like lane count and format that are available in dsi device, refer to dsi device directly instead. Bug: 154238434 Signed-off-by: Adrian Salido <salidoa@google.com> Change-Id: I4ee32624fdfc6fee2c517b22c72e285a55a8e852
2020-09-29drm: samsung: move mode validation from dsim to panelAdrian Salido
Panel code seems more obvious for making these checks as this is populated there. Keep DSIM validation to make sure that only private modes are allowed, given that it requires some DSIM data stored in common header. Bug: 154238434 Signed-off-by: Adrian Salido <salidoa@google.com> Change-Id: I849b3c900308c8b3f096bf1f726b75551a099a14
2020-09-29drm: samsung: replace drm panel with bridgeAdrian Salido
Make use of atomic framework to get all drm panel calls, the drm bridge also gets notification of mode changes which will be necessary to perform appropriate panel sequence on mode changes. Bug: 154238434 Signed-off-by: Adrian Salido <salidoa@google.com> Change-Id: I54c33d46905422531b40c4ce0ac53904c400a90c