Commit Graph

2076 Commits

Author SHA1 Message Date
qctecmdr
bb3029af82 Merge "disp: msm: dsi: handle panel detection after a pp done timeout" 2022-04-13 21:40:08 -07:00
qctecmdr
1438587222 Merge "disp: msm: dsi: Fix DMA window scheduling programming" 2022-04-11 20:39:05 -07:00
Kashish Jain
9e5185ad69 disp: msm: dsi: handle panel detection after a pp done timeout
It has been observed that TE check may fail even if status read
is passing. Panel detection should be successful only if both
TE check and register read (if supported) pass.

Change-Id: I8d2c5d4139561fe533fc148124b7dde54b63c24e
Signed-off-by: Kashish Jain <quic_kashjain@quicinc.com>
2022-04-05 12:20:50 +05:30
Jayaprakash Madisetty
fdf36d7124 disp: msm: use vzalloc for large allocations
Large allocations using kzalloc can lead to timeouts. This updates
the allocation calls accordingly to use vzalloc to remove
requirements on contiguous memory.

Change-Id: Ica54483787509ed0e9283289fc9d523e8cde9238
Signed-off-by: Nilaan Gunabalachandran <quic_ngunabal@quicinc.com>
Signed-off-by: Jayaprakash Madisetty <quic_jmadiset@quicinc.com>
2022-03-31 14:48:52 +05:30
qctecmdr
a67699f42b Merge "disp: msm: sde: Fix data width calculation when widebus is enabled" 2022-03-24 23:59:45 -07:00
qctecmdr
a3d1758f89 Merge "drm: msm: call rsc hw_init after hibernation" 2022-03-23 11:33:22 -07:00
Kashish Jain
ebd2c679df disp: msm: sde: Fix data width calculation when widebus is enabled
Adjust the data width calculation to reduce the rounding off error
when the widebus is enabled.

Change-Id: Ia2fa4536ce519548989e2befcb22fb685f286c9e
Signed-off-by: Kashish Jain <quic_kashjain@quicinc.com>
2022-03-22 16:11:16 +05:30
Sai Srujana Oruganti
f9b6363fb7 drm: msm: call rsc hw_init after hibernation
When device boots from hibernation, probe function is not called
and rsc need to initialize the hw at the first client update call.

Change-Id: Iba3a3aaebbb8052ce93b8aac1746f33ea80795fb
Signed-off-by: Sai Srujana Oruganti <quic_osaisruj@quicinc.com>
2022-03-21 23:28:21 +05:30
Samantha Tran
3823e9f6ed disp: msm: sde: remove redundant backlight update
Current logic will unnecessarily call backlight update
twice in cases where backlight level is changing. When
this happens, there is a potential delay waiting for the
first command to complete before sending the second
backlight update with the same value. This change removes
one backlight call and now only calls update if the
property is marked as dirty.

Change-Id: I260f0d73b3a5af9ced7ae261d247595f965a8d9e
Signed-off-by: Samantha Tran <samtran@codeaurora.org>
2022-03-20 23:42:18 -07:00
Rajeev Nandan
a63678a172 disp: msm: dsi: Fix DMA window scheduling programming
In DMA start window scheduling, TRIG_CTRL.COMMAND_MODE_DMA_TRIGGER_SEL
is programmed to SW + DMA start window trigger. But if DMS switch
comes after command is scheduled, COMMAND_MODE_DMA_TRIGGER_SEL gets
reprogrammed to SW trigger leading to command transfer failure.

Program the COMMAND_MODE_DMA_TRIGGER_SEL only from the CMD DMA Tx path.

Change-Id: I01062497bb70aa5fdcb25be3715c7cbc4c68b681
Signed-off-by: Ritesh Kumar <quic_riteshk@quicinc.com>
Signed-off-by: Rajeev Nandan <quic_rajeevny@quicinc.com>
2022-03-17 12:14:26 +05:30
qctecmdr
0777752947 Merge "disp: msm: sde: take min ib votes from perf config" 2022-03-09 18:49:35 -08:00
Andhavarapu Karthik
caa5fa4247 disp: msm: sde: take min ib votes from perf config
Changes are made to get minimum ib vote for each bus from
device tree entries rather than static values.

Change-Id: Ibecb44ac6b8673c5d5b8979014c215ab3ce9e43f
Signed-off-by: Andhavarapu Karthik <quic_kartkart@quicinc.com>
2022-03-04 13:26:40 +05:30
Jayaprakash Madisetty
3c0f029ebb disp: msm: sde: validate plane mode and gem obj flags
Add changes to validate the plane fb_translation mode
and dma_buf flags of drm_gem_obj attached to plane. It
avoids device panic on S2 translation fault and fails the
drm_atomic_commit for which mismatch is detected. In
current codeflow, only S1 mappings are modified when dma_buf
is detached from Non_sec CB and attached to secure SB as part
of msm_gem_get_iova_locked API, but S2 mapping entries are
not modified and this crash is seen.

Change-Id: I6bced92994cd8681cf69231e41bec0c262dafd33
Signed-off-by: Jayaprakash Madisetty <quic_jmadiset@quicinc.com>
2022-02-28 16:08:52 +05:30
Rajeev Nandan
1f5cc03a33 disp: msm: dsi: fix compressed RGB101010 support
The destination format for compressed rgb101010 should be
the same as rgb888. After adding uncompressed RGB101010 support,
the programming for compressed rgb101010 went wrong.
Fix this to re-enable compressed rgb101010 format support.

Change-Id: I805e15df14dda8ff0653a0dba8c4efe3fe0681fd
Signed-off-by: Rajeev Nandan <quic_rajeevny@quicinc.com>
2022-02-22 22:50:10 +05:30
Venkata Prahlad Valluru
7492455784 disp: msm: sde: set parent to xo for link clks while enterting suspend
Clk framework will cache current parent and skip subsequent
clk_set_parent calls if same parent is set. In case of deepsleep,
clk's parent is reset to xo clks for link clocks but framework
will still see cached parent and skip set_parent call.
To avoid this state, set parent to xo clock for link clocks,
before we enter suspend, so that framework and hw state are
in correct state, when we exit from deepsleep.

Change-Id: Ic7f70ec13497c70a8b4351ebfa49c0db98fc63ab
Signed-off-by: Venkata Prahlad Valluru <quic_vvalluru@quicinc.com>
2022-02-11 11:14:16 +05:30
qctecmdr
8377993485 Merge "disp: msm: sde: while timing engine enabling poll for active region" 2022-01-31 20:32:19 -08:00
qctecmdr
f3500051f7 Merge "disp: msm: sde: always set CTL_x_UIDLE_ACTIVE register to "1"" 2022-01-31 20:32:19 -08:00
qctecmdr
65f4d0d9de Merge "disp: msm: sde: fix null pointer dereference" 2022-01-20 06:26:19 -08:00
qctecmdr
7bacfeaf3d Merge "disp: msm: sde: fix RM poll timeouts during PM suspend/resume usecase" 2022-01-20 06:26:18 -08:00
Prabhanjan Kandula
3edfceab68 disp: msm: sde: while timing engine enabling poll for active region
DCS commands triggered right after timing engine enable can conflict
with blanking period causing command transfer failures. Right after
timing engine enable poll for frame start and line count reaching
active region of display before any DCS commands.

Change-Id: Ia3967e01c3bb5bc82aa3549c300fa8335e00210c
Signed-off-by: Prabhanjan Kandula <quic_pkandula@quicinc.com>
2022-01-18 05:25:35 -08:00
Sai Srujana Oruganti
986687d5d1 disp: msm: sde: fix null pointer dereference
Add condition to prevent null point dereference.

Change-Id: If6019c0c7035a25ed87afa02c056044c8716bd64
Signed-off-by: Sai Srujana Oruganti <quic_osaisruj@quicinc.com>
2022-01-17 21:58:04 -08:00
Yahui Wang
075e3e1fa1 disp: msm: sde: set NOAUTOEN for sde irq to match with power event
If display cont-splash is enabled, then sde irq will be enabled
after registration, but sde power event assumes irq to be disabled
by default and will still try to enable irq with first power event
call, then could cause unbalanced irq enable warning on boot up.

Change-Id: Ic5482dd06501721664994f77cd5764140afb7a62
Signed-off-by: Yahui Wang <quic_yahuiw@quicinc.com>
2022-01-17 17:09:30 +08:00
Yashwanth
58fe91002a disp: msm: sde: always set CTL_x_UIDLE_ACTIVE register to "1"
As per HW recommendation, FAL10_VETO_OVERRIDE register can
be programmed to disable FAL10 in alternate to disabling
uidle at the sspp level as disabling UIDLE controller will
only disable DPU traffic shaping and will not stop the
system from entering FAL10 state. This change programs
FAL10_VETO_OVERRIDE register during uidle disable and also
sets CTL_x_UIDLE_ACTIVE register to always one to avoid
race condition between different CTL paths.

Change-Id: I0361543e345bf6c237ad60560e2b11604f5abf92
Signed-off-by: Yashwanth <quic_yvulapu@quicinc.com>
2022-01-17 11:42:30 +05:30
Yahui Wang
fb71974cf5 disp: msm: sde: move sde power event call into kms post init
The sde power event function needs to get actual sde kms irq
number to handle irq update call, but it is not able to know
the irq number before irq installation, so move sde power event
call into kms post init to avoid unbalanced irq issues.

Change-Id: Id262b86f98299fbb9a51c9ccb8e68c7bde7f57ed
Signed-off-by: Yahui Wang <quic_yahuiw@quicinc.com>
2022-01-17 10:55:53 +08:00
qctecmdr
7b9c87fa38 Merge "disp: msm: fix rsc static wakeup time calculation" 2022-01-12 10:43:59 -08:00
Andhavarapu Karthik
bcb9619f9f disp: msm: sde: fix RM poll timeouts during PM suspend/resume usecase
When PM resume commit occurs with mode_changed, enable flag set and
active_changed flag not set, the RM reservation allocated is not cleared
during crtc_destroy_state as encoder_mask in old_crtc_state is NULL.
When there is resume commit from HAL, it polls for this pending reservation
to be cleared causing poll timeouts. This change releases the pending
reservation from the crtc->state->encoder mask, as the old_crtc_state
encoder_mask will be reset with default values at start of PM resume.

Change-Id: Ica1c90a6ea7ef7df08fcb976b6f1b54bbfeea357
Signed-off-by: Andhavarapu Karthik <quic_kartkart@quicinc.com>
2022-01-11 20:51:18 +05:30
Lei Chen
f77b7c533c disp: msm: sde: remove clearing cur_master in encoder enable function
SDE IRQ callback can run in parallel thread to modeset after removing
pp_done wait before pre_modeset.
If cur_master is cleared in encoder enable function and irq callback
is triggered at the same time, the irq callback could not be handled
properly as cur_master is NULL.So remove clearing cur_master in
encoder enable function to avoid the race condition between modeset
and irq callback.

Change-Id: I2059c699a68838b3c9f6a7dd658a35f178b18c42
Signed-off-by: Lei Chen <quic_chenlei@quicinc.com>
Signed-off-by: Jayaprakash Madisetty <quic_jmadiset@quicinc.com>
2022-01-10 22:49:45 +05:30
Lei Chen
8d57f083f2 disp: msm: sde: cancel delayed_off_work before reinitialization
Canceling delayed_off_work in encoder pre_modeset might not be
executed in all cases, but the following encoder enable might
initialize the work.

This will lead to list corruption as delayed_off work list node
is reinitialized before removing from linked list.
Move canceling delayed_off_work to start of encoder mode_set to
ensure work is canceled before reinitialization.

Change-Id: I38687604f2eedced308ea02019c162022725534e
Signed-off-by: Lei Chen <quic_chenlei@quicinc.com>
Signed-off-by: Jayaprakash Madisetty <quic_jmadiset@quicinc.com>
2022-01-10 22:49:40 +05:30
Yashwanth
c5ff99c3a3 disp: msm: sde: update TEAR_SYNC_WRCOUNT register before vsync counter
During DMS, when tear check registers are updated near
rd_ptr line count, it was resulting in a spurious
rd_ptr_irq to which frame is getting latched and causing
tearing on the screen. This change updates
TEAR_SYNC_WRCOUNT register before disabling the vsync
counter and adds a spinlock to avoid pre-emption.

Change-Id: I986dc3ce6fb3da5fed758c2f50562df44f2ab557
Signed-off-by: Yashwanth <quic_yvulapu@quicinc.com>
2022-01-10 22:49:35 +05:30
Dhaval Patel
d32ac73186 disp: msm: sde: disable vsync counter before tear check update
Disable vsync counter before single buffer tear check
update. It allows to trigger the resolution switch
frame as posted start frame.

Change-Id: I2726372fd0e6d14ab0f79e3e3b0731a074158682
Signed-off-by: Dhaval Patel <quic_pdhaval@quicinc.com>
Signed-off-by: Jayaprakash Madisetty <quic_jmadiset@quicinc.com>
2022-01-10 22:49:30 +05:30
Dhaval Patel
d55329a469 disp: msm: sde: disable vsync_in to update tear check
This change updates the single buffer tear check registers
when vsync_in is disabled. It allows mode switch frame
trigger as posted start frame trigger.

Change-Id: I8068736b2ea01f6e4160e765fc39d7fc2a8590c9
Signed-off-by: Dhaval Patel <quic_pdhaval@quicinc.com>
Signed-off-by: Jayaprakash Madisetty <quic_jmadiset@quicinc.com>
2022-01-10 22:49:25 +05:30
Jayaprakash Madisetty
ff90d96806 disp: msm: sde: avoid tx wait during DMS for targets with dsc rev2
This change removes tx_wait during DMS for targets which have
dsc_hw_rev_2. For targets with dsc_hw_rev_1, during DMS the
tx_wait is needed since DSC registers are not double buffered
and frame trigger needs to be serialized to avoid pp_timeout
issues.

Change-Id: I46479ed8713602d167e57c9d9d0f800f544607f2
Signed-off-by: Jayaprakash Madisetty <quic_jmadiset@quicinc.com>
2022-01-10 22:49:13 +05:30
Dhaval Patel
205c579c9a disp: msm: sde: avoid irq enable/disable during modeset
Avoid irq enable/disable during modeset and trigger
frame as posted start frame. This saves mode_set time
and also avoids unbalanced vblank_irq in this usecase.

Change-Id: I06958da5e52bc2aca0ddc60d2783615f80a839a4
Signed-off-by: Dhaval Patel <quic_pdhaval@quicinc.com>
Signed-off-by: Jayaprakash Madisetty <quic_jmadiset@quicinc.com>
2022-01-10 20:25:50 +05:30
Prabhanjan Kandula
9a1da8b4c3 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 <quic_pkandula@quicinc.com>
Signed-off-by: Jayaprakash Madisetty <quic_jmadiset@quicinc.com>
2022-01-05 16:25:27 +05:30
Satya Rama Aditya Pinapala
401ab0dbb9 disp: msm: dsi: allocate DSI command buffer during bind
The DMA buffer allocation for DSI happens during the first
command transfer. This change moves this allocation to happen during
bind.

Change-Id: I7969a019a8b84282e8a153f5393c9a3de5a28043
Signed-off-by: Satya Rama Aditya Pinapala <psraditya30@codeaurora.org>
2021-12-23 00:03:00 -08:00
qctecmdr
e9a99b10ab Merge "disp: msm: sde: update uidle_db_updates in both enable/disable cases" 2021-12-21 03:24:04 -08:00
Yashwanth
2b5f47020c disp: msm: sde: update uidle_db_updates in both enable/disable cases
uidle_db_updates are generated when CTL_x_UIDLE_ACTIVE is set to 1.
It needs to enabled in both uidle enable and disable cases.
CTL_x_UIDLE_ACTIVE is set to 0 only in cases where uidle configuration
is not updated.

Change-Id: I9e31dc00b3b79c12b0bcf51da21eb216746794a6
Signed-off-by: Raviteja Tamatam <travitej@codeaurora.org>
Signed-off-by: Yashwanth <quic_yvulapu@quicinc.com>
2021-12-15 10:55:58 +05:30
Sai Srujana Oruganti
841c696fb4 disp: msm: dsi: add API to handle PHY programming during 0p9 collapse
Add HW recommended programming sequence when PHY
is allowed to turn off during idle state.

Change-Id: Icdd50d5ebc338842a6629ec08fc0ef35453e1052
Signed-off-by: Sai Srujana Oruganti <quic_osaisruj@quicinc.com>
2021-12-02 20:53:47 +05:30
qctecmdr
cf46f5d3ec Merge "disp: msm: dsi: Clear slave dma status only for broadcast command" 2021-12-01 04:31:00 -08:00
qctecmdr
7701aecce6 Merge "disp: msm: sde: avoid sde irq enable or disable when sde irq not active" 2021-12-01 04:31:00 -08:00
qctecmdr
c09d08e2df Merge "disp: msm: sde: avoid CWB in power on commit" 2021-12-01 04:31:00 -08:00
osaisruj
ad89bfc0d5 disp: msm: sde: modify format specifier
Modify error log with correct format specifier.

Change-Id: Ifb9d3f2decdb9dcac92ee810454a1027b5b78636
Signed-off-by: osaisruj <osaisruj@codeaurora.org>
2021-11-24 12:40:13 +05:30
Rajeev Nandan
81d15ab5bd disp: msm: dsi: Clear slave dma status only for broadcast command
In case of broadcast, for master controller, DMA_DONE bit gets
cleared in dsi_ctrl_isr and for slave controller it gets cleared
in clear_slave_dma_status. Current implementation checks
DSI_CTRL_CMD_BROADCAST_MASTER flag to decide if it's slave or not.
But, in the case of unicast, this flag is not set, leading to
the unnecessary poll for clear_slave_dma_status for all unicast
command transfers.

Add a check to call clear_slave_dma_status only when the current
command is broadcast on slave controller.

Change-Id: I7156f8c12ec779b41dafc8fc67639814957ee51b
Signed-off-by: Rajeev Nandan <quic_rajeevny@quicinc.com>
2021-11-23 19:32:39 +05:30
qctecmdr
34bf93819e Merge "disp: msm: dsi: Support uncompressed rgb101010 format" 2021-11-23 02:32:49 -08:00
Jayaprakash Madisetty
67ef82eb35 disp: msm: sde: avoid CWB in power on commit
This change depends on HAL change which sets CONNECTOR_SET_CRTC
property to null for cwb conn, if cwb is enabled during power off commit.
This causes power off commit crtc_state's active_changed and
connectors_changed set to true, which is causing seamless_crtc
to true during msm_disable_outputs and this leads to invalid crtc
state. This change modifies the seamless_crtc condition and
the msm_crtc_set_mode callback is early returned during such cases
to power off crtc.

Without this change, during power on commit crtc_duplicate_state
is causing cwb to turn on and the release fence is being created with
+2 offset in such case, leading to late release fence signalling and
further GPU fence timeouts.

Change-Id: Ibe87a8c0e8083d619ee6f502b2a946e1e8ef5553
Signed-off-by: Jayaprakash Madisetty <jmadiset@codeaurora.org>
2021-11-20 13:01:25 +05:30
longzhao
77edd61d98 disp: msm: sde: avoid sde irq enable or disable when sde irq not active
During the sde_irq_update, the sde irq may not be active, the enable
or disable will be nonsence. set the irq_num init value to negtive, if
this value change, means sde irq_num has been initial.

Change-Id: I7b23c662ccc9db0b38550897adb939305d941e6a
Signed-off-by: longzhao <longzhao@codeaurora.org>
2021-11-18 18:00:26 +08:00
Ritesh Kumar
20c46f6fa6 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-17 20:58:17 -08:00
qctecmdr
7c9c407fd5 Merge "disp: msm: add support for twm entry" 2021-11-16 22:16:02 -08:00
qctecmdr
dfbbb08fe4 Merge "disp: rotator: remove ubwc format support for rotator" 2021-11-15 23:13:52 -08:00
osaisruj
1e20848d49 disp: msm: add support for twm entry
Skip backlight updates and panel off commands
during twm entry.

Change-Id: I7656fa0d513a8a3e82d9bbbf5c3f85c1b84ee9da
Signed-off-by: osaisruj <osaisruj@codeaurora.org>
2021-11-10 12:38:14 +05:30