Commit Graph

182 Commitit

Tekijä SHA1 Viesti Päivämäärä
Nilaan Gunabalachandran
8e2e3358d6 Revert "disp: msm: sde: Avoid kcallocs in atomic commit path"
This reverts commit 6886d03e4a.
It tries to memset the pstate from UI thread (crtc atomic check)
and crtc commit thread.

Change-Id: Ic9d3e5555d7085832df76025e53488d2b3365739
Signed-off-by: Nilaan Gunabalachandran <ngunabal@codeaurora.org>
2021-03-02 09:06:22 -05:00
Gopikrishnaiah Anandan
e7c7283510 disp: msm: sde: add support for noise layer
DPU has added support for noise injection into the layer stack. Change
adds support for noise layer programming and exposes the hardware block
to the user space modules.

Change-Id: Id176eea54fcdcd5d399457b14133a1ccde07299f
2021-02-23 15:56:36 -08:00
Chandan Uddaraju
4fe3d97078 sde: wb: add changes to support Dedicated-CWB
Add new capture/tap point as CRTC property for
D-CWB feature. Update the hardware blocks and
corresponding APIs to configure D-CWB data path.
Add new hardware pingpong blocks that
are dedicated for CWB.

Change-Id: I22576df1768b50f9f47d8527f62913b01ff4d9a7
Signed-off-by: Chandan Uddaraju <chandanu@codeaurora.org>
2021-02-19 12:52:59 -08:00
Samantha Tran
73373271a7 disp: msm: sde: add multirect error status for ubwc and meta
This change adds support for error checking ubwc and meta error status
based off whether REC0 or RECT1 is used.

Change-Id: I7c39755da99a9d6c0d02b4ef16fa93b8ec7458a9
Signed-off-by: Samantha Tran <samtran@codeaurora.org>
2021-02-09 22:12:38 -08:00
Samantha Tran
6886d03e4a disp: msm: sde: Avoid kcallocs in atomic commit path
To avoid kcalloc for the multirect plane states and plane states will now
be stored sde crtc. These states are populated momentarily and accessed in
a single context for a handful of functions then are not used. This will
clean up parameters passed between functions in the commit path as well.

Change-Id: I6a8116a43c140b3f1c0464734032b8db13c1cfb0
Signed-off-by: Samantha Tran <samtran@codeaurora.org>
2021-01-28 08:04:08 -08:00
Ingrid Gallardo
a005a785fe disp: msm: add support to request mdp core clk through mmrm
For Waipio onwards, mdp core clock rate needs to be requested
through the mmrm driver, which will make sure the requested
rate can be sustained by the its power rail, which is shared
by multiple clients.
Current change adds the support to request the mdp core clk rate
through mmrm driver as well as returns the corresponding failures
to user space during when a rate cannot be supported by the
system.

Change-Id: Icc0e8ab5b71e8c99baf7913bdbd96d9504cc11ae
Signed-off-by: Ingrid Gallardo <ingridg@codeaurora.org>
2021-01-12 14:07:00 -08:00
orion brody
d00d481360 disp: msm: move from drm_mode to msm_mode
Move away from the private and private_flags fields from drm_mode,
as it is being deprecated in latest kernel version. Instead, Add
msm_display_mode as a wrapper to be used in downstream to store these
parameters. Also, store msm_mode in connector_state to be accessed
in commit path.

Change-Id: Ia5bdebe75f00aa15fb7db4dc3a0d50c30894a95c
Signed-off-by: Orion Brody <obrody@codeaurora.org>
2021-01-04 13:18:36 -08:00
Samantha Tran
262099e94a disp: msm: replace kzfree with kfree
This change replaces kzfree with kfree as kzfree has been
renamed.

While moving to the latest 5.10 tip, additional small changes
were required to resolve compilation issues:

set_dma_ops has moved from dma-mapping to dma-map-ops header.
This change includes the new header file required.

drm_panel_add returns void, this change removes the expected
return value check.

drm_prime_pages_to_sg takes an additional parameter. This change
passes in the drm_device pointer the function is looking for.

Remove an unused variable in sde_crtc vblank function.

Change-Id: I47c085c0cb64432873c2e750ae64cbdc2b5340da
Signed-off-by: Samantha Tran <samtran@codeaurora.org>
2020-12-22 10:42:18 -08:00
Samantha Tran
ee58486c84 disp: msm: move vblank enable and disable to crtc hooks
Upstream now prefers to utilize vblank enable and disable
through crtc hooks rather than drm driver. Remove
calls from kms vblank enable/disbale.

Change-Id: Ic6911838f14f93a0d277b7bdc2c1968270ec25a2
Signed-off-by: Samantha Tran <samtran@codeaurora.org>
Signed-off-by: Nilaan Gunabalachandran <ngunabal@codeaurora.org>
2020-12-17 10:25:06 -05:00
Steve Cohen
2aaadbc5c7 disp: msm: sde: flush all event thread work during CRTC disable
The API to flush the event thread is only flushing the
frame_event work queued on that thread but during disable
the vblank work must also be flushed. Instead of flushing
only frame_events work, flush all work queued on the event
thread worker. Also rename the API to more accurately describe
what it's doing.

Change-Id: Iaf248a2b1bafc9b9a15ae9447b72cdff07509a91
Signed-off-by: Steve Cohen <cohens@codeaurora.org>
2020-12-03 11:26:00 -05:00
qctecmdr
a2a3c5e864 Merge "disp: msm: sde: cache encoder_mask for vblank_work" 2020-11-24 06:44:04 -08:00
Linux Build Service Account
3f6007cead Merge "disp: msm: sde: reset sw state on vm transition" into display-kernel.lnx.5.4 2020-11-20 17:17:32 -08:00
qctecmdr
316f28ff40 Merge "disp: msm: sde: add check to fix null pointer dereference" 2020-11-19 21:56:31 -08:00
Abhijit Kulkarni
fef65e7b8c disp: msm: sde: reset sw state on vm transition
This change resets the plane and crtc dirty properties on
transition to other VM. This ensures when the VM acquires the
hw again all these properties on the new state are reapplied.

Change-Id: Id95676453eb9ae937b1b22f0e244b47449101cb0
Signed-off-by: Abhijit Kulkarni <kabhijit@codeaurora.org>
2020-11-18 14:37:04 -08:00
Mahadevan
a3fdf9025e disp: msm: sde: add check to fix null pointer dereference
In pstate_cmp the plane_state structures are accessed
without checking it is allocated or not, which leads to
null pointer dereference. To fix it NULL check is added.

Change-Id: I5982138b396b70979205d87bc9aa260d9501fee0
Signed-off-by: Mahadevan <mahap@codeaurora.org>
2020-11-18 13:15:47 +05:30
Steve Cohen
aa064ada86 disp: msm: sde: cache encoder_mask for vblank_work
There is a race between disable commit swap-state on display
thread and vblank work on event thread which may skip applying
the vblank vote if the encoder_mask has already been cleared.
To avoid the race, use a cached encoder_mask that is gauranteed
to be valid between the vblank_on and vblank_off calls.

Also, vblank queue work is initializing a variable that's never
used and msm_disable_outputs has 2 instances of pointers to old
CRTC state. Remove this dead code.

Change-Id: I5e4a482b8f067e272a2aef5afa08cc0e1ab89434
Signed-off-by: Steve Cohen <cohens@codeaurora.org>
2020-11-17 17:24:30 -05:00
qctecmdr
76dcac0a20 Merge "Revert "disp: msm: sde: fix race between disable commit and vblank work"" 2020-11-12 21:31:11 -08:00
qctecmdr
e09f74663b Merge "disp: msm: sde: use current crtc state during idle work scheduling" 2020-11-11 01:16:23 -08:00
Steve Cohen
f6cfe46a3c Revert "disp: msm: sde: fix race between disable commit and vblank work"
This is a partial revert of commit:
	31dd25c623.

The enc->crtc link cannot be relied upon outside of the display
thread context since the DRM legacy modeset API will detach and
re-attach this connection on every commit.

The logic to flush the event thread in all cases during the CRTC
disable is kept from the original patch.

Change-Id: I2cd4ae47589bb397c72de0e9deba9b0c710d379a
Signed-off-by: Steve Cohen <cohens@codeaurora.org>
2020-11-10 14:45:45 -05:00
Yashwanth
8249e8b7f3 disp: msm: sde: use current crtc state during idle work scheduling
In the current code, previous crtc state is used to know
the idle timeout period and to schedule the idle notify
work. Due to this, notify work is not getting scheduled
in some cases even when idle timeout is specified. This
change uses current state for idle timeout period.

Change-Id: I3ff4df6a8edd6a5a20d2e19c3c27ebb221694ac1
Signed-off-by: Yashwanth <yvulapu@codeaurora.org>
2020-11-06 15:57:58 +05:30
Steve Cohen
31dd25c623 disp: msm: sde: fix race between disable commit and vblank work
This patch addresses the following sequence:
1. DRM framework drops vblank reference,
	work is queued on event thread
2. Lastclose stages disable commit,
	swap-state occurs on display thread
3. vblank worker runs on event thread
	encoder cannot drop the FW vblank reference since it's
	no longer in crtc->encoder_mask

Instead, iterate through all encoders and match the enc->crtc
back-pointer to be sure the vblank vote is applied. Also, flush
the event thread in all cases during the CRTC disable to be sure
the vblank work is complete before the back-pointer is removed.

Change-Id: Ib307e9aefc2d4f729a3af7a6140bc887684f4489
Signed-off-by: Steve Cohen <cohens@codeaurora.org>
2020-11-06 02:04:30 -05:00
Jayaprakash
0a5fdc0fc3 disp: msm: sde: increment refcount of dma_fence before access
Add changes to increment refcount of dma_fence before accessing
the input_fence structure in plane_state through debug_fs node and
decrement once access is finished. This prevents the use after free
issues when accessed through debug_fs node.

Change-Id: I262336ce2b86a94d7662d834e8fd3509dadda1bd
Signed-off-by: Jayaprakash <jmadiset@codeaurora.org>
2020-10-23 14:52:37 +05:30
qctecmdr
38f560fb02 Merge "disp: msm: sde: avoid mutex lock for crtc flush event thread" 2020-10-20 16:13:50 -07:00
Jayaprakash
d1b2e0be42 disp: msm: sde: add verbose evtlogs for debug purpose
Add changes to extend the current evtlogs for ease
of debug purposes.

Change-Id: Ibe136afbf25b8b8decfc06ef3868e3f628df4dcb
Signed-off-by: Jayaprakash <jmadiset@codeaurora.org>
2020-10-14 11:19:05 +05:30
Narendra Muppalla
47261ce97c disp: msm: sde: avoid mutex lock for crtc flush event thread
As per current design in crtc disable sequence event thread
can cause deadlock.This change avoids mutex lock for crtc
flush event thread to flush all event work.


Change-Id: Ia7156032bee9245fe84fd1621cf1994920b8e574
Signed-off-by: Narendra Muppalla <NarendraM@codeaurora.org>
2020-10-13 13:21:01 -07:00
qctecmdr
ff5233ee86 Merge "disp: msm: sde: only flush SSPPs when enabling sys-cache read" 2020-10-08 11:34:59 -07:00
Steve Cohen
0c946dca85 disp: msm: sde: only flush SSPPs when enabling sys-cache read
The worker function for enabling sys-cache re-uses the flushes
from the previous commit. This ends up flushing several
blocks which have no programming update. Instead, only flush
planes attached to the CRTC which is entering sys-cache state.

Change-Id: Ieed68a713e9e56a5718518cf1a6b632f37864fb9
Signed-off-by: Steve Cohen <cohens@codeaurora.org>
2020-09-28 13:21:06 -04:00
Yashwanth
312bd53656 disp: msm: sde: update input fence after plane state destroy
In few cases, even though input fence is freed, it might
get accessed through debugfs node while dumping fence list.
This change updates input fence to NULL in plane state
destroy once it is freed to prevent accessing it further.

Change-Id: I1a3799249e6a177af87653e17d014d1dad7ca638
Signed-off-by: Yashwanth <yvulapu@codeaurora.org>
2020-09-28 11:53:39 +05:30
qctecmdr
8f16ccc93b Merge "disp: msm: add support to notify retire frame event" 2020-09-21 03:57:31 -07:00
Lei Chen
c44e0b42df disp: msm: check max FPS of DFPS to update UIDLE configurations
It is not applicable for all DFPS cases to update UIDLE state
according to current frame rate. If DFPS changes frame rate
through vertical front porch values, the SDE clocks and transfer
time will not get changed accordingly, and it always get fixed
at max frame rate configuration of DFPS.
Add this change to check max FPS of DFPS instead of current
frame rate for UIDLE update, if DFPS is enabled with VFP.

Change-Id: I7634bce6a9eb1af212ba19a267735be08b20ae1f
Signed-off-by: Lei Chen <chenlei@codeaurora.org>
2020-09-15 09:51:30 +08:00
Yashwanth
98839886d3 disp: msm: sde: update syscache properties only if supported
This change avoids msm property install and cache state
transitions if sys cache is not supported in the target.

Change-Id: I00b0a95772b1a3dab67c7e684529cda093d6dac6
Signed-off-by: Yashwanth <yvulapu@codeaurora.org>
2020-09-09 12:17:07 +05:30
Raviteja Tamatam
e3f6420cee disp: msm: add support to notify retire frame event
Added sysfs entry on crtc to notify a retire frame event
which indicates start of new frame. It is added at same
time of signaling retire fence.

Change-Id: Ie60aae96bd6e6bfb3cfe9db482cb59053f22383f
Signed-off-by: Raviteja Tamatam <travitej@codeaurora.org>
2020-09-08 02:12:28 +05:30
qctecmdr
cdd14239fd Merge "disp: msm: sde: disable idle notification" 2020-09-03 21:41:46 -07:00
Abhijit Kulkarni
4f2c4ac27e disp: msm: sde: disable idle notification
This change disables sending idle notification if system
cache is already enabled. If system cache is enabled it
establishes that driver has already send prior
notification and no configuration change was requested.

Change-Id: I1aee002ab3c8c3d4193a8e7a4890d8e4f24da804
Signed-off-by: Abhijit Kulkarni <kabhijit@codeaurora.org>
2020-09-03 15:11:19 -07:00
Abhijit Kulkarni
3db847b7bf disp: msm: sde: fix vblank wait after cache read mode update
This change fixes the vblank wait after system cache read mode
update. Without this change the wait does not happen since there is
no pending kickoff. This change uses encoder api to flush the
configuration and explicitly waits for vblank.

Change-Id: I8942f9b638e784c8fd9b5df33a9ccc7087a5eaef
Signed-off-by: Abhijit Kulkarni <kabhijit@codeaurora.org>
2020-09-03 13:33:27 -07:00
qctecmdr
153926f999 Merge "drm: msm: add dspp caps blob to crtc" 2020-09-01 14:10:14 -07:00
Gopikrishnaiah Anandan
10e00393d8 drm: msm: add dspp caps blob to crtc
All sde crtc's are virtual when they are created. Resources for the crtc
is allocated when crtc is enabled. All crtc's will not have same
capabilities because some of the dspp blocks have additional hardware
blocks. Change exposes additional dspp capabilities dynamically when
crtc is allocated the dspp hardware block.

Change-Id: I93e76a1335574e4ca30d9419ef6cc6e8149e2c3c
Signed-off-by: Gopikrishnaiah Anandan <agopik@codeaurora.org>
2020-08-31 14:37:30 -07:00
Yashwanth
45d0998b96 disp: msm: sde: update misr check to configure misr in secure UI
This change updates misr checks so that misr can be
configured during secure display session. In the current
code, misr_reconfigure flag is set only when accessing
through debugfs node.

Change-Id: Ic3a8316a4881551da3f0f340f6ef5ae3fbe4913f
Signed-off-by: Yashwanth <yvulapu@codeaurora.org>
2020-08-31 19:38:51 +05:30
qctecmdr
18aab79fa2 Merge "disp: msm: sde: fix check for uneven split with dest-scaler" 2020-08-27 10:09:42 -07:00
Steve Cohen
43076f3a77 disp: msm: sde: fix check for uneven split with dest-scaler
Fix the check for uneven split across LMs when destination
scaler is used and reject the use-case since this is not
supported by the driver. This can happen if an odd-value
for the horizontal width is being split across 2 mixers.

The existing check was broken since it uses pass-by-value
with a zero initialized value that callee tries to update
while iterating over the DS configurations. Use pass-by-
reference with the previous DS configuration, if available,
instead of just 0 values so the proper comparisons can take
place.

Change-Id: I529faf57e43fb471b28b4d222260ea4d37217d4d
Signed-off-by: Steve Cohen <cohens@codeaurora.org>
2020-08-23 22:17:27 -04:00
Prabhanjan Kandula
f112e7aa61 disp: msm: sde: wait for done in system cache read mode update
In current driver, during system cache read mode update control flush
is invoked and there after commit thread is allowed to pick up next
commit. This can lead to improper frame flush and cause hangs or
underrun. This change add a wait till frame done after system cache
update to frame read mode.

Change-Id: Ic88e0bdbaaa1f45f825d40ecde4de9e8dea2efef
Signed-off-by: Prabhanjan Kandula <pkandula@codeaurora.org>
2020-08-21 10:46:54 -07:00
Linux Build Service Account
c29e22f272 Merge "disp: msm: sde: fix reset of mixer swapping" into display-kernel.lnx.5.4 2020-08-20 21:52:53 -07:00
qctecmdr
fc83bddf26 Merge "disp: msm: sde: Update UIDLE and QoS LUT when DRM mode is changed" 2020-08-20 14:24:30 -07:00
Abhijit Kulkarni
6a46828a29 disp: msm: sde: fix reset of mixer swapping
This change resets the mixer swapping flag in crtc on a
seamless mode switch. In case of switching from command
mode to video mode it is a seamless mode on crtc, but we
disable connector and encoder. Due to this crtc fails to
reset the mixer swap since it is tied to dsc merge topology
on master connector. In transient state master connector
is not set and is set only after enabling the new mode on
connector.

Change-Id: Idebdabd642625b894100f62aeb62f11a9c101b03
Signed-off-by: Abhijit Kulkarni <kabhijit@codeaurora.org>
2020-08-19 10:51:55 -07:00
Lei Chen
fb4edab2b3 disp: msm: sde: Update UIDLE and QoS LUT when DRM mode is changed
UIDLE and QoS LUT configurationis might be different between
different frame rates.
Add this change to update UIDLE and QoS LUT according to frame
rate when DRM mode is changed.

Change-Id: Ia16a963e185b911b7dd11e81a26cab732c2b185c
Signed-off-by: Lei Chen <chenlei@codeaurora.org>
2020-08-18 09:56:43 +08:00
Steve Cohen
b385a84e0d disp: msm: sde: only program LM size when needed
LM size does not need to be reprogrammed on every frame. Add
a check to only reprogram it when the size changes (or coming
out of power collapse). Some color processing features require
an update when this happens as well (i.e. resolution switch,
partial update, or dest scaler reconfigure). This patch allows
for notifying CP of the updated dimensions when a change occurs.

Change-Id: Ia7f794e53e1f03302c83e442e2a1288611c7c50b
Signed-off-by: Steve Cohen <cohens@codeaurora.org>
2020-08-14 20:24:58 -04:00
qctecmdr
20ed4f0785 Merge "disp: msm: sde: disable border color on empty blendstage" 2020-08-13 16:50:24 -07:00
Abhijit Kulkarni
9c9159afdb disp: msm: sde: disable border color on empty blendstage
This change disables the border color on the layer mixer,
based on the caller's request. This is required to totally
disconnect the layer mixer hardware when it is not
participating in blending the pixels. Having empty blendstage
but border color enabled, allows Layer mixer hw to produce
border pixels even when blend stage is empty.

Change-Id: I8e84aeedffbd42ad793a167a6cc5a3a653864c1a
Signed-off-by: Abhijit Kulkarni <kabhijit@codeaurora.org>
2020-08-10 18:29:04 -07:00
Steve Cohen
e996b868b2 disp: msm: sde: mark LTM as dirty when dest-scaler is updated
Mark LTM as dirty when dest-scaler is updated so it matches with
the mixer configuration.

Change-Id: I5f2b166ec5eb0bafc4c75f8b3268c3e85c558191
Signed-off-by: Steve Cohen <cohens@codeaurora.org>
2020-08-05 22:04:56 -04:00
Narendra Muppalla
f8e7d9d5d1 disp: msm: sde: program misr at encoder kickoff stage
As per current design misr enable sequence is happening at
atomic check level. At this state, misr configuration may reset
if clocks are enabled through atomic commit sequence. This change
moves misr enable/disable sequence from debugfs context to
encoder kickoff to avoid misr register reset with idle pc.

Change-Id: Ia4faa200f96b76ba8c7ef3f45a26108e34b5e687
Signed-off-by: Narendra Muppalla <NarendraM@codeaurora.org>
2020-07-28 17:26:09 -07:00