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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
Watchdog timer is moving from TOP to INTF. This change adds
support for movement and ensures backwards compatibility.
Vsync select only needs to specify whether or not to use
Timer 0 associated with the interface. It does not need to
select between Timer 0-4.
Signed-off-by: Samantha Tran <samtran@codeaurora.org>
Change-Id: I9d89a8cb1ea607e9fc0bdbffa0a6a9acceff7f13
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>
Expose panel mode from kernel to SDM with SDE connector property
CONNECTOR_PROP_MODE_INFO and set panel mode from SDM to kernel
with SDE connector property CONNECTOR_PROP_SET_PANEL_MODE for
avoiding private change in upstream code in QGKI kernel.
Change-Id: I0629dad9399967cc1118ac02ce30597076ca367d
Signed-off-by: Lei Chen <chenlei@codeaurora.org>
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>
Commit 05193dc38197 ("drm/bridge: Make the bridge chain
a double-linked list") creates a bridge chain linked
list. This change updates the relevant changes to msm
driver to use the list to find the bridge associated to
the encoder.
Change-Id: I59eb2910be96f4fff7bdbeb040d6ad204c41d747
Signed-off-by: Samantha Tran <samtran@codeaurora.org>
Signed-off-by: Nilaan Gunabalachandran <ngunabal@codeaurora.org>
During wb/cwb usecases, connectors_changed flag will be
set and needs modeset condition will be set to true. This
change updates qsync concurrency check with modeset to
fail atomic check only if there is seamless poms, dms or
dynamic clock scenario.
Change-Id: I1183f25cd45310fbd1d0b5ce67ee3d5dd3660fe0
Signed-off-by: Yashwanth <yvulapu@codeaurora.org>
The current SDE driver logic during MDP hang cases is to send a capture
event to user-mode if recovery custom event is registered. Otherwise, it
will enforce a device panic for debugging purpose. This might have a race
condition during the display tear-down sequence as user-mode unregisters
the recovery event when the last frame is in progress. If the last frame
causes any MDP hang, it will result in a device reset. Support only the
event registration to avoid this case, since HW recovery is not expected
to be changed dynamically.
Change-Id: I8a11e1060b239ac6827f1d078e3e396cff4c1325
Signed-off-by: Veera Sundaram Sankaran <veeras@codeaurora.org>
Setting hbb value based on the ddr type of the target is
not supported in trusted vm environment. Add changes to
retain the ubwc configuration programmed by LA during the
transition to LE environment.
Change-Id: I1fa308ea99f815cfe4d1c75a22dbb6f89a806007
Signed-off-by: Krishna Manikandan <mkrishn@codeaurora.org>
In connector atomic check, seamless vrr cannot be
determined since mode doesn't get populated by that time.
This change moves qsync validation from connector to encoder
atomic check to verify & handle modeset concurrencies.
Change-Id: Ia41bde4c05f98d8ba4cb39c18f2da1683cf9e5a3
Signed-off-by: Yashwanth <yvulapu@codeaurora.org>
Clear any pending flushes after disable so that they are not
re-applied on the next enable for this encoder.
Change-Id: Ic8d387e60b6369062269c48611ee9a9de8887ec7
Signed-off-by: Steve Cohen <cohens@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>