Commit Graph

339 Commits

Author SHA1 Message Date
Mahadevan
bbbf6aae8a disp: msm: sde: reset llcc_active of crtc on suspend commit
In Commit N, llcc is enabled. However in Commit N+1, suspend
is triggered without a llcc disable commit. As a result, llcc
remains active, preventing ADSP from entering the island.

Change-Id: I36fd8cc8c3f8a97e18b53507749a1b639f0c0cfd
Signed-off-by: Mahadevan <quic_mahap@quicinc.com>
2024-04-15 08:36:26 -07:00
Jayaprakash Madisetty
53615194b4 disp: msm: sde: disable dest scaler on suspend event
Destination scaler hw can be enabled and disabled runtime for
sharpness only case through QDCM.

Customer is using shared DSI solution and issue scenario is:

1) DS0 configured and enabled for INTF1 display1.
2) Suspend commit is triggered with DS0 disable configuration but
   driver programming doesn't happen as crtc is not enabled.
   for customer case, GDSC is not turned off due to extra vote.
3) On resume commit on INTF1 display2 with different resolution,
   DS0 is not configured from userspace, but in HW,
   DS0 programming is retained.
4) Due to this retained programming, DSI underflow is seen in
   resume commit.

Add changes to disable dest scaler qseed opmode and merge ctrl
as part of cp crtc disable sequence.

Change-Id: Ibb39814e02870394da4c7c7318e6e2780fed9081
Signed-off-by: Jayaprakash Madisetty <quic_jmadiset@quicinc.com>
2024-03-14 18:04:29 +05:30
Mahadevan
d8db76b3ff disp: msm: sde: clear wb mode and cached cwb encoder mask
The issue scenario is as follows
1. A CWB commit has run and it has disabled. Composer kill is
   done.
2. If Composer starts again or another client has open DRM
   the previous cwb state is intact.
3. When userspace is trying to query wb modes, primary modes
   which are attached to wb as part of cwb commit is exposed.

This leads to commit failures if userspace is trying to trigger wb
on the same CRTC of what primary has run cwb before. This change
properly clears wb mode and the cached encoder mask to avoid commit
failures.

Change-Id: I4ca8bd2b52a980630b7fb1319bf67b718ebb2ac2
Signed-off-by: Mahadevan <quic_mahap@quicinc.com>
2024-01-17 20:35:46 +05:30
Christopher Braga
e28ff0d8fd disp: msm: sde: Clear CRTC cached ROI on IPC
Testing of the SPR feature shows IPC restore frames where partial update
programming is not applied. This is a result of the pre-IPC cached ROI
region being used for filtering of CRTC ROI changes.

Update the CRTC cached ROI logic to clear the cached ROI on IPC events.
This ensures color processing partial update logic handles the post IPC
frame with a clean state.

Change-Id: I4e337bd150d02e4c8934ca04c0d632d5ad71dd5d
Signed-off-by: Christopher Braga <quic_cbraga@quicinc.com>
2023-11-02 14:32:34 -04:00
Akash Gajjar
25935c5ba5 disp: msm: sde: parse ddr string based on detected ddr type
Add property to parse and select the ddr string based
on the detected ddr type.

Change-Id: I012b10e31a21a7a1a0e279df119e9803e2d5a0ce
Signed-off-by: Akash Gajjar <quic_agajjar@quicinc.com>
2023-10-06 17:33:40 +05:30
Renchao Liu
681524cca9 disp: msm: sde: swap right mixer flag
Change swaps right mixer flag when swapping mixer.
Histogram IRQ is registered to unexpected mixer
index if both mixers' right mixer flag set as false.

Change-Id: I0243d70129dc0c3bff24cabc8877c626101acd83
Signed-off-by: Renchao Liu <quic_rencliu@quicinc.com>
2023-09-11 17:50:03 -07:00
qctecmdr
b9d7d0d286 Merge "disp: msm: sde: Add roi region for spr" 2023-08-09 13:04:53 -07:00
Qing Huang
afeb7da4d7 disp: msm: sde: Add roi region for spr
Provide spr_roi region for spr over fetch in partial update.
Support different the roi size of connector and crtc.

Change-Id: Ic78a20badcafefd353a97532281dae26e5a772de
Signed-off-by: Qing Huang <quic_huangq@quicinc.com>
2023-08-09 01:28:39 +08:00
Yu Wu
bb70fda262 disp: msm: sde: add buffer size checks
Add buffer size checks to improve code quality.

Change-Id: I99c64d6157d7b0475b0b28e093ea70820981fddd
Signed-off-by: Yu Wu <quic_zwy@quicinc.com>
2023-07-04 14:23:43 +08:00
Yu Wu
59b4bc2772 disp: msm: sde: add parameters checks to improve code quality
Add more parameter check including NULL pointer check, buffer
access bonds check etc.

Change-Id: I8d2a4967bed8750c206bc6d265205b257fc999c3
Signed-off-by: Yu Wu <quic_zwy@quicinc.com>
2023-06-15 11:02:23 +08:00
Mitika Dodiya
b573201f7c disp: msm: sde: demura backlight adaptation change
Demura backlight value will be updated based on the backlight event
in the driver. Make HFC gains programmable based on backlight value.

Signed-off-by: Mitika Dodiya <quic_mdodiya@quicinc.com>
Change-Id: I74e9aa2c274eedb473095c5eafef194d6a6f1d94
2023-06-05 04:33:58 -07:00
GG Hou
5f4735e2ce disp: msm: sde: fence error handling for wb and cwb retire fence
Fence error handling for wb and cwb retire fence.
Signal the retire fence for the fence error frame.

Change-Id: I0f73195c50edab4b8aefb58cea342214be87584c
Signed-off-by: GG Hou <quic_renjhou@quicinc.com>
2023-05-14 23:57:59 -07:00
GG Hou
d2812ee4e7 disp: msm: add support for display clients to register for fence error
Add framework for display submodules like PP, DSI, DP to register
for fence error and call the client callback funtion when fence
error occurs.

Change-Id: I70cc6b01907177e6c4238c4398fe2c085a000322
Signed-off-by: GG Hou <quic_renjhou@quicinc.com>
2023-05-14 23:55:51 -07:00
GG Hou
54209fb4d0 disp: msm: sde: sw fence error handling
Sw fence error handling addresses following:
a. out of order handling
  - For cmd panel, signal the release fence and retire fence once
    sw fence error detected.
  - For vid panel, signal the fence error frame release fence and
    retire fence once sw fence error detected, hold the release
    fence of last good frame till next good frame.
b. avoid BW decrease vote
c. lut dma reset
d. cancel kickoff

Change-Id: Ic496c532a26d80e0ef0074624ef6ace01c4ab2f0
Signed-off-by: GG Hou <quic_renjhou@quicinc.com>
2023-05-15 14:54:03 +08:00
GG Hou
a658fb17b7 disp: msm: sde: dma fence out of order handling in fence error case
Handle out of order dma fence signalling and propagation of fence
error. Out of order fence signaling is required only in Video mode.
For example, in case of N, N+1, N+2 frames where N, N+2 are good
frames and N+1 is frame with fence error. The release fence signal
sequence in video mode would be N+1, N, N+2.

Change-Id: I8b6f88cfeee945e28571b765f24ffea22fad23b8
Signed-off-by: GG Hou <quic_renjhou@quicinc.com>
2023-05-14 20:15:49 -07:00
GG Hou
725c7a0f3d disp: msm: sde: add support for hw fence error handling
Register callback function to hw fence driver and implement the
callback funtion.

As part of fence error handling, address out of ordering of HW
fences, SW override for release fence signal and handle BW voting
in both cmd and video mode.

Change-Id: I22902762b4cc09a5f5a20cf0dd01fc336a0f0cb4
Signed-off-by: GG Hou <quic_renjhou@quicinc.com>
2023-05-14 20:13:58 -07:00
GG Hou
97b1afdda8 disp: msm: add property to handle fence error in driver
Add a new property CRTC_PROP_HANDLE_FENCE_ERROR for userspace
to enable or disable fence error handling.

Change-Id: I72370f405c5299c603b0d673720c28a68c00807a
Signed-off-by: GG Hou <quic_renjhou@quicinc.com>
2023-05-14 20:12:02 -07:00
Raviteja Tamatam
26c011089e disp: msm: sde: propagate the error code in dual display TUI cases
Propagate error in case the number of active displays is greater
than 1, in dual display scenario to fail the validate.

Change-Id: I04250af8d7a6b0c290132abbaed2ed8e5e311a4f
Signed-off-by: Raviteja Tamatam <quic_travitej@quicinc.com>
2023-04-26 12:01:53 -07:00
Lakshmi Narayana Kalavala
2751ec018d drm: msm: skip re-marking color processing features as dirty
Current implementation we apply the color properties when atomic begin
is called and mark features as dirty if crtc is not enabled.
For some of the non double buffered features in video mode we will
see a corruption. Change removes marking color properties as dirty
based on crtc on/off.

Change-Id: I4d93b14627d2bc06fcbca3ea9538a4baedb00e56
Signed-off-by: Lakshmi Narayana Kalavala <quic_lkalaval@quicinc.com>
2023-03-28 18:09:49 -07:00
Nilaan Gunabalachandran
68d3217032 disp: msm: sde: use rate limited print for crtc event thread
When the vblank event overflow error log occurs due to an inability
to handle incoming vblanks, it is posisble to continuously flood
with error print logs. This could cause the CPU to become further
blocked and creates a cycle of failed callbacks and error logging.

This change changes the overflow log in the crtc event thread to
rate limited.

Change-Id: Ie2d77689c8fa989cf3a294f973851b7dacef098b
Signed-off-by: Nilaan Gunabalachandran <quic_ngunabal@quicinc.com>
2023-03-01 16:22:58 -05:00
Nilaan Gunabalachandran
6860fee2c8 disp: msm: sde: update vblank notify to use spin_lock_irqsave
If the event thread worker processing vblank_notify_work is
scheduled out while holding spinlock to process the ctl-done
interrupt, it will result in a deadlock as the
frame_event_callback requires the same spinlock.

This change updates vblank notify work to use spin lock irqsave &
irqrestore to ensure we don't hit this case.

Change-Id: I96bcb3b21bf9426016f5b3ae43f7d1f8581a8483
Signed-off-by: Nilaan Gunabalachandran <quic_ngunabal@quicinc.com>
2023-02-16 17:26:43 -05:00
Anjaneya Prasad Musunuri
95e583e413 disp: msm: sde: clear cached rectangles when PU ROI is set
clear cached rectangles when PU ROI is set to avoid incorrect
cached rois when two subsequent state duplications occur due
to timing. This will lead to commit N and commit N+1 to have
same cached ROIs as commit N-1. This results in issues when
commit N-1 is PU, N is full frame and N+1 is PU with same
ROI as N-1.

Change-Id: I3bb9390e500d327e703e41d64f7aaae5e5f1b4f2
Signed-off-by: Anjaneya Prasad Musunuri <quic_aprasad@quicinc.com>
2023-02-07 22:38:29 -08:00
Veera Sundaram Sankaran
24b4c7cb64 disp: msm: sde: move vblank signaling to event thread
When precise vsync timestamp feature is enabled, move the vblank
signaling from interrupt context to event thread. This helps in
freeing up the interrupt context soon. The precise vsync timestamp
feature along with DRM hooks to get the vblank timestamp will get
the correct timestamp though the event thread is scheduled later.

Change-Id: I77002913f222ff422b6118f9fc952533065c07aa
Signed-off-by: Veera Sundaram Sankaran <quic_veeras@quicinc.com>
2023-01-27 14:32:30 -08:00
Christina Oliveira
bb846fab11 disp: msm: sde: increase display kickoff timeout for hw-fences
Starting with HW-Fencing, the frames hw kickoff
can take longer to trigger, given that HW will wait for the
input fences signal. Therefore, this change increments
the time-outs to wait up to ~10 secs, which corresponds
to the current input dma-fences timeout. This ~10secs
wait is given in intervals, where the dma-fence is also
checked, so in case that the client producer of the fence
signals the dma-fence, but misses the hw-fence signaling,
Display driver can handle this case and do a sw-override
to start the fetching of the incoming frame without waiting
for the input hw-fence ipc signal.

Change-Id: I6fcacbbaa79ca9847da616bd52efdda4bb8fccae
Signed-off-by: Christina Oliveira <quic_coliveir@quicinc.com>
2023-01-24 14:52:23 -08:00
Christina Oliveira
87bee41901 disp: msm: sde: add input fence dump upon commit done timeout
This change adds debug changes to dump the input fences during a
commit done timeout, when input hw-fences are enabled.

Change-Id: Ia778d3d73ab8ee795613587da70ef9bebb7c73ca
Signed-off-by: Christina Oliveira <quic_coliveir@quicinc.com>
2022-12-21 11:08:10 -08:00
Nilaan Gunabalachandran
a6dca718e5 disp: msm: sde: add support for stale llcc APIs
This change adds support for enabling the system cache
slices with staling. This allows back to back static display
cache usecases to self evict prior to using cache.

Change-Id: Iea71da26a8f7a450822624305dc20a3bab323d4b
Signed-off-by: Nilaan Gunabalachandran <quic_ngunabal@quicinc.com>
2022-12-01 15:19:08 -05:00
qctecmdr
fb5ecba0af Merge "disp: msm: sde: add events to input and output hw-fences" 2022-11-13 01:12:23 -08:00
Ingrid Gallardo
188cfbc717 disp: msm: sde: fix to avoid creating hw-fences for empty spec fences
Current display driver sets the hw-fences as valid even when
the speculative fence is empty. Avoid this issue by doing a
positive check and only create hw-fences if all the fences in
the speculative fence are valid.

Change-Id: Iec9636641ac9146eb651be08615e2478994c2508
Signed-off-by: Ingrid Gallardo <quic_ingridg@quicinc.com>
2022-11-11 07:14:55 -08:00
Ingrid Gallardo
d57732d554 disp: msm: sde: remove unnecessary debug message
Move print message from error to debug for a failure that is not fatal
but can be expected when a crtc doesn't have a hw ctl, in this case
driver will handle the output fence as a sw-fence.

Change-Id: I908135dce4336b0c9ec3fa388dc9211c6df97f68
Signed-off-by: Ingrid Gallardo <quic_ingridg@quicinc.com>
2022-11-11 07:14:48 -08:00
Raviteja Tamatam
a2d05648c2 disp: msm: sde: fix error message in sde_crtc_opr_event_notify
Fix error message arguments in sde_crtc_opr_event_notify
function.

Change-Id: Ibfb4b4a298bc9ec8128061a103ce6500ec1cce29
Signed-off-by: Raviteja Tamatam <quic_travitej@quicinc.com>
2022-11-07 10:39:19 -08:00
Shamika Joshi
f28d9e0a6a disp: msm: sde: add support for INTF WD long term jitter restore from ipc
Change adds support for storing the INTF watchdog timer long term jitter
curve state. The state before collapse is stored in wd_jitter and
restore back during power restore.

Change-Id: Id83b5cc754daea89d7844ab67b38e12199525ff8
Signed-off-by: Shamika Joshi <quic_shamjosh@quicinc.com>
2022-10-25 21:06:39 -07:00
Veera Sundaram Sankaran
1b1618ed36 disp: msm: sde: avoid setting plane qos_dirty during cwb modeset
The encoder modeset updates all the plane's qos_dirty flag attached
to the crtc to make sure the qos params are updated during seamless
mode-switch cases like fps or resolution switch. But this is not
required for cwb encoder modeset as it does not have any effect on
the planes attached to the main display. Add check to avoid this
reprogramming.

Change-Id: I1ab7a71971b7200a50e6643407327734b1c9cbc5
Signed-off-by: Veera Sundaram Sankaran <quic_veeras@quicinc.com>
2022-10-24 07:29:15 -07:00
Nilaan Gunabalachandran
a0f3537872 disp: msm: sde: include file.h
This change adds includes for <linux/file.h> required for the
display driver in kernel 5.19.

Change-Id: Ibe5401997b43844b692869ebb6d28faa7bcb7740
Signed-off-by: Nilaan Gunabalachandran <quic_ngunabal@quicinc.com>
2022-10-10 11:21:55 -07:00
Veera Sundaram Sankaran
58bff0115e disp: msm: sde: move some frame_events from crtc commit to event thread
Move frame data stats collection/notification during frame-done and
retire fence sysfs notification to event thread. This will free up
some interrupt time.

Change-Id: I2648ac4287ce8712e9a059edd408a59753aa6d32
Signed-off-by: Veera Sundaram Sankaran <quic_veeras@quicinc.com>
2022-09-23 11:48:34 -07:00
Veera Sundaram Sankaran
d44f0ff715 disp: msm: sde: use new connector state for topology checks
Use with the new connector state during validation phase for
checking the 3d-merge topology, since this is the state that
needs to be validated.

Change-Id: Ie212f948affa4dc439ef508363bac6713e560006
Signed-off-by: Veera Sundaram Sankaran <quic_veeras@quicinc.com>
2022-08-22 14:29:16 -07:00
Veera Sundaram Sankaran
51775dd093 disp: msm: uapi: increase SDE_FRAME_DATA_MAX_PLANES size
MDSS 9.0.0 supports 10 pipes, so modify the max_planes
accordingly. This is used for the frame_data transfer
between user/kernel and since its a new feature added
there is no backward compatibility that needs to be handled
for this uapi change. Add corresponding bound check during
the usage.

Change-Id: I0853fcc55395855d798f2c1b03cf9bf7b4bd3c96
Signed-off-by: Veera Sundaram Sankaran <quic_veeras@quicinc.com>
2022-08-19 13:10:39 -07:00
Veera Sundaram Sankaran
3550ca8f9f disp: msm: sde: add crtc width restriction when 3d-merge is enabled
Add validation during crtc_atomic_check to have crtc width as
multiple of 4 when dualpipe 3d-mux is enabled and multiple of 8
when quadpipe 3d-mux is enabled. This ensures each layer mixer
is having an even width.

Change-Id: I5dc173c1b0349430a8e12a7b1c9440c7854e7ecd
Signed-off-by: Veera Sundaram Sankaran <quic_veeras@quicinc.com>
2022-08-16 18:44:17 -07:00
Nilaan Gunabalachandran
eab3fd66db disp: msm: sde: convert ubwc stats roi into blob property
This change converts the ubwc stats roi into a blob property. This
allows for the roi data structure to be passed into kernel.

Change-Id: I4b30dcc16bcbd152428861444ff321add860942f
Signed-off-by: Nilaan Gunabalachandran <quic_ngunabal@quicinc.com>
2022-08-11 11:45:14 -07:00
Veera Sundaram Sankaran
ac427feb9e disp: msm: sde: reduce stack size in _sde_crtc_check_rois
Use pointer and allocate dynamic memory for msm_mode_info
in _sde_crtc_check_rois instead of object to reduce the
stack memory size.

Change-Id: Ida8fc7e2b94e19b3c791dcda55a465a4107ef976
Signed-off-by: Veera Sundaram Sankaran <quic_veeras@quicinc.com>
Signed-off-by: Jeykumar Sankaran <quic_jeykumar@quicinc.com>
2022-08-03 14:27:06 -07:00
Christina Oliveira
b4a071ae7f disp: msm: sde: disable hw-fencing for commit before vm transition
This change disables hw-fencing for the last commit before
vm transition. This avoids configuration issues if hw-fencing is
disabled in the incoming VM.

Change-Id: I573b7d1665f8cef442168bd0ab83a4b2b6cebbb6
Signed-off-by: Christina Oliveira <quic_coliveir@quicinc.com>
2022-07-28 13:18:23 -07:00
Veera Sundaram Sankaran
84d43e8596 disp: msm: sde: add check for layer-mixer width
Add check in layer mixer to avoid odd values as HW does not
support it.

Change-Id: Ifddd2047c81a016b774712ee52cfceca83374e6d
Signed-off-by: Veera Sundaram Sankaran <quic_veeras@quicinc.com>
2022-07-20 21:27:54 -07:00
qctecmdr
2a3b371021 Merge "disp: msm: sde: add wait on spec fences for hwfencing" 2022-07-20 16:11:13 -07:00
Christina Oliveira
15e352d634 disp: msm: sde: add wait on spec fences for hwfencing
This change adds a wait for input spec fence to bind
before registering for hw fencing wait on it.

Change-Id: I5453547c29672e39a95b91197983075e3b61d1eb
Signed-off-by: Christina Oliveira <quic_coliveir@quicinc.com>
2022-07-12 10:53:03 -07:00
Veera Sundaram Sankaran
90dd259f15 disp: msm: sde: avoid demura layers validation against crtc w/h
When destination scaler feature is enabled along with demura,
the crtc w/h will be lesser than the deumra layer w/h as it is
based on the panel w/h. Remove the invalid validation of
demura layers against crtc w/h to allow this usecase.

Change-Id: I5afd0407382a1bce458c97fcf8d571f5e7c0774f
Signed-off-by: Veera Sundaram Sankaran <quic_veeras@quicinc.com>
2022-06-14 10:20:13 -07:00
Veera Sundaram Sankaran
30aa675422 disp: msm: sde: add missing validations for dnsc_blur
Add crtc checks to ensure the crtc width is always even number,
so there is no loss while dividing by num_mixers. Add checks in
dnsc_blur to ensure the src is always greater than the dest.

Change-Id: I876f19aa20857dc9ed2649c9cb7569348e7d5fd3
Signed-off-by: Veera Sundaram Sankaran <quic_veeras@quicinc.com>
2022-05-26 16:17:16 -07:00
Veera Sundaram Sankaran
b40c05519d disp: msm: sde: log vblank timestamp in eventlogs
Log the vblank timestamp during vblank callback. This will be
useful in calculating the precise difference between the vsync
while debugging. As part of the change, remove the vblank
counter logging in sde_crtc as it floods the logs with 4 entries
for each vblank request.

Change-Id: I6b532ad657581fb2a34318541acbd81a44858819
Signed-off-by: Veera Sundaram Sankaran <quic_veeras@quicinc.com>
2022-05-23 14:09:11 -07:00
Christina Oliveira
21ca2acab9 disp: msm: sde: add support for hwfence profiling
This change adds hwfence input and output fence profiling
registers and debugfs to enable them.
To enable input hw fences timestamps:
echo 0x1 > /d/dri/0/debug/hw_fence_status
To enable output hw fences timestamps:
echo 0x2 > /d/dri/0/debug/hw_fence_status
To enable both, input and output hw fences timestamps:
echo 0x3 > /d/dri/0/debug/hw_fence_status.

Change-Id: I269a38f3843a01ec8c0816890e50bb7d847a4ed9
Signed-off-by: Christina Oliveira <quic_coliveir@quicinc.com>
2022-05-18 09:38:40 -07:00
Christina Oliveira
d2d060cf80 disp: msm: sde: add hw fence support for prog line count
This change adds support for triggering output
hw fence upon programmable line count.

Change-Id: Ie4b8252e4f9a448a8c11d17696b9bb0ded81b04b
Signed-off-by: Christina Oliveira <quic_coliveir@quicinc.com>
2022-05-16 12:45:49 -07:00
Christina Oliveira
5f554a52b9 disp: msm: sde: disable hw_fence for cmd/vid mode switch
This change disables hw_fences when a mode switch
from video to command mode or command to video mode
is ongoing.

Change-Id: I6f99226b59b381c6d2ff34a85753f8608080f546
Signed-off-by: Christina Oliveira <quic_coliveir@quicinc.com>
2022-05-16 12:45:12 -07:00
Christina Oliveira
640c8111d3 disp: msm: sde: add support for hw-fence feature
Starting mdss 9.0, dpu supports triggering
the frame fetch through hw-fencing. This change
adds support for this hw-fence feature.

Change-Id: Icc7d0b69fc2a51103d14612f5ac89b44a47ed826
Signed-off-by: Ingrid Gallardo <quic_ingridg@quicinc.com>
Signed-off-by: Christina Oliveira <quic_coliveir@quicinc.com>
2022-05-16 12:41:28 -07:00