Commit Graph

265 Commits

Author SHA1 Message Date
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
Veera Sundaram Sankaran
643e9c2d80 disp: msm: sde: move vm-ownership check to crtc custom events
Currently all the custom event register/unregister calls are
blocked based on the vm-ownership checks. Avoid this check
for connector events as it has only software updates unlike
the crtc events which directly touch the HW registers. This
allows the connector events to be registered before the first
commit where the VM ownership is obtained.

Change-Id: Id78e365929cb958ead10221b9267f1c1c0406a27
Signed-off-by: Veera Sundaram Sankaran <veeras@codeaurora.org>
2020-11-19 12:13:17 -08:00
Veera Sundaram Sankaran
e07097c244 disp: msm: sde: use drm mode set by user-mode in trusted-vm
Trusted-vm uses the cont-splash path to initialize the software
states by reading the hardware registers and populating the
SDE & DRM software states. But drm mode cannot be determined by
register reads, so rely on user-mode to get the mode which comes
as part of the first atomic_commit check phase which handles the
transition. The primary-vm user-mode passes the current mode to
trusted-vm through qrtr which is in-turn passed to driver to
set that particular mode.

Change-Id: I4fb86b40b8a0583c8edb539b0a51dcd33de731ff
Signed-off-by: Veera Sundaram Sankaran <veeras@codeaurora.org>
2020-11-18 17:32:58 -08:00
Veera Sundaram Sankaran
b403c57119 Revert "disp: msm: sde: use mdp scratch register to pass drm mode info"
This reverts commit e8309fcbf5. Removing
the scratch register logic to pass information between the VMs as the
design changed from kernel to user-mode for passing the mode information
through qrtr from primary-vm to trusted-vm.

Change-Id: Ibfa4b0004496f68b272da808e866f5226b02c013
Signed-off-by: Veera Sundaram Sankaran <veeras@codeaurora.org>
2020-11-18 16:56:50 -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
qctecmdr
7a98aa2134 Merge "disp: msm: sde: fix missing error handling in VM ops" 2020-11-17 02:59:24 -08:00
qctecmdr
783f3f8d88 Merge "disp: msm: sde: fix invalid dual-display TVM restriction check" 2020-11-17 02:59:24 -08:00
qctecmdr
dafa11efb1 Merge "disp: msm: sde: fix TUI CRTC selection for dual-display" 2020-11-17 02:59:24 -08:00
qctecmdr
614b3d7589 Merge "disp: msm: sde: bound crts and encoders for TUI displays" 2020-11-17 02:59:24 -08:00
Amine Najahi
622e4a37c9 disp: msm: sde: fix TUI CRTC selection for dual-display
Currently, driver is always querying CRTC-0 to determine if
a TUI session is active or not independently of where the request
is coming from (PVM/TVM) and the display it is intended to. This
leads to an invalid CRTC selection in dual-display use case as
the CRTC must be dynamically selected depending on the display
selection.

This change adds helper functions to dynamically query the
CRTC with an active VM request and uses those helpers in
PVM ops.

Change-Id: I62ef46a1f23bb812287ab1545e444b90eb8f554c
Signed-off-by: Amine Najahi <anajahi@codeaurora.org>
2020-11-16 15:46:15 -05:00
Amine Najahi
84beddbe9e disp: msm: sde: bound crts and encoders for TUI displays
Currently, when starting a TUI session on a secondary display,
user-mode will select CRTC[1]/DSI-2 to initiate the session in
PVM and select CRTC[0]/DSI-2 in TVM to drive the frame. This
breaks existing cont. splash assumption that secondary display
will be using CRTC[1] in TVM session. Instead, driver can inform
user-mode of the possible CRTCs to use for each of the encoders.

This change sets the possible_crtcs variable on both DSI encoders
so that user-mode selects DSI-1/CRTC[0] and DSI-2/CRTC[1] in the
TVM use case.

Change-Id: Ic68f92901e42db80fb97799a05d11b5f3473af97
Signed-off-by: Amine Najahi <anajahi@codeaurora.org>
2020-11-13 14:49:39 -05:00
Amine Najahi
c5648939cd disp: msm: sde: fix missing error handling in VM ops
Fix missing error handling in VM ops and add debug logs
to track DRM objects involved in TUI session.

Change-Id: If021ea5a38235386d6cea0b9ae3f753e9fce654e
Signed-off-by: Amine Najahi <anajahi@codeaurora.org>
2020-11-11 17:01:37 -05:00
Amine Najahi
387cda7632 disp: msm: sde: fix invalid dual-display TVM restriction check
Currently, driver enforces that a TUI session is only happening
on a single display using the number of DSI displays. This check
leads to an atomic check failure for the dual-display use case,
since 2 DSI displays are connected at the same time. Instead of
using the number of DSI display, the validation check should use
the number of active displays.

This change modifies the validation check to use cont_splash_enabled
variable, which contains information about the interface state.

Change-Id: Ie820832df812c37ebff67f6083d6922d32cbd98a
Signed-off-by: Amine Najahi <anajahi@codeaurora.org>
2020-11-11 13:44:19 -05:00
Steve Cohen
e01b1494f3 disp: msm: sde: add traces for lastclose
Add logging during sde_kms_lastclose to know when driver cleanup
is being triggered. These traces are very helpful with debugging
shell stop/start issues.

Change-Id: I00ecc1287a3ee5cc096b7edc3f872e122b7d3fc8
Signed-off-by: Steve Cohen <cohens@codeaurora.org>
2020-11-06 02:04:46 -05:00
qctecmdr
c7ba46d5bf Merge "msm: sde: prevent illegal register access" 2020-10-28 18:43:29 -07:00
Ping Li
a0ae165cc3 msm: sde: prevent illegal register access
If event register is called from LA VM when the HW is owned by trusted
VM, it will lead to a crash. This change adds checks to prevent illegal
register access when the HW is not owned by LA VM.

Change-Id: Ib4d956fdce4b5aae41e765d7355082c5e233efe2
Signed-off-by: Ping Li <pingli@codeaurora.org>
2020-10-27 16:51:56 -07:00
Veera Sundaram Sankaran
a61f249398 disp: msm: sde: limit encoders attached to crtc during trusted-ui
Add checks to block transition to trusted-vm when multiple encoders
are attached to a crtc. This ensures, concurrent writeback is
disabled before trusted-ui usecase. Additionally, avoid enabling /
disabling the IRQs associated with the cwb encoder during all
the transitions to avoid any unbalanced calls.

Change-Id: I022077018ac9b7dfb62506cfaddcb60cb8b35ed8
Signed-off-by: Veera Sundaram Sankaran <veeras@codeaurora.org>
2020-10-27 13:18:19 -04:00
Veera Sundaram Sankaran
303c324c43 disp: msm: sde: fix crtc_state iteration during vm release
Iterate over the crtc old/new state and decide which ones
to process by checking the active state of both during
the vm release in error cases.

Change-Id: Iab20e89792c53fb72e0c00f1fa5091616c7afbf3
Signed-off-by: Veera Sundaram Sankaran <veeras@codeaurora.org>
2020-10-23 23:01:33 -07:00
Veera Sundaram Sankaran
26b6ae2d21 disp: msm: sde: fix Trusted-ui state transition check
Fix the checks done as part of the trsuted-ui transition.
Allow full validation to go through whenever the new vm request
or old vm request is not NONE. Split the checks and the vm acquire,
so vm acquire can be done after all necessary checks are over.

Change-Id: I91165010ad110193c2ca3947af8c6504cd259919
Signed-off-by: Veera Sundaram Sankaran <veeras@codeaurora.org>
2020-10-23 23:01:27 -07:00
qctecmdr
68f4129cc6 Merge "disp: msm: sde: add support for qsync min fps list" 2020-10-19 16:18:30 -07:00
qctecmdr
b267a4e5a2 Merge "disp: msm: sde: fix vblank handling during trusted UI" 2020-10-16 00:13:41 -07:00
Raviteja Tamatam
e5ff0b8f30 disp: msm: sde: add support for qsync min fps list
In current implementation qsync min fps is single value.
It is same for all the list of supported dfps list.
Added support for new dt entry dsi-supported-qsync-min-fps-list
corresponding to the fps supported in the dfps list
dsi-supported-dfps-list.

Change-Id: Ifd5309c2f51865a3c0d9fadb65cbcd291b6ef42b
Signed-off-by: Raviteja Tamatam <travitej@codeaurora.org>
2020-10-15 12:32:25 +05:30
qctecmdr
c83a1df2b3 Merge "disp: msm: sde: avoid tx wait during cwb disable and reset" 2020-10-14 23:19:14 -07:00
Veera Sundaram Sankaran
9d1eee0817 disp: msm: sde: fix vblank handling during trusted UI
Currently vblank enable/disable events are processed based
on the vm ownership check. Use the vblank helper functions
instead, during the transitions to avoid processing the
vblank from DRM framework level.

Change-Id: Icb2bd569e73d9206a234489a288320fecf631845
Signed-off-by: Veera Sundaram Sankaran <veeras@codeaurora.org>
2020-10-14 11:06:58 -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
Veera Sundaram Sankaran
689f5eb836 disp: msm: sde: fix trusted-ui transition checks
Avoid crtc_state active_changed flag and explicitly check new/old
crtc_state active to decide if trusted vm transition checks are
required. As the active_changed might not be set at this point
in atomic_check sequence.

Change-Id: I142befad68359ae5ee862a1306bdc75531d63e70
Signed-off-by: Veera Sundaram Sankaran <veeras@codeaurora.org>
2020-10-13 15:10:32 -07:00
Dhaval Patel
d9f194e6f7 disp: msm: sde: avoid tx wait during cwb disable and reset
Avoid TX wait during CWB encoder disable and delay
reset call after last CWB frame trigger.

Change-Id: I9f96d522cfe4205e0272b6b3fa9edd409cab3648
Signed-off-by: Dhaval Patel <pdhaval@codeaurora.org>
2020-10-08 21:51:23 -07:00
Dhaval Patel
8d6fea832e disp: msm: sde: delay cwb done wait for last frame
Commit Ifa100424733 ("disp: msm: sde: delay
encoder disable for clone mode") delays the CWB
encoder disable but it is also skipping the CWB
disable flush. That can cause the underrun on dp
display if it uses the same 3d_merge HW block. This
change reverts the portion of original code and
only delays the last cwb frame done wait. It still
keep the last CWB frame done wait as it is if crtc
is also moving to inactive state.

Change-Id: I3461188a35197f2925899ceea7ef705adf00a398
Signed-off-by: Dhaval Patel <pdhaval@codeaurora.org>
2020-09-30 10:19:23 -07:00
qctecmdr
ffde2ecd77 Merge "disp: msm: sde: populate connector modes during init" 2020-09-24 16:51:56 -07:00
Jeykumar Sankaran
9de6eee40e disp: msm: sde: accept and reclaim resources on user prompt
Currently, trusted VM accepts and releases the resources
on RM notifications.

In cases, where TUI fails to submit the first frame on the trusted
vm, display cannot rely on the teardown commit IOCTL to release the
resources back to primary VM.

To handle scenarios where RM notification drops, the VM's should be
able to ACCEPT/RECLAIM resources without relying on the RM.

To address above scenarios, this change moves the resource handling
calls from notification handlers to user prompt. With this change,
trusted VM will ACCEPT the resource only on the first frame commit and
primary VM can RECLAIM the resources back if the TUI use case fails
or any of the RM notifications fail to deliver.

Change-Id: Iebb1724a7558e52567f8af1a49e38f8adbec88a0
Signed-off-by: Jeykumar Sankaran <jsanka@codeaurora.org>
2020-09-24 11:24:28 -07:00
Jeykumar Sankaran
a521764b53 disp: msm: sde: populate connector modes during init
When continuous splash is enabled, KMS populates the modes of
a connector during splash config. With TUI VM enabled, this path
will also be exercised by trusted vm for splash handoff, where for
a given display we try to use the same HW blocks configured by
the primary VM.

Since the trusted VM invokes the path under connection_mutex lock,
calling fill_modes will lead to a deadlock. So, move the connector
mode population during init for DSI displays, since the modes are
available for the connector during initialization.

Change-Id: I12f920f4af84b7bccc97a5f5edb5117ada49b960
Signed-off-by: Jeykumar Sankaran <jsanka@codeaurora.org>
2020-09-24 11:24:03 -07:00
qctecmdr
21a74c8c10 Merge "disp: msm: sde: fix panel early event blank notifier call" 2020-09-21 03:57:31 -07:00
Rajeev Nandan
2103ce58b8 disp: msm: sde: fix panel early event blank notifier call
If trusted vm is disabled, the DRM_PANEL_EARLY_EVENT_BLANK
notifier does not get called because of this touch early
suspend does not happen which leads to continuous touch
i2c transfer failure during suspend.

Change-Id: I6abaacb9f8343eec24d5642f7eda9e7c410fd8b7
Signed-off-by: Rajeev Nandan <rajeevny@codeaurora.org>
2020-09-17 13:52:00 +05:30
Yashwanth
4ec0f2a9e8 disp: msm: sde: remove previous pm qos irq vote during affinity change
In the current code during affinity change, irq cpu mask is
being updated without clearing previous pm qos vote. Due to
this, even after entering idle state, qos vote is still
present on other cpus. This change clears previous pm qos
vote before adding another.

Change-Id: Ic0326a09d37d03d5a8b0444362a6f1492993040c
Signed-off-by: Yashwanth <yvulapu@codeaurora.org>
2020-09-14 14:39:00 +05:30
qctecmdr
683bf52ce0 Merge "disp: msm: sde: update crtc check in drm_check_dpms" 2020-09-12 19:19:50 -07:00
qctecmdr
b0775fe9da Merge "disp: msm: add allowed_mode_switch blob property" 2020-09-12 00:11:57 -07:00
qctecmdr
ef551ad4ae Merge "disp: msm: sde: release splash memory using memblock_free" 2020-09-11 16:46:33 -07:00
Raviteja Tamatam
66d9e1e9ab disp: msm: sde: update crtc check in drm_check_dpms
In cases of adb shell stop, connector->state->crtc is
not updated which prevents panel power down
notification to be sent. In such cases updated crtc
from old connector state.

Change-Id: I94f9e5ad469d771cc673123b4e0cc65ea8f4653e
Signed-off-by: Raviteja Tamatam <travitej@codeaurora.org>
Signed-off-by: Narendra Muppalla <NarendraM@codeaurora.org>
2020-09-10 16:34:24 -07:00
Krishna Manikandan
2b492f05d9 disp: msm: add new mode to notify when there is a fps change
Add a new mode DRM_PANEL_BLANK_FPS_CHANGE whenever there is
a change in fps and the power mode remains the same.
This will avoid unnecessary resume operations in touch driver.

Change-Id: Id3d5884ba862c864782636360e3832854464bf65
Signed-off-by: Krishna Manikandan <mkrishn@codeaurora.org>
2020-09-10 16:32:41 -07:00
Adrian Salido
fb50dda175 disp: msm: add low power mode notifier
Introduce low power mode so that listeners are aware when
display is going into low power mode. This requires moving notifier
inside sde code to be able to retrieve the low power state.

Change-Id: I8671e86af29c959d97e1b8ad758a07719ffa4bec
(cherry picked from commit c4b15f56dd63d24d6f4482deab2423809c700d7a)
Signed-off-by: Adrian Salido <salidoa@google.com>
[samtran@codeaurora.org: move changes to different file as
downstream use of notifier struct comes from different file]
Signed-off-by: Samantha Tran <samtran@codeaurora.org>
Signed-off-by: Dhaval Patel <pdhaval@codeaurora.org>
Signed-off-by: Narendra Muppalla <NarendraM@codeaurora.org>
2020-09-10 16:28:22 -07:00
qctecmdr
1ea1264b80 Merge "disp: msm: sde: update irq enable check during irq affinity notify" 2020-09-09 02:29:19 -07:00
qctecmdr
9f952e6831 Merge "disp: msm: sde: avoid double mmu destroy during mmu init failure" 2020-09-09 02:29:19 -07:00
Yashwanth
638de5f7dd disp: msm: sde: update irq enable check during irq affinity notify
MDSS irq will be enabled/disabled only during post-enable
and pre-disable power events. During idle usecase in video
mode, interrupts will be disabled but not mdss hw irq.
This change uses irq vote count check while adding pm
qos irq vote.

Change-Id: Iae0ea19fbe688d0ee762b5e75f37548ba5671def
Signed-off-by: Yashwanth <yvulapu@codeaurora.org>
2020-09-08 10:21:48 +05:30
Chandan Uddaraju
7ef5f60e6b disp: msm: sde: release splash memory using memblock_free
The splash memory initialized by the bootloader needs
to be released after the first frame update. Add
memblock_free() call to release this memory that was
reserved during the kernel boot.

Change-Id: I2633305528b1767b87273d027b8a939da0cedfc4
Signed-off-by: Chandan Uddaraju <chandanu@codeaurora.org>
2020-09-07 18:05:01 -07:00
Satya Rama Aditya Pinapala
03f9c40e7d disp: msm: add allowed_mode_switch blob property
The change adds a new mode property allowed_mode_switch. The new
property is a 32bit bitmask that indicates the modes each mode
can switch to. This change is required to pass the driver mode
switching capabilities, so that user mode can reject any mode switch
that is not supported by the driver.

Change-Id: I76d1733a07a6d57487ba9f461055270d7e60e060
Signed-off-by: Satya Rama Aditya Pinapala <psraditya30@codeaurora.org>
2020-09-04 17:58:46 -07:00
qctecmdr
5a5f61466b Merge "disp: msm: sde: add vote for trusted vm splash handoff" 2020-09-04 08:52:18 -07:00
Lei Chen
ad0b79b8d7 disp: msm: sde: do DRM encoder NULL check before waking up display
DRM encoder can be NULL during modeset concurrency, so add this
change to check drm encoder and only wake up display when drm encoder
is available.

Change-Id: I50dd85eb39567aba4895dc19801020d7ead841b8
Signed-off-by: Lei Chen <chenlei@codeaurora.org>
2020-09-01 00:58:45 -07:00
Jeykumar Sankaran
cbaca0039b disp: msm: sde: add vote for trusted vm splash handoff
Trusted VM adapts splash handoff path to acquire the same
set of HW blocks the tui display was using in the primary VM
before switching out.

To use the splash handoff path, Trusted VM should add an
additional vote to the PM so that refcounts will be remain
balanced after the splash path cleanup at the completion
of the first valid commit.

This change adds the needed vote and as a result cleans up
explicit voting from trusted vm commit paths.

Change-Id: I9eb33c364f1dfb4205547a8353f57b73c68b8af3
Signed-off-by: Jeykumar Sankaran <jsanka@codeaurora.org>
2020-08-26 12:31:22 -07:00
qctecmdr
f1b667341c Merge "disp: msm: add connector API to disable cont_splash resource votes" 2020-08-25 09:23:14 -07:00
qctecmdr
cc3f133167 Merge "disp: msm: sde: update rotator sid value in continuous splash case" 2020-08-24 04:01:01 -07:00