Commit Graph

190 Commits

Author SHA1 Message Date
Veera Sundaram Sankaran
b261fe33db disp: msm: avoid sde_dbg HW access based on HW ownership
Add VM ownership checks before accessing the HW through the debugfs
path in sde dbg module to avoid illegal access. Set the ownership
status on bootup based on the VM.

Change-Id: I30f2a1eb7e049740f1f7fe3ed03aa411264ba7b3
Signed-off-by: Veera Sundaram Sankaran <veeras@codeaurora.org>
2021-03-31 14:57:04 -07:00
qctecmdr
289fefb14a Merge "disp: msm: fix compilation issues for out of tree compilation" 2021-03-30 01:22:38 -07:00
qctecmdr
10766ebd0f Merge "disp: msm: sde: provide rm status through debugfs node" 2021-03-29 23:04:55 -07:00
qctecmdr
19e9831a45 Merge "disp: msm: sde: modify SDE_DBG_DUMP to use blk_mask instead of blk_name" 2021-03-25 14:22:21 -07:00
Tatenda Chipeperekwa
2e946c4cd8 disp: msm: fix compilation issues for out of tree compilation
Update the Kbuild files and fix some compilation issues for out
of tree compilation on waipio target.

Change-Id: I426d7611c56a1c6c848b9dfd925799864cbf4a67
Signed-off-by: Tatenda Chipeperekwa <tatendac@codeaurora.org>
2021-03-24 09:54:28 -07:00
Amine Najahi
d4def5bd8c disp: msm: sde: add new interface for RFI feature
Add a new connector range property and a new entry to the panel
capability blob to publish the list of supported RFI frequencies.
In addition, add the required functions to set, validate and update
DSI bit clock rate value to trigger an internal seamless mode switch
and reconfigure DSI clock and PLL.

Change-Id: I7d19cc369f8c5528709f2f20a51ef02180ebdea4
Signed-off-by: Amine Najahi <anajahi@codeaurora.org>
2021-03-24 06:32:17 -07:00
Tatenda Chipeperekwa
c6257272d4 disp: msm: fix compilation errors for dlkm compilation
Fix dlkm compilation errors that are due to the use of -Werror
flags used by the build system.

Change-Id: I5e1e9bc63c1361d73e4930aab123212717872ecb
Signed-off-by: Tatenda Chipeperekwa <tatendac@codeaurora.org>
2021-03-22 15:25:36 -07:00
qctecmdr
7dcef410b1 Merge "disp: msm: sde: prepare encoders during enable commit" 2021-03-19 19:52:30 -07:00
Veera Sundaram Sankaran
5bbf449148 disp: msm: sde: modify SDE_DBG_DUMP to use blk_mask instead of blk_name
Currently, SDE_DBG_DUMP takes any number of hw block names along with
few defined strings as arguments. This set of arguments is used to
determine which HW block registers needs to be dumped. Move to a
blk bitmask to avoid passing a large set of arguments. The bitmask is
split based on the clks required to access the HW block for ease of use.
The lower 0-23 bits are used for HW blocks which can be accessed by just
enabling the MDP clks. DP is kept separate as it needs DP specific
clks to be enabled. Add a debugfs node through which the mask can be
modified, which can be useful while using the debugfs dump option to
force a panic.

As part of the change, remove in-log/in-mem enable mask debugfs node
for every debugbus and use a single node to control the logging
mechanism for all the HW blocks debugbus.

Change-Id: Ibb6354b3e3265c9911104bb0f964616eb8a898c9
Signed-off-by: Veera Sundaram Sankaran <veeras@codeaurora.org>
2021-03-19 16:50:45 -07:00
Christopher Braga
c654f1b014 disp: msm: sde: add management of demura shared memory region
In cont-splash use cases the bootloader's Demura configuration
must stay operational until user space takes over display control.
Introduce Demura shared memory region handling to ensure
Demura configuration data stays consistent and accessible to the
hardware.

Change-Id: I5ef20ad9286574904b3d33a4179629d5a16746cf
Signed-off-by: Christopher Braga <cbraga@codeaurora.org>
2021-03-17 11:22:07 -07:00
Christopher Braga
db39b61a5f disp: msm: sde: populate DRM pipeline setup during cont-splash
Declare the continuous splash pipeline setup to userspace by filling
in the DRM states for all plane, crtc, encoder, and connector objects
in use. This information will be treated as an 'informative' state,
and will be cleared at the start of the first commit to maintain
the DRM methodology of DRM clients being the only controller of
the pipeline. This ensures any configuration provided by userspace
is accepted and applied, even if it may already align with the setup
done by continuous splash.

This DRM state configuration is done via manual modification of the
DRM object states. Modification via the exposed DRM UAPI functions
is not possible due to no drm_atomic_state object linking the DRM
pipeline objects together.

Change-Id: I67650e05aafbb4e799cf60939f0595bc3786fc6e
Signed-off-by: Christopher Braga <cbraga@codeaurora.org>
2021-03-17 11:22:07 -07:00
Christopher Braga
484abb02a1 disp: msm: sde: cleanup data scope of _sde_kms_get_splash_data
In order to assign a 'type' to the accumulated sde_splash_data,
the function _sde_kms_get_splash_data was extended to
receive the entire sde_kms object. This change is unnecessary
as the sde_splash_data structure to modify is already provided.

Update _sde_kms_get_splash_data to no longer receive
the sde_kms structure, and instead set the type on the provided
splash_data struct.

Change-Id: I6faf2c54c84a0157597d339c0123a2033e1dc632
Signed-off-by: Christopher Braga <cbraga@codeaurora.org>
2021-03-17 11:22:07 -07:00
Dhaval Patel
c9a5def3b2 disp: msm: sde: provide rm status through debugfs node
Provide rm status through debugfs node.
cat /d/dri/0/debug/rm_status.

Change-Id: Ic1950b1881f0b57582701a342793aa06adb9da39
Signed-off-by: Dhaval Patel <pdhaval@codeaurora.org>
2021-03-09 17:14:53 -08:00
Veera Sundaram Sankaran
3cef1faa29 disp: msm: sde: implement drm hooks to get precise vblank timestamp
Add precise vblank timestamp support through the DRM framework.
Implement the vblank related hooks to get the vblank count and
timestamp. Use MDSS 8.x, hardware feature that supports logging
of the vsync timestamp counter which can be used to derive the
accurate kernel timestamp. The current ktime would be returned
for older targets to support backward compatibility.

Change-Id: I2d35ed4a643a519e602278b6d16e67ccee16a60b
Signed-off-by: Veera Sundaram Sankaran <veeras@codeaurora.org>
2021-02-26 13:48:57 -08:00
Steve Cohen
bd79e929f8 disp: msm: sde: prepare encoders during enable commit
Prepare commit hook is getting skipped for encoders during
power-on. This is required for clearing the pending flush
mask but the encoder->crtc link is not established at
this point for an enable commit.

Instead of looking at the old CRTC state and matching an
attached encoder, use the encoder_mask in the new CRTC state
to determine which encoders to prepare.

Change-Id: I0754020abd328504899d9591180dedc1723aae49
Signed-off-by: Steve Cohen <cohens@codeaurora.org>
2021-01-28 15:30:42 -05:00
Linux Build Service Account
a8ca469548 Merge "disp: msm: remove use of drm_display_mode vrefresh" into display-kernel.lnx.5.10 2021-01-13 14:23:33 -08:00
Amine Najahi
08358fd857 disp: msm: remove use of drm_display_mode vrefresh
Use of drm_display_mode vrefresh is being deprecated in
upstream DRM framework. Downstream driver need to use
drm_mode_vrefresh API from now on.

This change removes dependency on drm_display_mode vrefresh
and replaces it with drm_mode_vrefresh API in SDE, DSI and
DP driver. In addition, it also modifies drm_display_mode clock
to align with upstream approach where an uncompressed mode clock
is required to match drm_mode_vrefresh API.

Change-Id: Ie972a2e140adfd81c4e68df8e7bc69feaaca22e1
Signed-off-by: Nilaan Gunabalachandran <ngunabal@codeaurora.org>
Signed-off-by: Amine Najahi <anajahi@codeaurora.org>
2021-01-13 16:08:27 -05:00
Yuan Zhao
73cb7a36c5 disp: msm: sde: remove drm panel callback
For GKI2.0, the old drm_panel_notifier function could not
be used anymore, so removed it.

Change-Id: I858f90d7c39816dc95ab59f88c8988237319eadc
Signed-off-by: Yuan Zhao <yzhao@codeaurora.org>
2021-01-13 12:09:40 +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
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
Samantha Tran
2616e57a0a disp: msm: encoder_ids replaced in drm_connector
Commit 62afb4ad425a ("drm/connector: Allow max possible encoders
to attach to a connector") enables additional encoders per
connector through use of a mask rather than encoder ids.
This change updates the driver when looking for an encoder
for the connector to look through the list of all possible encoders.

Change-Id: I69cc7c38cd0a9842ed2f15712feeb3c6b88daadf
Signed-off-by: Samantha Tran <samtran@codeaurora.org>
Signed-off-by: Nilaan Gunabalachandran <ngunabal@codeaurora.org>
2020-12-17 09:58:38 -05:00
Samantha Tran
da5f5ff1ae disp: msm: fix always true/false conditionals
Remove unnecessary error conditionals that are
always true or false.

Change-Id: Ied1041b3165647364b741d3d95edca85039491c2
Signed-off-by: Samantha Tran <samtran@codeaurora.org>
Signed-off-by: Nilaan Gunabalachandran <ngunabal@codeaurora.org>
2020-12-17 09:58:38 -05:00
Steve Cohen
4eff2d1bce disp: msm: sde: use prepare_commit connector callback for DSI
Some DSI panels require qsync on/off DCS commands to be sent in
prepare commit phase. Add the hook for sending these commands
to the panel. If these commands are not present in the panel's
device tree node, it will be treated as a NO-OP.

Change-Id: Ida65512fe0214779dfa848f6c7b33644d3934afd
Signed-off-by: Steve Cohen <cohens@codeaurora.org>
2020-11-30 14:02:50 -05:00
qctecmdr
69e06f9fd7 Merge "disp: msm: dsi: avoid TE status check based on rechecks count" 2020-11-21 13:13:35 -08:00
Linux Build Service Account
b76d65a7a6 Merge "disp: msm: sde: use drm mode set by user-mode in trusted-vm" into display-kernel.lnx.5.4 2020-11-20 17:17:33 -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
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