Commit Graph

3192 Commits

Author SHA1 Message Date
Yashwanth
50aa3cd210 disp: msm: sde: fix traffic shaper prefill calculations
This change fixes traffic shaper prefill calculations
for prefill count and bytes per clock as per hardware
recommendations in the HPG which are calcualted as below:

ts_ count = ts_end*19200000/fps/(vtotal)

ts_bytes_per_clk = ceil(h_src*v_src*bpp*fps/
			19200000*amortized_pref_rate)

Change-Id: Icc2348421a2124daa3b0056f46d7a6a45021381b
Signed-off-by: Yashwanth <yvulapu@codeaurora.org>
2021-11-08 17:29:22 +05:30
qctecmdr
cb24fd2bc6 Merge "disp: msm: sde: add rev checks for cape target" 2021-11-07 04:30:56 -08:00
qctecmdr
4abbe9ee47 Merge "disp: rsc: update mode-1 threshold config to 1 hz" 2021-11-06 06:25:54 -07:00
Steve Cohen
f47009b55f disp: msm: sde: fix constness of list_sort compare function
Kernel upgrade has updated list_sort's compare callback's
function signature to take const lists, preventing modification
when performing a comparison.

Change-Id: I71dbe33b9d213357ad9706ffc270053ea569006d
Signed-off-by: Steve Cohen <quic_cohens@quicinc.com>
2021-11-05 20:08:18 -04:00
qctecmdr
45fd1bf563 Merge "disp: msm: sde: Add spr and demura to handoff features list" 2021-11-05 14:58:29 -07:00
Ritesh Kumar
986c7b1028 disp: msm: dsi: Logging Improvement in dsi driver
This change adds additional logs in dsi driver for
easy debugging of issues related to command transfer.

Change-Id: Ica784bed6c360b2760d6606d625837e23a22410c
Signed-off-by: Ritesh Kumar <riteshk@codeaurora.org>
2021-11-05 02:08:17 -07:00
Ritesh Kumar
13f4082d58 disp: msm: dsi: Fix post cmd tx sequence for read commands
For read commands, wait_for_done() should be called in dsi_message_rx function.
Currently, its being called twice from dsi_message_rx and dsi_ctrl_post_cmd_transfer.
This change adds a check to skip wait_for_done() from dsi_ctrl_post_cmd_transfer.

Change-Id: Icb7ccd0f8dde24c6c26732f7cb92a20bebb26f5d
Signed-off-by: Ritesh Kumar <riteshk@codeaurora.org>
2021-11-05 14:34:58 +05:30
Abhijit Kulkarni
683f6bc6af disp: msm: sde: send event on trusted vm transition
This change sends a notification to user mode after msm_drm
driver releases the mmio and irq resources on trusted vm transition
request. This is required as user mode has no other way to know
when the resources where actually released. User mode driver earlier
relied on retire fence signaling but retire fences are send before
releasing the hw.

Change-Id: Ia218cfcbf398b2de1ad9578fb9baedf348b067df
Signed-off-by: Abhijit Kulkarni <kabhijit@codeaurora.org>
2021-11-04 11:45:25 -07:00
Ritesh Kumar
f2499b50d8 disp: msm: dsi: remove early return from dma_cmd_wait_for_done
In ASYNC wait mode, next command kickoff can happen before previous command ISR execution is
completed in below sequence:

ASYNC command A -> triggered

dsi_ctrl_isr for command A -> fired and executed atomic_set(&dsi_ctrl->dma_irq_trig, 1);

wait_for_done for command A -> returns early as dsi_ctrl->dma_irq_trig is 1

ASYNC Command B -> triggered

wait_for_done for command B -> waiting for cmd_dma_done

dsi_ctrl_isr for command A -> executes complete_all(&dsi_ctrl->irq_info.cmd_dma_done);

wait_for_done for command B -> returns success incorrectly based on complete_all of previous
	command isr and disable_status_interrupt() is not called.

This leads to refcount of dma_done going wrong and dsi_ctrl_isr is not enabled on suspend resume.

To fix this issue, mark command transfer successful only based on complete_all(cmd_dma_done). This
way disable_status_interrupt() will be always called either from dsi_ctrl_isr or wait_for_done().

Change-Id: I0379ea7ff82a1e077b95f6996d11d1722de00936
Signed-off-by: Ritesh Kumar <riteshk@codeaurora.org>
2021-11-04 17:50:11 +05:30
Raviteja Tamatam
f5d5133807 disp: msm: sde: add rev checks for cape target
Add required revision checks from display for
cape target.

Change-Id: Ieb2b0b23462ff122b0090e7c78d8da41fa78fc07
Signed-off-by: Raviteja Tamatam <travitej@codeaurora.org>
2021-11-03 14:25:49 +05:30
Lakshmi Narayana Kalavala
a70e704ef0 disp: msm: sde: Add spr and demura to handoff features list
SPR and Demura modules being disabled when switching back from
Trusted VM to HLOS VM. The change adds the support to restore
the modules to restore to their original state.

Change-Id: I0a843671672179a4bc62da512baf02e911fb50aa
Signed-off-by: Lakshmi Narayana Kalavala <lkalaval@codeaurora.org>
2021-11-02 17:15:56 -07:00
qctecmdr
ce1eceafb0 Merge "disp: msm: dp: fix warnings due to dp_hdcp2p2 thread reparking" 2021-11-02 14:52:25 -07:00
qctecmdr
24057ec69c Merge "disp: msm: dsi: implement ESD recovery cleanup" 2021-11-02 14:52:24 -07:00
qctecmdr
5e95df6d30 Merge "disp: msm: dsi: terminate buffer with NULL character" 2021-11-02 14:52:24 -07:00
qctecmdr
fd1bc18411 Merge "disp: msm: dp: send mst act signal after link maintenance" 2021-11-02 14:52:24 -07:00
Dhaval Patel
0ecc150e06 disp: rsc: update mode-1 threshold config to 1 hz
Update mode-1 threshold configuration to 1 hz to avoid
selecting mode-2 if panel vsync is irregular.

Change-Id: I06b16b8ff35fc145df2af480353a45348548cc3b
Signed-off-by: Dhaval Patel <pdhaval@codeaurora.org>
2021-10-29 20:19:19 -07:00
qctecmdr
c9ecf74127 Merge "disp: msm: add display config support for neo" 2021-10-29 08:35:13 -07:00
Karthik Andhavarapu
6e05f12db7 disp: msm: add display config support for neo
Add display config support for compilation on neo target.

Change-Id: Ia2b9b8b76f833e233a8bf801485c6dd2104e1700
Signed-off-by: Karthik Andhavarapu <quic_kartkart@quicinc.com>
2021-10-29 12:49:40 +05:30
Sandeep Gangadharaiah
994d2568be disp: msm: dp: send mst act signal after link maintenance
If MST is enabled, the controller needs MST ACT to be 
completed to successfully transition to 'Ready for Video' 
state. The driver is sending ACT during the normal flow
when transitioning from link training to stream enable. 
But it is not sending ACT, if a link maintenance is
triggered after stream enable. This change adds the ACT 
update to the link maintenance call flow.

Change-Id: I7aea53a1e54202f1d9059a8eb59f01fa97fe9eb9
Signed-off-by: Sandeep Gangadharaiah <sandgang@codeaurora.org>
2021-10-28 16:04:22 -04:00
qctecmdr
ad6ad703c7 Merge "disp: msm: dsi: fix pll lane count in split link usecase" 2021-10-27 19:41:25 -07:00
Shashank Babu Chinta Venkata
213d490593 disp: msm: dsi: fix pll lane count in split link usecase
In split link usecase with single DSI and dual sublink, the
pixel clock rate should  be calculated based on effective lanes
rather than cumulative lanes on that DSI PHY. This effective lanes
can be expressed as number of lanes being used per sublink.

Change-Id: Ia534e816cc64b62c5fe0b9fcaabb9ba52d05bab0
Signed-off-by: Shashank Babu Chinta Venkata <sbchin@codeaurora.org>
2021-10-27 11:50:59 -07:00
qctecmdr
3e2f9ddbd9 Merge "disp: msm: sde: reset feature wrappers based on target capabilities" 2021-10-27 08:00:26 -07:00
Andhavarapu Karthik
c6b0d1fbe9 disp: msm: sde: Move TVM related code under SDE VM config
This change moves TVM related code under SDE VM config.

Change-Id: I8357d6a984fd97f18f24eee33464299e8ea66b12
Signed-off-by: Andhavarapu Karthik <quic_kartkart@quicinc.com>
2021-10-27 17:51:27 +05:30
Jeykumar Sankaran
15342a23fe disp: msm: sde: add kalama mdss version support
Add kalama mdss revision and enable features based
on the hardware capability.

Change-Id: I27dff07b00ba16d313c5c8dc2661a10e522daea5
Signed-off-by: Jeykumar Sankaran <jsanka@codeaurora.org>
2021-10-26 11:34:59 -07:00
Steve Cohen
d9794d82cd disp: msm: sde: remove sde_hw_blk
The sde_hw_blk was meant to be a generic base object for all
SDE HW blocks, however, it enforces using a common set of ops
which is not practical when blocks have different capabilities.
Since this object was never used as intended and is not doing
anything functional today, remove the dead weight.

Change-Id: If76006c1ae5c62e8d7d77b100837dbaf6c661bd3
Signed-off-by: Steve Cohen <quic_cohens@quicinc.com>
2021-10-26 11:34:59 -07:00
Steve Cohen
5fe7c2f8a0 disp: msm: remove gem functions without callsites
Many upstream files and APIs have been removed in downstream
driver. Some function definintions are left dangling without
any caller. Remove the functions which are not used downstream.

Change-Id: I9f936e7cdac3be6f854b3c67725164fad785f0d4
Signed-off-by: Steve Cohen <quic_cohens@quicinc.com>
2021-10-26 11:34:59 -07:00
Steve Cohen
a683fba2e8 disp: msm: sde: use common naming for version/revision in catalog
Align the HW catalog to use common naming amongst the "revision"
and "version" structure members.

Change-Id: Ib6c81aee6cb49208b0699db4a75b4eb9dc79e800
Signed-off-by: Steve Cohen <quic_cohens@quicinc.com>
2021-10-26 11:34:59 -07:00
Steve Cohen
7f0c843da4 disp: msm: sde: move boolean flags in catalog to a bitmap
Move all the individual boolean flags from HW catalog into a
"features" bitmap. These flags are used to specify support of
various target specific features.

Change-Id: I2334b3b873f3737f91bbae4ef576408247710156
Signed-off-by: Steve Cohen <quic_cohens@quicinc.com>
2021-10-26 11:21:33 -07:00
qctecmdr
195bb007d8 Merge "disp: msm: sde: update rc checks for mask configuration" 2021-10-25 22:07:45 -07:00
qctecmdr
5f5525b418 Merge "disp: msm: sde: add new function for updating the cp feature lists only" 2021-10-25 18:47:06 -07:00
qctecmdr
a757117e6b Merge "disp: msm: sde: protect file private structure with mutex lock" 2021-10-25 11:31:12 -07:00
Sandeep Gangadharaiah
ce86cc5397 disp: msm: dp: fix warnings due to dp_hdcp2p2 thread reparking
This change checks "dp_hdcp2p2" thread's parked state, before
attempting to park the thread. This would avoid a warning
message from the kernel module, in case if the thread is already
parked.

Change-Id: I3133da7159c9806981e4760be275c0a54036958b
Signed-off-by: Sandeep Gangadharaiah <sandgang@codeaurora.org>
2021-10-22 19:09:52 -04:00
qctecmdr
dd76bc04e6 Merge "disp: msm: sde: add null check while getting pointer to kms" 2021-10-22 15:17:12 -07:00
qctecmdr
8895819310 Merge "disp: msm: fix rsc static wakeup time calculation" 2021-10-22 12:21:30 -07:00
qctecmdr
8e7228f7be Merge "disp: msm: dsi: limit dma read commands to sublink 0" 2021-10-22 12:21:30 -07:00
Prabhanjan Kandula
35f07ca601 disp: msm: fix rsc static wakeup time calculation
Currently RSC timer register programming is optimized for updating
only during timing param changes and not during RSC state changes
with same timing. Static wakeup time computation should consider
panel jitter for RSC clk state too, else it can result in RSC hang.
This change also removes extra logic for video mode prefil lines
computation for rsc config as video mode does not enable RSC solver.

Current issue scenario exposing the hang is in dual dsi display scenario
where RSC is in clock state and static wakeup time is programmed by
not considering panel jitter, after suspend/pmsuspend while waking up
if RSC switches to command state if primary enabled first and vsync
may arrive much early based on the panel jitter. RSC hw can not handle
if TE arrives earlier than static wakeup time causing RSC hang.

Change-Id: I1434fdd71eb04fdbe22b3601500493c818e9126d
Signed-off-by: Prabhanjan Kandula <pkandula@codeaurora.org>
2021-10-22 10:55:26 -07:00
qctecmdr
d6d5bcebe3 Merge "disp: msm: dsi: avoid updating bitclk when dyn clk is disabled" 2021-10-22 04:30:39 -07:00
Satya Rama Aditya Pinapala
1317b11bc2 disp: msm: dsi: implement ESD recovery cleanup
After an ESD failure, the PHY lanes and controller can be stuck in
an unknown state. This can result in interrupt storms and watchdog
failures, if these error states are not handled correctly. The following
change implements the below mechanism to avoid failures.

1) Disable error interrupts during an ESD reg read, which are re-enabled once
ESD check is successful.
2) On ESD failure, before turning off LP clocks, reset the PHY lanes and DSI
controller.
3) After the HS clocks are turned off, issue a PHY hard reset.
4) Before enabling/disabling error interrupts, clear the error status registers
as they are not cleared as part of controller reset.

Change-Id: If10e4edf095a334a9416d109ec4b1401d1a84505
Signed-off-by: Satya Rama Aditya Pinapala <psraditya30@codeaurora.org>
2021-10-21 16:25:44 -07:00
Shashank Babu Chinta Venkata
43697d6331 disp: msm: dsi: limit dma read commands to sublink 0
Limit dma read commands to sublink 0 in split link
configuration since all panels do not support read
on sublink 1.

Change-Id: I537abafc02afe1c3306175ac850f4f080154f443
Signed-off-by: Shashank Babu Chinta Venkata <sbchin@codeaurora.org>
2021-10-21 16:22:57 -07:00
Krishna Manikandan
45380adf38 disp: msm: sde: protect file private structure with mutex lock
Access file private data structures inside the
mutex lock only to avoid use-after-free issues.

Change-Id: If70731f517bcb47d4515f131fecafe702064cb45
Signed-off-by: Krishna Manikandan <mkrishn@codeaurora.org>
2021-10-21 14:28:42 -07:00
Rajkumar Subbiah
14e61d16d8 disp: msm: dp: park pixel clock before disable
When switching between 2 dongles/adapters it is possible
to have the same resolution with different link configuration.
Even though the pixel clock could be the same on replug, the
vco clock could be different depending on the link
configuration. Since the dp driver only exposes limited clocks
to the clock framework, in this specific scenario, the clock
driver is unable to recognize the change in source clock rate
and ends up skipping the clock reconfiguration.

This change adds support to park the pixel clocks on disable,
thereby forcing a reconfiguration on subsequent replug even
if the pixel clocks are the same.

Change-Id: If90b37d6285f6cad23cf1c11a7d6ccd6b4cf850c
Signed-off-by: Rajkumar Subbiah <quic_rsubbia@quicinc.com>
2021-10-21 12:58:37 -04:00
Rajkumar Subbiah
af002925b8 disp: msm: dp: set vco divider during pll configure
The divider value for vco clock is only dependent on the link rate
and is known during pll configure. Instead of depending on the
clock framework to program this divider as part of stream clock
enable, this change moves the configuration to pll configuration
and removes the set rate call on the vco clock.

Change-Id: If687a8ab057fdfd6c3b3ad2bd1c51663d9182ff4
Signed-off-by: Rajkumar Subbiah <quic_rsubbia@quicinc.com>
2021-10-21 12:58:32 -04:00
Samantha Tran
6cd653bf2f disp: msm: sde: add null check while getting pointer to kms
Add a null check to avoid null pointer access while getting
pointer to sde_kms.

Change-Id: I00f77e2a5bf63217fa57408ee5ac238dcac3fb03
Signed-off-by: Samantha Tran <samtran@quicinc.com>
2021-10-20 21:28:48 -07:00
Ping Li
4d27e37beb disp: msm: sde: add new function for updating the cp feature lists only
When sde_crtc_atomic_begin is called before crtc is enabled, all the
color processing features need to be moved from active_list to
dirty_list after sde_cp_crtc_apply_properties(). However, the
ltm_hist_en flag doesn't need to be set to false in this case.
Setting ltm_hist_en to false in this case will result LTM merge_en bit
being cleared incorrectly. This change replaces sde_cp_crtc_suspend()
with a new function that only updates the color processing feature lists
in sde_crtc_atomic_begin().

Change-Id: I75d7874899838855bda05a1e8eca0cb9523417e9
Signed-off-by: Ping Li <pingli@quicinc.com>
2021-10-20 11:16:56 -07:00
qctecmdr
5f25adc693 Merge "disp: msm: dsi: add const qualifer for device node in get_named_gpio" 2021-10-20 09:37:40 -07:00
qctecmdr
a6400b2c81 Merge "disp: msm: dsi: remove check for reset gpio config in ext bridge mode" 2021-10-19 22:14:08 -07:00
Satya Rama Aditya Pinapala
4413e3bb7e disp: msm: dsi: terminate buffer with NULL character
Change terminates the copied buffer with a null character.

Change-Id: I18d6b3ca861058a242bde399f631771d3a48eddd
Signed-off-by: Satya Rama Aditya Pinapala <psraditya30@codeaurora.org>
2021-10-19 12:03:44 -07:00
qctecmdr
531591b654 Merge "disp: msm: sde: add rev checks for diwali target" 2021-10-16 12:35:45 -07:00
qctecmdr
fedae52a47 Merge "disp: msm: sde: disable vsync counter before tear check update" 2021-10-15 19:09:23 -07:00
qctecmdr
705f82e82a Merge "disp: msm: dp: destroy mst topology on unplug" 2021-10-15 19:09:23 -07:00