Grafico dei commit

227 Commit

Autore SHA1 Messaggio Data
Steve Cohen
a42fd877c7 disp: msm: sde: cancel delayed work items during TUI transition
Delayed work items may touch HW registers. If these work items
run while HW is not owned by this VM it will lead to invalid
access. This happens in video mode as HAL does not disable idle
power-collapse in this mode. It can also happen with ESD status
if lastclose or TUI transition failure occurs.

Although there is a contract with user mode to turn off certain
features, kernel cannot rely on it to always do the right thing.
Prevent potential crashes from certain corner cases by
cancelling all delayed work items when the HW ownership is
transferred.

Change-Id: I08da17f2ce72bf2fddf71924c3e8edd2e2715be8
Signed-off-by: Steve Cohen <cohens@codeaurora.org>
2021-07-16 20:45:42 -04:00
Jayaprakash Madisetty
436efb403c disp: msm: sde: modify in_clone_mode after wb_reset is done
Add changes to modify the phys_enc->in_clone_mode variable
post wb_reset_state since this is a shared variable used
during atomic_check and atomic_commit. In current issue case,
wb_atomic_check has set in_clone_mode to true in commit N,
and in commit N-1 CWB is being disabled and re-sets the
in_clone_mode variable to false causing pp_done timeouts in
primary in commit N.

Change-Id: I8159bbdb5622a351d76bdc4dba75d48df20f4365
Signed-off-by: Jayaprakash Madisetty <jmadiset@codeaurora.org>
Signed-off-by: Samantha Tran <samtran@codeaurora.org>
2021-07-14 13:43:21 -07:00
Lei Chen
79d30e7fba drm/msm/sde: add check to fix null pointer dereference
Check if sde_enc->crtc exists before using the variable
to avoid possible NULL dereferences.

Change-Id: If7b56c3b3ad3525b3efc22b6536a2dc5c865da48
Signed-off-by: Lei Chen <chenlei@codeaurora.org>
2021-07-07 23:04:45 -07:00
Lei Chen
be82344413 disp: msm: sde: remove unused variable topology from sde_encoder
Topology in sde_encoder is no longer used, so remove this
variable from sde_encoder.

Change-Id: Iba02ae690d81d39252d0df83882a72e35f2916ec
Signed-off-by: Lei Chen <chenlei@codeaurora.org>
2021-06-29 14:17:59 +08:00
qctecmdr
4f79a6ceef Merge "disp: msm: sde: cancel delayed_off_work before reinitialization" 2021-06-09 10:00:48 -07:00
Lei Chen
9d4d003e30 disp: msm: sde: cancel delayed_off_work before reinitialization
Canceling delayed_off_work in encoder pre_modeset might not be
executed in all cases, but the following encoder enable might
initialize the work.
This will lead to list corruption as delayed_off work list node
is reinitialized before removing from linked list.
Move canceling delayed_off_work to start of encoder mode_set to
ensure work is canceled before reinitialization.

Change-Id: I38687604f2eedced308ea02019c162022725534e
Signed-off-by: Lei Chen <chenlei@codeaurora.org>
2021-06-07 17:03:31 +08:00
qctecmdr
97b1db8547 Merge "disp: msm: sde: set watchdog TE when panel fails ESD check" 2021-06-04 13:29:20 -07:00
Samantha Tran
11f2efbe16 disp: msm: sde: set watchdog TE when panel fails ESD check
In the event of panel dead scenario, it is possible to receive a
mode set call before the panel has recovered. When this happens,
display should select watchdog TE as the vsync source.

Similarly when detecting a write pointer timeout, if the panel is
dead then watchdog TE should be or has already been configured and
display should not make a change to this vsync selection.

Change-Id: I732c75e54d734b00889151b914b0749ae1f27d08
Signed-off-by: Samantha Tran <samtran@codeaurora.org>
2021-06-04 09:59:44 -07:00
qctecmdr
028a432785 Merge "disp: msm: sde: update perf cpu dma latency votes on idle in video mode" 2021-06-04 09:24:46 -07:00
qctecmdr
ce2c7ef6f3 Merge "disp: msm: sde: disable RSC solver mode during HFR cases" 2021-06-02 15:18:00 -07:00
qctecmdr
8bbc6f2698 Merge "disp: msm: sde: flush commit thread queue during pm suspend" 2021-06-01 20:21:34 -07:00
Andhavarapu Karthik
5df7014990 disp: msm: sde: update perf cpu dma latency votes on idle in video mode
In video mode for fps greater than 60, perf cpu dma latency votes
are not removed during idle fallback. Made changes to remove and
add the perf cpu dma latency votes during idle fallback and idle
exit scenarios respectively.

Change-Id: I8dffc743bd48c96a6022935f71057a0223d9696e
Signed-off-by: Andhavarapu Karthik <kartkart@codeaurora.org>
2021-06-01 17:19:16 -07:00
Dhaval Patel
cfa81fdcaf disp: msm: sde: fix uidle disable configuration
Fix uidle disable setting when panel fps is beyond supported
FAL1 and FAL10 limit.

Change-Id: If76f1789f5f2677e503375234e8d4029c455d455
Signed-off-by: Dhaval Patel <pdhaval@codeaurora.org>
2021-05-27 12:27:03 -07:00
Samantha Tran
f5a91ba3b3 disp: msm: sde: pass disp info to setup vsync source
While setting up vsync source, display info is used to decide whether
or not watchdog TE should be used. This change passes display info
as a parameter to vsync setup rather than using the encoder's display
info which is not updated in the case of panel dead error.

Change-Id: I928ee2012eec7bf63f4ba3538082bc3e47d5e99d
Signed-off-by: Samantha Tran <samtran@codeaurora.org>
2021-05-24 16:24:39 -07:00
Yashwanth
7e03fb61fd disp: msm: add support for seamless dsc switch
This change adds logic to determine dsc switch based on
the connector property "CONNECTOR_PROP_DSC_MODE" and
performs seamless DSC switch if there is any change in
DSC configuration. The connector property is populated
in msm_sub_mode based on which suitable mode is selected.

Change-Id: Ifc4931f16dfb814781bc1d72b103e09103e6bfee
Signed-off-by: Yashwanth <yvulapu@codeaurora.org>
2021-05-20 21:34:27 -07:00
Yashwanth
ffc7cdbe08 disp: msm: add connector state along with crtc state to detect modeset
During modeset, private mode changed is detected from
msm_display_mode which is present in sde_connector_state.
In the current code, sde_connector_state is found from the
drm_connector variable which will not be valid
during atomic check phase and new connector state is
required here. To handle this, drm_connector_state is passed
along with the drm_crtc_state while detecting
msm_atomic_needs_modeset condition.

Change-Id: I62c162eff6e1c091cb05b3f049a40a0f25b710ba
Signed-off-by: Yashwanth <yvulapu@codeaurora.org>
2021-05-21 03:48:21 +05:30
Samantha Tran
db1461c64b disp: msm: sde: disable RSC solver mode during HFR cases
During high framerate cases, disable RSC solver mode as there
will not be much power saving to be done. Disabling is decided
through panel timing node property.

Change-Id: I178170a5ab1b7e31b92ae3019e0147c05a282850
Signed-off-by: Samantha Tran <samtran@codeaurora.org>
2021-05-20 12:24:58 -07:00
Yashwanth
75f3403326 disp: msm: sde: add kickoff_in_progress flag in sde crtc
In dual display usecases, during pm suspend/resume,
commit is scheduled only on primary crtc thread. If idle
timeout value is very short such as in LP2 mode, it might
result in race condition due to idle pc off work getting
scheduled on its crtc thread. This change adds kickoff in
progress flag to handle such cases as crtc frame pending
count is only updated after rc kickoff.

Change-Id: Iebb331d914b23cc5eeadfeb2a488891e88b3202a
Signed-off-by: Yashwanth <yvulapu@codeaurora.org>
2021-05-19 16:35:40 -04:00
qctecmdr
ff27df4031 Merge "disp: msm: sde: avoid reset topology in disable path for POMS" 2021-05-16 08:49:12 -07:00
Samantha Tran
ba95cccfec disp: msm: sde: avoid idle pc during ESD recovery
This change prevents entering into idle pc during ESD
recovery. In the event of a panel dead scenario, the panel
TE is no longer valid until display is enabled again. Until
the time display is enabled, idle pc will be blocked so
that display does not fall into then exit idle pc and
attempt to set the vsync source to this invalid panel TE.

Change-Id: Ibdc71b803d50923832f08b238a96aa28854aaea0
Signed-off-by: Samantha Tran <samtran@codeaurora.org>
2021-05-13 13:43:42 -07:00
Lei Chen
918fc54fc7 disp: msm: sde: avoid reset topology in disable path for POMS
Panel operating mode switch will not change topology and it will
not trigger atomic_check for encoder to reconfigure topology.
So add this change to avoid reset topology when mode set is triggered
by POMS or non-seamless display mode switch.

Change-Id: If1afb30a97bf2695dd8849f025c20b5561fa4b82
Signed-off-by: Lei Chen <chenlei@codeaurora.org>
2021-05-12 22:21:18 -07:00
Prabhanjan Kandula
7c5fde4c27 disp: msm: sde: update back to back atomic check polling
In case of back to back atomic check only commit with modeset
handling, enable client to retry same commit and increase
timeout value used in polling for clear of rsvp-next.

Change-Id: Ied7acfbf0fe1f68282cfc36cdadf2d6aec6db40a
Signed-off-by: Prabhanjan Kandula <pkandula@codeaurora.org>
2021-05-10 14:50:58 -07:00
Veera Sundaram Sankaran
506508e1cd disp: msm: sde: remove unused functions from sde code
Cleanup unused functions from all modules in sde driver.

Change-Id: Ia0e72ab9c281b4200a63ce35bf184e83fe1db5d2
Signed-off-by: Veera Sundaram Sankaran <veeras@codeaurora.org>
2021-05-09 11:41:54 -07:00
Prabhanjan Kandula
f4923f071d disp: msm: sde: defer reset of topology property in disable path
Resetting connector topology property in atomic check phase can cause
issues in concurrency scenario of idle-pc restore for encoder disable
commit. Defer resetting topology property for disable case until encoder
disable actually happens.

Change-Id: Ib53fb5e63df0ab6a332e981b182771b87ef77838
Signed-off-by: Prabhanjan Kandula <pkandula@codeaurora.org>
2021-04-27 16:06:28 -07:00
qctecmdr
b0ea2d882f Merge "disp: msm: sde: remove check to commit RM resourses" 2021-04-27 06:11:35 -07:00
Dhaval Patel
a698dbe5aa disp: msm: sde: fix autorefresh enable/disable sequence
SDE RSCC solver state and autorefresh enable concurrency
is not supported. This change moves the rscc solver state
to disable to avoid concurrency. It also resets the autorefresh
software structure state when encoder is disabled. This allows
autorefresh reconfiguration with next encoder enable.

Change-Id: Idb8c722c823d9f46d3cd03e1b046da69c8d88fc4
Signed-off-by: Dhaval Patel <pdhaval@codeaurora.org>
2021-04-26 10:27:15 -07:00
Nilaan Gunabalachandran
c233dee598 disp: msm: sde: remove check to commit RM resourses
Commit bd234c1885 ("disp: msm: sde: avoid irq enable/disable
during modeset") adds a check before reserving RM resources as
part of modeset. Without this reserve, the resources are not
always allocated during modeset. This change removes the check
around the rm reserve to ensure resources are committed.

Change-Id: Icbb47ad781a04a0cd39c0190e9653eff470af7a0
Signed-off-by: Nilaan Gunabalachandran <ngunabal@codeaurora.org>
2021-04-20 12:22:59 -04:00
Nilaan Gunabalachandran
7c138e3f3c disp: msm: sde: null check for pp hw before encoder mode set
During encoder modeset, driver does not check for ping pong hw
before going through with mode set. This change updates the check
at the encoder mode set and adds a check at the encoder wait
for irq.

Change-Id: If27faa29ee29040808473e44994f42c36980a45e
Signed-off-by: Nilaan Gunabalachandran <ngunabal@codeaurora.org>
2021-04-19 13:49:28 -04:00
Steve Cohen
e5fa459062 disp: msm: restrict AVR_STEP based on panel requirement
Some panels require a fixed step rate for a particular mode.
This change allows DSI panels to specify a single supported
step rate for each nominal fps rate which SDE will enforce
during atomic check of AVR parameters.

Change-Id: I049415449bc88ccd396fced16d4534251eac3a06
Signed-off-by: Steve Cohen <cohens@codeaurora.org>
2021-04-04 18:45:40 -04:00
Steve Cohen
cf86c94f8e disp: msm: sde: add support for AVR_STEP feature
Add AVR step support so SW can trigger a late frame and instead
of immediately triggering, HW will perform the update at the
start of the next step interval. This allows for a fixed SW
vsync timeline to be maintained in userland, eliminating the
usual drift from the actual HW vsync caused by a late frame.

This change adds AVR_STEP support via a DRM property.

Change-Id: I4cf8a296989805f134c2165a3bed0b050bb09c96
Signed-off-by: Steve Cohen <cohens@codeaurora.org>
2021-04-04 18:40:57 -04:00
qctecmdr
ccf41a547c Merge "disp: msm: sde: avoid irq enable/disable during modeset" 2021-04-03 06:52:12 -07:00
qctecmdr
a8bdcf2e77 Merge "disp: msm: sde: report AVR_STATUS in vsync_event sysfs node" 2021-04-02 17:42:22 -07:00
Jayaprakash
7f568a8d71 disp: msm: sde: allow delayed_off_work scheduling always
Add changes to allow delayed_off_work scheduling in all cases.
Skip scheduling only in panel_dead cases where delay_kickoff
is enabled. This will fix the issue seen with commit 08d04c2f3bae
("disp: msm: sde: avoid rc restart when triggered from panel dead").

Change-Id: I4c9a7cd26af9d99ecd3f58023a6fb6d041d91e92
Signed-off-by: Jayaprakash <jmadiset@codeaurora.org>
2021-03-31 15:24:55 -07:00
Mahadevan
bc86c9a0cc disp: msm: sde: avoid rc restart when triggered from panel dead
This change prevents scheduling of rc_restart in case of
panel dead. This early return is required to avoid the list
add corruption when a race condition happens between event
thread and commit thread. When event thread is handling
display failure notification if the virt_enable arrives in
commit thread it will reinizialize kthread for
delayed_off_work without deactivating the existing list
which leads to linkage corruption.

Change-Id: I41d08cd47ba6f887f0860e52bcddf414085524bb
Signed-off-by: Mahadevan <mahap@codeaurora.org>
2021-03-31 15:24:48 -07:00
Veera Sundaram Sankaran
d26e510b77 disp: msm: sde: avoid sde debugfs register access based on HW ownership
Add VM ownership checks before accessing the HW through the debugfs
path in sde crtc/encoder/connector modules to avoid illegal access.

Change-Id: I4ff8f29353835d263beb2091bdeec40125addbf8
Signed-off-by: Veera Sundaram Sankaran <veeras@codeaurora.org>
2021-03-31 14:56:57 -07:00
Steve Cohen
61e6723732 disp: msm: sde: report AVR_STATUS in vsync_event sysfs node
Report the AVR_STATUS which indicates if there's a pending
trigger when Adaptive Variable Refresh feature is enabled.
This allows SW to detect whether the old frame is repeated
or if the new frame was taken when the trigger is very
close to Vsync.

Change-Id: I6b04482e5c4c3bb92bad426c529c1fd3612d41c3
Signed-off-by: Steve Cohen <cohens@codeaurora.org>
2021-03-25 22:59:46 -04: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
qctecmdr
abd8dbd256 Merge "disp: msm: add support for splitlink in sde drm" 2021-03-25 08:49:41 -07:00
Vara Reddy
02a4648999 disp: msm: add support for splitlink in sde drm
Change adds support for splitlink and disables
dsc merge or 3dmerge which is not needed for splitlink.

Change-Id: I77a794d3ea6f53988f493a7af792add81abb22f0
Signed-off-by: Vara Reddy <varar@codeaurora.org>
2021-03-24 22:15:38 -07:00
qctecmdr
4c41c05d7c Merge "disp: msm: fix compilation errors for dlkm compilation" 2021-03-22 19:10:52 -07:00
qctecmdr
e4f4455a5f Merge "disp: msm: sde: add helper function to setup encoder and sspp" 2021-03-22 16:34:40 -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
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
Dhaval Patel
b5cde14bca disp: msm: sde: calculate line_time once during modeset
Calculate line_time once during modeset and allow
each plane to use it instead of calculating for each frame.
It also simplifies the line_time calculation for
command mode display.

Change-Id: I94ce29eec94bfdbee9016fbf93378661ebf79c03
Signed-off-by: Dhaval Patel <pdhaval@codeaurora.org>
2021-03-18 15:03:30 -07:00
Samantha Tran
253d2115d4 disp: msm: sde: add helper function to setup encoder and sspp
This change creates a helper function for sde_encoder_virt_enable
which is responsible for setting up physical encoders. Similarly, it
creates a helper function for sde_hw_sspp_setup_format which is
responsible for writing to the static control register based on ubwc
version.

Change-Id: I106f1f2524398daf7285a931971099735ee8dd4f
Signed-off-by: Samantha Tran <samtran@codeaurora.org>
2021-03-17 16:08:05 -07:00
Gopikrishnaiah Anandan
d9187ba0d9 disp: msm: sde: stop crtc features during encoder disable
Encoder is disabling planes and unstaging layers from layer mixer. Some
of the crtc features are dependent on the plane being staged. Change
adds api that encoder can call on crtc to stop the features that are
dependent on source pipes.

Change-Id: I4d875155ceb8f66acfe6ce0096141ca7253bb140
Signed-off-by: Gopikrishnaiah Anandan <agopik@codeaurora.org>
2021-03-17 11:22:08 -07:00
Dhaval Patel
bd234c1885 disp: msm: sde: avoid irq enable/disable during modeset
Avoid irq enable/disable during modeset and trigger
frame as posted start frame. This saves mode_set time
and also avoids unbalanced vblank_irq in this usecase.

Change-Id: I06958da5e52bc2aca0ddc60d2783615f80a839a4
Signed-off-by: Dhaval Patel <pdhaval@codeaurora.org>
Signed-off-by: Tatenda Chipeperekwa <tatendac@codeaurora.org>
2021-03-08 17:50:39 -08:00
Veera Sundaram Sankaran
b965fdcee5 disp: msm: sde: update retire-fence with precise vsync timestamp
Retire fence for frames are signaled based on vsync. Use the HW
vsync timestamp counter to calculate the precise vsync timestamp
and update the retire fence signal timestamp. This will offset
all IRQ and SW delays and sends the precise timestamp. Avoid
calculating the timestamp on error or panel dead events and
set the current ktime for those cases.

Change-Id: Ic762f7cd6daead9c8fdcb0f8aad6386cf980407d
Signed-off-by: Veera Sundaram Sankaran <veeras@codeaurora.org>
2021-02-26 13:48:57 -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
Veera Sundaram Sankaran
b554f01a10 disp: msm: sde: enable support to get accurate vsync timestamp
From MDSS 8.x, vsync timestamp counter register is added in all the
interfaces. Add interface to get the vsync counter and use the global
qtmr reference counter to get the counter delta. This can be used
with reference to the curret ktime to deduce the accurate vsync
timestamp. This utility is intended to be used for setting the vblank
and retire fence timestamps which would be notified to user-mode.

Change-Id: I608a284c035cda50053eedbb311f1f54b3d3d557
Signed-off-by: Veera Sundaram Sankaran <veeras@codeaurora.org>
2021-02-26 13:48:57 -08:00