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>
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>
Add check to avoid the dsi panel status check with TE
method as the GPIO support is not available in Trusted-vm.
Change-Id: I5ad6e7b77b189b5150302ab34767dfc4d97aaf61
Signed-off-by: Veera Sundaram Sankaran <veeras@codeaurora.org>
Add support to trigger ESD through debugfs by directly
modifying the reset GPIOs TLMM register in trusted-vm as GPIO
driver support is not enabled.
Change-Id: I859affe69c13dbe115a48b0a63a600a57027db58
Signed-off-by: Veera Sundaram Sankaran <veeras@codeaurora.org>
Parse all the GPIO pins used by the DSI host and the display panel
along with its register ranges and store it in panel struct. This
avoids parsing the device-tree everytime during transitions between
trusted and primary vm.
Change-Id: Ibbb646358c0409703afda1c4f758f044fc8c0001
Signed-off-by: Veera Sundaram Sankaran <veeras@codeaurora.org>
Currently, mdp_intf_line_count and mdp_intf_tear_line_count register
addresses are defined in dsi_ctrl_hw for debug feature. But mdp_intf
base address is target specific and independent of dsi controller
version. This change adds support for parsing the mdp intf base
address from dt, thereby remapping using base + offset addressing.
Change-Id: Ibb72dfe84a786a5c8b95f6a400e8333f6b46814a
Signed-off-by: Lipsa Rout <lrout@codeaurora.org>
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>
Add error handling mechanism in host init function to take necessary
action upon failure. For example, power init can fail if we try to
do host_init in between PM suspend. In this case sink sends an hpd
irq with hpd_high equals to 0 and hpd_high equals to 1, after which
ADSP sends the events to DP driver. Now as apps core is in PM suspend
all the devices are put to suspend state and cannot be resumed if
their disable_depth is greater than 1. When driver tries to process
the hpd_high equals to 1 and does host_init in between PM suspend,
it sometimes leads to power init module failure. Inadequate handling
of host init failure as described can lead to a NOC error.
Change-Id: I23eff28e137a18b43eef204fbccc695b743cf726
Signed-off-by: Rajat Gupta <rajatgu@codeaurora.org>
Signed-off-by: Sankeerth Billakanti <sbillaka@codeaurora.org>
Skip processing the sink message in sde_hdcp_2x_main thread when hdcp
TA is unloaded. If there is any error generated during the
authentication sequence, then the hdcp authentication is aborted and
the source will restart the authentication procedure. When
authentication is aborted, the qseecom handle is lost and memory it
referenced becomes protected. When a subsequent command execution in
the sde_hdcp_2x_main thread tries to dereference that particular
memory from the qseecom handle, there is a page fault crash observed.
This change will skip accessing the memory referenced by the qseecom
handle when hdcp authentication session is tearing down.
Change-Id: I71ed44042897f17cc8817a1b1c54a43e42cf5f73
Signed-off-by: Sankeerth Billakanti <sbillaka@codeaurora.org>
Currently hpd uevent notification to usermode is triggered at different
points in the hpd handler callflow. With respect to the SST callflow,
the MST callflow has the following issues:
* the completion event object is getting reinitialized after the uevent
is sent
* The NOTIFIED states are not updated properly.
* dp_display_process_mst_hpd_high is overloaded to do two different
functions in the same flow and is controlled by the mst_probe argument.
This change cleans up the hpd callflows for MST and unifies the hpd
event notification. Also moved the mst check logic from
dp_display_process_mst_hpd_high to a separate function.
Change-Id: I8fdc92d2f9aae16d248c74643cb93688786dfbd5
Signed-off-by: Rajkumar Subbiah <rsubbia@codeaurora.org>
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>
Drm driver will remove the same mode that defined
in dsi panel dtsi. But the mode count was not updated,
so when checked drm mode, need to recount the mode.
Change-Id: I51a2c40ceb7d4ee83a15f74d9d724b4fb9c8a618
Signed-off-by: Zhao, Yuan <yzhao@codeaurora.org>
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>
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>
Avoid setting backlight to max/0 during bridge enable/disable
for trusted-vm as the transition between the VMs are expected
to be seamless without any implicit changes to backlight.
Change-Id: Ib828113e49af1be4effea2b71b3106e3cbf401c2
Signed-off-by: Veera Sundaram Sankaran <veeras@codeaurora.org>
Trusted VM can support dynamic backlight updates through DCS
commands. Allow SDE to register for the backlight device
only if the panel supports DCS backlight update mode.
Note that thermal driver is disabled in trusted vm. So we are
still avoiding registering with msm thermal driver. The
backlight updates are only supported through backlight driver
provided sysfs nodes.
Change-Id: I9cd41d473445387c8bc9048d7e565d49124a36b7
Signed-off-by: Jeykumar Sankaran <jsanka@codeaurora.org>
When processing mst hpd low, the driver is clearing mst_active before
triggering hpd notification. The hpd notifier is common for both
sst and mst and since mst_active is cleared it incorrectly treats
this as sst unplug.
This change switches the order of these operations to trigger hpd
notification before clearing mst_active.
Change-Id: I28f90da699e4f2fe177a4e4cfd1d9f03957c3176
Signed-off-by: Rajkumar Subbiah <rsubbia@codeaurora.org>
This change adds support for delaying kickoff in case of ESD error.
This delay is required to handle a race condition between esd
workqueue and display thread.
When ESD workqueue detects the esd and while handling the failure
notification if the new updates arrive on display thread, there
is a possibility that ESD workqueue will keep on waiting on pp_done.
This could happen if display thread keeps on incrementing the kickoff_cnt
before workqueue can check the condition. With this change the kickoff is
delayed, allowing the workqueue to get scheduled and avoiding the race
condition.
Change-Id: I8e6fff5ea5494ae801d1e60ae85b7ad19cc12961
Signed-off-by: Abhijit Kulkarni <kabhijit@codeaurora.org>
This change fixes the detection logic for overriding the ich
reset in both single and dual dsc case. In the previous logic
ich reset override was not getting triggered when partial update
on single dsc was enabled. This override is required to change the
default Hw behavior of changing the ich reset position.
ICH reset needs to be overridden in dual dsc merge case when
partial update disables the dsc merge and no. of slices per
encoder drops to 1. Similarly for single dsc case partial update
case when DSC encoder configuration changes from 2 slices to
single slice this override is required.
Change-Id: I435dc7ff10c9fb0edb8e40e6701608aa22136981
Signed-off-by: Abhijit Kulkarni <kabhijit@codeaurora.org>
Setting AMC and WAKE tag triggers AMC only and WAKE+SLEEP
only vote. These dynamic tag switching is not allowed
on interconnect driver. Display SW usecases also need
ACTIVE_ONLY tag for solver enabled and disabled
configuration. ACTIVE_ONLY tag triggers AMC+SLEEP
for solver disabled and WAKE+SLEEP for solver
enabled configuration.
Change-Id: I5abcc104378595724e5b5ae594c4b8c7a7922875
Signed-off-by: Dhaval Patel <pdhaval@codeaurora.org>
This change adds dsi display ramdump support when DEBUG_FS
is not enabled.
Change-Id: Ic6659a9380acd5eb55a3270d3e3b7016a9cd2bd7
Signed-off-by: Narendra Muppalla <NarendraM@codeaurora.org>
Linux message queues(msgq) are used to communicate between VM's
This change creates a display specific msgq and a set of
framework api's for the VM layer to invoke communication
between the VMs'.
Display msgq is bidirectional. Tx end is created by default for
both the VM's. Rx is kept optional to avoid unnecessary creation
of listener threads.
Change-Id: If4e6410045293d6b21087a76ec018d4784dd5238
Signed-off-by: Jeykumar Sankaran <jsanka@codeaurora.org>
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>
RSC is updated during encoder enable/disable/modeset or power-
collapse/wakeup. The RSC vote for primary display will change
depending on QSYNC status which might change without modeset or
power-collapse. Add a call to update the primary display's vote
when the QSYNC property is updated.
Change-Id: I664754e4aae689ef2db5b1ef7b8b55a4c5fad3be
Signed-off-by: Steve Cohen <cohens@codeaurora.org>
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>
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>
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>