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>
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>
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>
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>
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>
Add changes to extend the current evtlogs for ease
of debug purposes.
Change-Id: Ibe136afbf25b8b8decfc06ef3868e3f628df4dcb
Signed-off-by: Jayaprakash <jmadiset@codeaurora.org>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
This change programs rotator sid value irrespective of
continuous splash since it is not configured from
bootloader. It also handles trusted vm support
to prevent accessing mdss hw register.
Change-Id: I80e286364286457545dfa236d629447241d98f95
Signed-off-by: Yashwanth <yvulapu@codeaurora.org>
When DRM property objects are created, the DRM framework attaches a
dellocator which can eventually free the object when the last reference
is removed from it. The framework can only do this before the driver is
registered. If a property is created after the registration then the
framework is unable to attach a deallocator causing a memory leak during
tear down.
The current DP driver creates a new colorspace property whenever a
new dp connector is initialized. It creates a base connector at probe
time prior to registration. But then it also creates new connectors,
post registration, whenever a new MST dongle is attached to the
topology, causing memory leaks.
This change limits the property creation to the base connector and
attaches the same object to MST connectors to avoid memory leak.
Change-Id: Ib97dc7aac260b4f3f96c1097f58bd276c68501f8
Signed-off-by: Rajkumar Subbiah <rsubbia@codeaurora.org>
The panel regulator votes are added by default during
dsi probe to make sure sync state driver doesn't disable
these regulators for cont_splash use case. These regulator
votes need to be removed when cont_splash feature is
disabled. Add a new connector API to handle this.
CRs-Fixed: 2734419
Change-Id: Ie54c8f246877a042afacddaeae8b90440652116f
Signed-off-by: Chandan Uddaraju <chandanu@codeaurora.org>
Parse the display peripheral related SPMI SID/Peripheral
mask from device-tree and get the dynamic register range
of these peripherals using the SPMI API. These registers
are appended to the list of display IO ranges that is
lent from HLOS to trusted VM during trusted UI. This would
help in adding restrictions for SPMI registers on HLOS during
the trusted UI use case along with validation of the register
ranges in trusted VM.
Change-Id: I7077dac7962466e845d061e9ccd205f1bc0ce3ea
Signed-off-by: Veera Sundaram Sankaran <veeras@codeaurora.org>
Add helper API's at VM layer to avoid repeated
VM structure dereferencing in rest of SDE files.
Change-Id: I31ee506adbd12c5452bef15da7c468c87b2c9f96
Signed-off-by: Jeykumar Sankaran <jsanka@codeaurora.org>
pm runtime suspend/resume is not supported in trusted vm since
the power domain is controlled by the primary VM. Hold an
extra refcount on the drm device in trusted vm to avoid pm
runtime calls.
Change-Id: I57c22887eb8b11f8ce318479ca36b84cda385d60
Signed-off-by: Jeykumar Sankaran <jsanka@codeaurora.org>
mmu destroy is called in _sde_kms_mmu_destroy as part of
smmu_aspace_destroy. This change avoids msm_smmu already getting
freed at smmu_aspace_destroy.
Change-Id: I00ff2a99295534189ceec7c769cd0a01762408c2
Signed-off-by: Raviteja Tamatam <travitej@codeaurora.org>
Add handoff implementation for color processing features when switching
from primary VM to trusted VM.
Change-Id: I9c3a168f70f3981e912bf37533f212880ab30924
Signed-off-by: Ping Li <pingli@codeaurora.org>