Register callback function to hw fence driver and implement the
callback funtion.
As part of fence error handling, address out of ordering of HW
fences, SW override for release fence signal and handle BW voting
in both cmd and video mode.
Change-Id: I22902762b4cc09a5f5a20cf0dd01fc336a0f0cb4
Signed-off-by: GG Hou <quic_renjhou@quicinc.com>
This change adds hardware programming that will update the
txq wr_ptr upon output fence firing.
Change-Id: I79ff0ea5fb2b7f73a48bd70e3c8e71ea69fead95
Signed-off-by: Christina Oliveira <quic_coliveir@quicinc.com>
Current driver prints error messages when it fails
registration for the display clients with the hw-fence
driver, however, this is not an error as currently
feature is disabled by default in hw-fence driver,
which as result will fail registration for clients.
Therefore, silent the error messages for a failed
registration.
Change-Id: I13b872db3452a57a885c73cc8f1cf512be986dd0
Signed-off-by: Ingrid Gallardo <quic_ingridg@quicinc.com>
Currently, num of 3dmux used is incremented or decremented based
on LM allotment. This was leading to wrong bookkeeping in few
corner cases. This change maintains a 3d mux mask to track the
usage and update the count accordingly.
Change-Id: Idf25eff827462f3f0263d01a1aa733a1cbaf0a83
Signed-off-by: Sandeep Gangadharaiah <quic_sandgang@quicinc.com>
Expose the number of cdm blocks available through the connector
capabilities. Add CDM to the topology_control table, so usermode
can use the property to reserve the CDM block during modeset.
Additionally, fix a error code return during CDM block reservation
failure in sde resource manager.
Change-Id: Ib42ca4e8614076a8e5df77d8abc77a9e73674390
Signed-off-by: Veera Sundaram Sankaran <quic_veeras@quicinc.com>
Addresses a race condition which could cause the RM to overcommiting LMs to
DP when multiple DP displays are used.
sde_rm_get_resource_info now uses the RM's mutex and assumes a null
encoder is not a built in display so that it can return an accurate
count of unreserved resources.
DP layer now maintains internal accounting of LMs in use to avoid
validating modes that have insufficient remaining resources.
Change-Id: I908c1597c1d651b6f9c9b74a34137f30087d8801
Signed-off-by: Alex Danila <quic_eadanila@quicinc.com>
This change sets lm_mask for dp connector based on
number of LMs allocated by RM. This mask will be
used during rm allocation and validation of dcwb
mixers for dp display.
Change-Id: I271af03da560587faf17446471bd6b81bb9e809b
Signed-off-by: Mahadevan <quic_mahap@quicinc.com>
This change corrects the conditional check in commit 2859b760a414
("disp: msm: sde: proper allocation of dcwb for LMs") with respect
to DCWB mixer allocation in RM.
Change-Id: I83fd39ed366774f20046b8f9c0e6959116b541ee
Signed-off-by: Mahadevan <quic_mahap@quicinc.com>
During dcwb mixer allocation, resource manager allocates
the first available mixer in the free list. In dual display
uses case with 1 1 1 topology if only secondary is running
CWB then, resource manager allocates DCWB0 which leads to wb
timeout due to HW does not have the connection between LM1
and DCWB0. This change allocates proper dcwb for the LMs in RM.
Change-Id: I0c8b04b46ccad5a7d7dd591fbfa3ea0915eccdc6
Signed-off-by: Mahadevan <quic_mahap@quicinc.com>
This change detects if a encoder has a CTL datapath allocated
and Resource manager is allocating a different CTL block and
avoids this switch. If the CTL datapath switch is allowed, pp_done
timeouts are seen in HW. The reason is due to crossbar is confused
due to the "XSEL" values that are present in previous CTL_*_LAYER_* are
not cleared and SW needs to issue a NULL db update to reset these
"XSEL" values when switching the CTL path.
Change-Id: Iee70c7ddb06feb5cea6dc9f147a942f80c48a7da
Signed-off-by: Jayaprakash Madisetty <quic_jmadiset@quicinc.com>
Starting mdss 9.0, dpu supports triggering
the frame fetch through hw-fencing. This change
adds support for this hw-fence feature.
Change-Id: Icc7d0b69fc2a51103d14612f5ac89b44a47ed826
Signed-off-by: Ingrid Gallardo <quic_ingridg@quicinc.com>
Signed-off-by: Christina Oliveira <quic_coliveir@quicinc.com>
This change avoids null pointer dereference in different APIs.
Change-Id: I01eba9d64fa4ba2fd81f7f39f586867e22d66771
Signed-off-by: Narendra Muppalla <quic_nmuppall@quicinc.com>
Ensure SDE_ERROR error log print function name and line number.
Add a macro DISP_DEV_ERR as a wrapper of dev_err to ensure origin dev_err
will print function name and line number.
This would help with analysis of errors reported with automated testing.
Expected display error log format:
[FUNCTION_NAME:line] ERROR_MESSAGE
Change-Id: I354f45b492059d5ba2bb110d56443fd338add7ad
Signed-off-by: GG Hou <quic_renjhou@quicinc.com>
Use #if IS_ENABLED() instead of #ifdef for configurations as vendor module
guidelines.
Use #if IS_ENABLED(CONFIG_XXX) instead of #ifdef CONFIG_XXX to ensure that
the code inside the #if block continues to compile if the config changes
to a tristate config in the future.
The differences are as follows:
1.#if IS_ENABLED(CONFIG_XXX) evaluates to true when CONFIG_XXX is set to
module (=m) or built-in (=y).
2.#ifdef CONFIG_XXX evaluates to true when CONFIG_XXX is set to
built-in(=y) , but doesn't when CONFIG_XXX is set to module(=m).
Use this only when you're certain you want to do the same thing
when the config is set to module or is disabled.
Change-Id: Ia806b9b01ad8414d0e4de027a382cb68e7fb4a6a
Signed-off-by: GG Hou <quic_renjhou@quicinc.com>
Extend the topology_control connector property to support downscale
blur block. This gives user-mode the capability to reserve the downscale
blur block. Add sde rm changes to reserve the block based on this
connector property during sde_rm_reserve.
Change-Id: Ica2d7c57e6f528eb917acb6aae7e860352895a06
Signed-off-by: Veera Sundaram Sankaran <veeras@codeaurora.org>
Downscale blur HW block support is added from MDSS 9.x. The block
can be used to downscale the layer mixer output before feeding it to
the writeback block. It can be used for both writeback & concurrent
writeback usecases. Add hw files and the respective blocks in sw to
program the downscale blur block.
Change-Id: Ic5787e1655eff5ef0960b7569e48d2f35d23bfc9
Signed-off-by: Veera Sundaram Sankaran <veeras@codeaurora.org>
The sde_hw_blk was meant to be a generic base object for all
SDE HW blocks, however, it enforces using a common set of ops
which is not practical when blocks have different capabilities.
Since this object was never used as intended and is not doing
anything functional today, remove the dead weight.
Change-Id: If76006c1ae5c62e8d7d77b100837dbaf6c661bd3
Signed-off-by: Steve Cohen <quic_cohens@quicinc.com>
Move all the individual boolean flags from HW catalog into a
"features" bitmap. These flags are used to specify support of
various target specific features.
Change-Id: I2334b3b873f3737f91bbae4ef576408247710156
Signed-off-by: Steve Cohen <quic_cohens@quicinc.com>
While hw resources allocation for an active display during modeset, avoid
dsc hw allocation switch by finding which dsc encoders are allocated
previously and allocate same dsc hw encoders. This helps in fixing underrun
issues in below scenario of dual display power ON/OFF.
Use case: Dual DSI display setup, both are DSC enabled, primary in video mode.
--> when both displays are in powered off, all hw block are free.
--> enable second dsi display
Since LM 0/1 marked for primary, LM 2/3 allocated along with DSC 0/1
--> enable primary display
LM 0/1 allocated with DSC 2/3 encoders
--> Now power off secondary DSI
DSC 0/1 are freed up
--> Immediate modeset on primary, DSC allocation switched
LM 0/1 and DSC 0/1 allocated. DSC 2/3 are freed up as per RM but
decoupling DSC 2/3 blocks with respective pingpong or intf is not done.
This is causing underruns on primary.
Tracking which DSC blocks are freed during resource switch and programming the
respective DSC control mux configuration is not feasible and not scalable as
any other display can allocate those blocks and would require synchronizing
across display threads. So approach taken is avoid dsc resource switch itself.
Change-Id: I7f740722a52266740c4b168edc0c619e3cf68989
Signed-off-by: Prabhanjan Kandula <pkandula@codeaurora.org>
If an external display, such as DP, requests for the available
resources, resource manager (RM) will provide a count of all unused
mixers. If the primary/secondary display(s) are not active, the RM
will report the associated preferred mixers as free resources.
However, RM will not allow preferred mixers to be allocated to other
displays. DP driver could look at these available resources and assume
a high resolution mode is possible and fail during resource allocation.
This change updates the available resources info API to account for
primary/secondary preferences while exposing available resources.
Change-Id: I134a1047f24ac9f1fcee695aa14a1d3e43c1571f
Signed-off-by: Nilaan Gunabalachandran <ngunabal@codeaurora.org>
Dummy mixers for dedicated concurrent writeback can be allocated
as valid mixers. However, they should only be allocated for DCWB
usecases. Allocating these virtual resources incorrectly can lead
to underrun on external monitors. These dummy mixers should not
be tracked as available resources and exposed to dp for
mode validation.
Change-Id: I04f583d5b722e0a384a5446e3a8a2313a338aa12
Signed-off-by: Nilaan Gunabalachandran <ngunabal@codeaurora.org>
This change updates rsvp_cur pointer to latest to avoid use
after free issues. rsvp_cur pointer can be freed in few cases due
to the unlock, wait and lock of rm_lock present in
_sde_rm_poll_get_rsvp_nxt_locked.
Change-Id: I389048188e8a615edc3e75dd1102d4ca8c74af65
Signed-off-by: Jayaprakash Madisetty <jmadiset@codeaurora.org>
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>
In PM resume with CWB concurrency usecase, crtc pointer in
conn->state is NULL since drm_mode_config_reset operation is
performed on pm_resume. This change relies on conn_mask in
new_crtc_state for primary connector retrieval and also adds
get_num_lm_from_mode callback to DSI for LM count retrieval
from dsi panel topology. Existing get_mode_info api cannot
retrieve the topology info because mode->priv_info is NULL.
This occurs as WB encoder is added in the drm encoder_list
before primary encoder, introduced as part of commit d28ebf05f4
("disp: msm: sde: populate WB display encoder list before dsi").
Change-Id: I55358fd88ab778bd81475cf3628be13335de1cb5
Signed-off-by: Jayaprakash Madisetty <jmadiset@codeaurora.org>
Signed-off-by: Samantha Tran <samtran@codeaurora.org>
During mode enable after idle, rsvp next would be be set without
rsvp cur. Back to back test only should be serialized, but currently
this would be possible right after idle. This is established by
commit 11aab5f9c3 (disp: msm: sde: Fix null dereference errors).
This change updates the condition to poll for rsvp next clear
during this usecase as well.
Change-Id: I300254967cbec69fff8b31545b8d659afc56f283
Signed-off-by: Nilaan Gunabalachandran <ngunabal@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>
This change fixes the continuos splash logic that identifies the
pipes staged by bootloader. The same code flow is used in trusted ui
handover as well. Existing logic was counting the pipes twice if the pipe
is staged on both the layer mixers. This change simplifies the pipes
already staged before handover by using the pipe index to convey if
it is staged or not.
Change-Id: Idb255f2077161dc3553114ac5d04e0ef743bb5ea
Signed-off-by: Abhijit Kulkarni <kabhijit@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>
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>
Continuous splash setup checks the CTL configuration to determine and
log all planes that have been enabled for continuous splash boot.
This logic currently only checks the planes mapped to each LM on
a given control path, resulting in data planes being missed.
Update the boot plane enumeration logic to additionally check the CTL
fetch active registers to detect and log missed planes. This logic
checks against all planes found through the original enumeration path
to avoid logging the same plane twice. Note that planes found via the
fetch registers are assumed to be used across both rectangles due to
hardware logging limitations.
Change-Id: Ic1f4aaba94111fe096ba9764eeaef242beb6adf5
Signed-off-by: Christopher Braga <cbraga@codeaurora.org>
Previous logic expected rsvp_nxt to always be the 2nd rsvp for
a given encoder. This does not work for releasing back-to-back
test-only reservations (with no current rsvp). If new
resources become available between the 2 test-only commits we
may end up reserving more resources than necessary. Change the
logic by adding a pending flag to the rsvp to simplify lookup
of both current and pending/next resource reservations.
Change-Id: Iefa8085f1b4c0cf49bb744dcc2deb7fb92608454
Signed-off-by: Steve Cohen <cohens@codeaurora.org>
Provide rm status through debugfs node.
cat /d/dri/0/debug/rm_status.
Change-Id: Ic1950b1881f0b57582701a342793aa06adb9da39
Signed-off-by: Dhaval Patel <pdhaval@codeaurora.org>
Add dummy layer mixer blocks to be used for dedicated
CWB.
Change-Id: Ie1fe4fa7502cf5cf4dba3f2c129257887a20b7ad
Signed-off-by: Chandan Uddaraju <chandanu@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>
The last commit in primary-vm before transitioning to
trusted-vm during trusted-ui usecase will be NULL
commit for video mode. In the current splash path,
rm reserve during cont splash res init will succeed
only if there are sspps staged on the mixer. Avoid
this check for vm handoff usecase.
Change-Id: I9829c66f8eb856cc009edc35e489bc9adad1c5d7
Signed-off-by: Krishna Manikandan <mkrishn@codeaurora.org>
To avoid use after free issues this change gets latest rsvp_next pointer
in poll timeout scenario.
Change-Id: I4bd4ce1ce9d4f5f2df0e814ceb8babe544578fc6
Signed-off-by: Narendra Muppalla <NarendraM@codeaurora.org>
Add changes to reserve dsc blocks by routing even numbered
dsc encoders to even pingpong blks and odd numbered dsc encoders
to odd numbered pingpong blks.
Change-Id: I9242b3f7a2784194f9e4a7d30eff6ae3ec16b196
Signed-off-by: Jayaprakash <jmadiset@codeaurora.org>
Signed-off-by: Steve Cohen <cohens@codeaurora.org>
Use sde_connector_state_get_topology API instead of
drm_atomic_get_connector_state since the latter can
return a blank connector state if not found in
global atomic state.
Change-Id: Ib5b58c6cab438a367a885308341d6bccc624f777
Signed-off-by: Amine Najahi <anajahi@codeaurora.org>
This change updates split display flag for ctl v1 topology
table since it is not required for CTL_ACTIVE targets.
Change-Id: Ic669cb6f2c1ca60b2299ebb59a8132a5177ad133
Signed-off-by: Yashwanth <yvulapu@codeaurora.org>
Signed-off-by: Steve Cohen <cohens@codeaurora.org>
This change to address use after free and null checks in
sde driver.
Change-Id: Iade91596748b1b867ae959e61fca0f7072eda8f3
Signed-off-by: Narendra Muppalla <NarendraM@codeaurora.org>
Refactor topology group check helpers into a single
function to remove duplicate code. This change also
uses atomic state to extract topology information
since those functions can be called during atomic
check phase.
Change-Id: Ia262009e0b8fe9fcdeff05e544d2e59be35c9c54
Signed-off-by: Amine Najahi <anajahi@codeaurora.org>
During back to back mode set, current driver logic fails
atomic check during resource allocation with test only if
previous commit also with modeset, has tagged resources for
allocation but did not commit the resources yet. Since client
invoking atomic check before previous mode set commit complete
is an expected scenario now, instead of failing atomic check,
this change allows resource allocation for next commit also go
through by pollong till the first mode set is complete.
Change-Id: I1261b7d205bb0d886085664fab3664162a419c99
Signed-off-by: Prabhanjan Kandula <pkandula@codeaurora.org>