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 handle msm_preclose as part of msm_release
operation and remove preclose callback handler since legacy
feature is not supported for msm_driver.
Change-Id: I3e9930a96d8928586b1f76e9be4e3b334250cb7e
Signed-off-by: Jayaprakash <jmadiset@codeaurora.org>
Add changes to remove framebuffers attached to a drm_file
in preclose whose refcount is not managed by composer kill
and issue null flush to hardware in such cases. This will
avoid upstream issuing drm_atomic_commit's in drm_fb_release
which is leading to artifacts on screen or atomic_check failures
due to atomically unstaging each fb from plane_state and
committing remaining planes on hardware.
Change-Id: Ic197fb596a1dcfd1ebe2c83e759e619a1ab2f798
Signed-off-by: Jayaprakash <jmadiset@codeaurora.org>
Add changes to clear any dim_layers present in the crtc_state
as part of null commit.
Change-Id: Iaa5d01d7d512445e1524bac85012adda6be6c4a9
Signed-off-by: Jayaprakash <jmadiset@codeaurora.org>
Add changes to move the state operations for setting crtc to
connector state to a helper api. This can be reused during
preclose operation for issuing a drm commit.
Change-Id: I8daf4f2119c8d0e54c123a07255cb8119c2040ea
Signed-off-by: Jayaprakash <jmadiset@codeaurora.org>
Add changes to configure register writes in the event
log dump. The register writes can be enabled in the dump
through the debug_fs command.
Change-Id: I08154e193f670999746fbb30291a866db85c8c8d
Signed-off-by: Jayaprakash <jmadiset@codeaurora.org>
Add changes to reduce log level to debug for non import
cases of drm gem object as this could be a non fatal scenario.
For import buffer cases, this should not be NULL which is
handled as part of commit context.
Change-Id: Ifd0673342e21faa92223fc9883d9331c808baf38
Signed-off-by: Jayaprakash <jmadiset@codeaurora.org>
Add changes to validate the plane fb_translation mode
and dma_buf flags of drm_gem_obj attached to plane.
Change-Id: I6bced92994cd8681cf69231e41bec0c262dafd33
Signed-off-by: Jayaprakash <jmadiset@codeaurora.org>
Add changes to configure the HBB in ubwc_static based on
get_ubwc_hbb api return value instead of default value from dt.
Change-Id: Ib8b408fd3fa3bc3ed90b56e0c0612873ca12f16f
Signed-off-by: Jayaprakash <jmadiset@codeaurora.org>
Add changes to assert nrt vbif halt request as part
of rscc mode2 sequence even if NRT path is not used
for rscc enabled targets in kona family to avoid hang
in some stability cases.
Change-Id: I8b9e13738634e305c9e9ce19dfa3a88b61a2fb9f
Signed-off-by: Jayaprakash <jmadiset@codeaurora.org>
Add changes to avoid seamless crtc transition, if CWB is
enabled in splash handoff commit.
Change-Id: Ib93bd9714b743d3d303e99ba3f87b74e19796dc8
Signed-off-by: Jayaprakash <jmadiset@codeaurora.org>
Add changes to modify in_clone_mode setting post CWB detection
logic and after commit failure cases. This change handles two error
cases.
1) When there is a WB commit during CWB session, we fail
the WB commit as part of atomic_check but in_clone_mode
setting in wb phys_enc is not restored to its original value.
The previous CWB session is not disabled yet in HW and leads
to HW timeouts.
2) If there is an CWB done IRQ scheduled and there is a
atomic_check for CWB encoder happening, the CWB done irq
triggers an incorrect fence event where the release fence
of primary crtc gets signalled early.
Change-Id: I80446063e3edc276dc753dbe5c549dcf3a9f3b47
Signed-off-by: Jayaprakash <jmadiset@codeaurora.org>
Add changes to modify the Qos lut index in case of linear
format with scaler enabled to be same as macrotile qseed
as per Qos recommendation for lagoon target.
Change-Id: I3bde4f8fb8eecde954e118e7c909b84e93b0c89d
Signed-off-by: Jayaprakash <jmadiset@codeaurora.org>
During low power state transitions, populate MNOC AB, MNOC per_pipe_ib
and core_clk values from the old state in cases where current state
values are zeros from userspace but planes are staged.
Change-Id: Iaafdbc9be78d4cfb12ee9cefdcf96030c05f5c6d
Signed-off-by: Jayaprakash <jmadiset@codeaurora.org>
Add changes to update min_prefill_lines to 35 for
inline rotation usecases in lito and lagoon targets.
Change-Id: I1d6ba877972e31a8f950d98ebab8944e1b93cef0
Signed-off-by: Jayaprakash <jmadiset@codeaurora.org>
Add changes to update the WB disable CTL sequence
for lagoon by enabling 3d_merge_reset property.
WB disable sequence without enabling this property is not
fully disabling WB engine and causing underruns
on external display when WB CTL is reused for
external display.
Change-Id: I6a342af4a6283d4ac6a02ae83385584f355b0080
Signed-off-by: Jayaprakash <jmadiset@codeaurora.org>
Add null check for hw_cdm block because it can be accessed
in WB session in commit context when input format is YUV.
Timeline of the issue:
--> C1 commit WB check_only + modeset, RM allocated resources
--> C2 commit WB check_only + modeset, RM has failed commit
because curr and nxt rsvps are already allocated.
RM has released nxt rsvps here which should not be done.
--> C3 commit WB check_only + modeset with change in topology from
C1 commit, RM allocated resources. hw_blks->rsvp_nxt is filled
with reservations allocated by C3 commit.
--> C1 commit scheduled and RM committed reservations allocated
by C3 which caused null dereference of hw_cdm block.
Change-Id: I723e139b55d72228b763ee5e3892f7a7513dd093
Signed-off-by: Jayaprakash <jmadiset@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>
Add changes to modify the CPU Qos Vote for irq latency
during idle usecases.
Change-Id: I07c0ed097c33f755ab4eadab4807063bc688bc24
Signed-off-by: Jayaprakash <jmadiset@codeaurora.org>
On connecting Display port when primary is in suspend state, RM
provides all the available mixers for DP mode validations.
Mixers which are primary and secondary display configured are
also provided for DP mode, which can cause commit failures on
external DP. Add changes to provide the correct mixer count
in such cases.
Change-Id: I239feb60a5373545c0ab929a0c318c6c2ac66531
Signed-off-by: Jayaprakash <jmadiset@codeaurora.org>
Separate the horizontal and vertical max downscale checks
as pre-downscale introduced different limits on different
axes. Also cleanup the variable names for max downscale
limit when pre-downscale is not enabled.
Change-Id: If01aac1844d0bd5133502a50dbc38197e11da5d5
Signed-off-by: Steve Cohen <cohens@codeaurora.org>
Signed-off-by: Jayaprakash <jmadiset@codeaurora.org>
In dual display with continuous splash, when autorefresh gets
disabled in primary on first commit, solver mode gets enabled
and mdp_clock is gated whenever primary enters idle. The
secondary data path will get gated during that time and not advance
anymore. Asynchronous gating of the mdp_clock during operation
can also hang the secondary path. This change avoids entering
the solver mode which fixes the timeout in the autorefresh
disable sequence in the secondary.
Change-Id: I7562ce2ad72d3bb8e8b6b8f356fab6def0caaf92
Signed-off-by: Jayaprakash <jmadiset@codeaurora.org>
Add changes to enable inline rotation version for
lagoon target.
Change-Id: I2f43c38ded3f907592d36481d88c1a7281a79e46
Signed-off-by: Jayaprakash <jmadiset@codeaurora.org>
NRT path is not used for rsc enabled targets
which support inline rotation. Add changes
for rscc mode2 sequence to avoid NRT fetch
halt request and ack.
Change-Id: I60cbfa5fe1c712d1815cc689a7fd17cb99908f31
Signed-off-by: Jayaprakash <jmadiset@codeaurora.org>
Add changes to expose inline rotation version capability
based on new version format.
Change-Id: I38566f9142c10cb9337f6564407951b7da0aa760
Signed-off-by: Jayaprakash <jmadiset@codeaurora.org>
Legacy HW that does not support pre-downscale capability will
incorrectly fail certain scaling checks. Fix those checks to
fully support HW without pre-downscaler.
Change-Id: I8f645bbff959e176c1d4d05a30a580113e320d4b
Signed-off-by: Steve Cohen <cohens@codeaurora.org>
Signed-off-by: Jayaprakash <jmadiset@codeaurora.org>
The pre-downscale capability is checked in multiple places
within sde_plane.c file. Add a helper function to check this
capability flag instead of manually checking this bit.
Change-Id: I21f818a9d81dd63e5eb3da248532904cfa55c838
Signed-off-by: Steve Cohen <cohens@codeaurora.org>
Signed-off-by: Jayaprakash <jmadiset@codeaurora.org>
De-couple the horizontal and vertical pre-downscale checks since
this block can be used in cases where only X-axis downscaling
is needed.
Change-Id: I2e7d30863baed98e9f7fa0a328837691f0bc75a5
Signed-off-by: Steve Cohen <cohens@codeaurora.org>
Signed-off-by: Jayaprakash <jmadiset@codeaurora.org>
Determine inline rotation capabilities and parameter values
from the inline rotator revision. This reduces the number of
capabilities required to be added for each new target.
Change-Id: I3ae02938d51be5a5419b50303c1f244be12b8c47
Signed-off-by: Steve Cohen <cohens@codeaurora.org>
Signed-off-by: Jayaprakash <jmadiset@codeaurora.org>
Don't expose the prefill requirements for inline rotation.
These values are not used within the driver, so move these
settings to user-space.
Change-Id: Ie1038c5804047fafe0ee3129b993d83d4d31b386
Signed-off-by: Steve Cohen <cohens@codeaurora.org>
Signed-off-by: Jayaprakash <jmadiset@codeaurora.org>
Add support for enabling pre-downscale block to increase the
maximum downscale capability for true inline rotation use cases.
Change-Id: Ifa544bb0ae69439abef4bd427134290090fe7230
Signed-off-by: Steve Cohen <cohens@codeaurora.org>
Signed-off-by: Jayaprakash <jmadiset@codeaurora.org>
Advertise the new formats supported with true inline rotation v2 HW
(ABGR8888 compressed and P010).
Change-Id: I0a1b6dfd6bcfd82d9bc61e87680d2c584615e113
Signed-off-by: Steve Cohen <cohens@codeaurora.org>
Signed-off-by: Jayaprakash <jmadiset@codeaurora.org>
Add changes to commit and decrement only those
hardware resources which are required for the modeset.
Timeline of Commit C1 with CWB modeset:
---> Atomic_check
Primary encoder has allocated required HW resources.
CWB encoder has allocated required HW resources.
---> Atomic_commit
On primary encoder, connector is seamless hence
there is no virt_modeset call.
On CWB encoder, there is virt_mode_set call
and during commit HW blocks there is unconditional
decrement for all the HW blocks with rsvp_nxt.
This change ensures hardware blocks are available during
dp display mode validations.
Change-Id: Ifd9439cfc96e727c3093af5f47802c8367775cd7
Signed-off-by: Jayaprakash <jmadiset@codeaurora.org>
Add changes to get valid linewidth value in cases of
inline rotation and scaling. Also, modify the linewidth
to be checked with src rect parameters post rotation.
Change-Id: I7c63175e568ecb524f9cdf8ada1d7c6fdc999236
Signed-off-by: Jayaprakash <jmadiset@codeaurora.org>
Currently during rm_release, drm_conn is available only if connector
and encoder are bound together. If a test_only commit occurs
before a non-blocking modeset commit, this bound is uncertain.
The resources allocated by test_only commit will not be released
and leads to resource allocation failures for the consequent
commits. Add changes to modify this by checking for the encoder
attached to sde_connector which happens during bootup.
Change-Id: Icb1d9595efda8a104ba527175b2dbc6a2c856d44
Signed-off-by: Jayaprakash <jmadiset@codeaurora.org>
Input event handler can be unregistered without being
registered in the case where DMS or DYN_CLK flags
are enabled on first commit, add changes to handle
this sequence.
Change-Id: Idf4f9f310b5d56df396bfa5c6477e94d4fae7a9f
Signed-off-by: Jayaprakash <jmadiset@codeaurora.org>
Free the allocated memory in cases of probe failure in
msm notifier driver.
Change-Id: Ibaa9a6184008a3c516232a921429c64bcbdd5ef9
Signed-off-by: Jayaprakash <jmadiset@codeaurora.org>
During secure video to secure ui transition, since
secure ui requires s2 direct translation, display driver
will detach the iommu device after unmap of the buffers
attached to the CB.
In this regard, upstream framework which can independently
request for buffer free to unmap on the buffer creates an
illegal state where in dma ops are attached and iommu device
is dettached.
Cache the dma ops before detaching the CB and set it to
NULL during iommu device detach, to avoid multiple unmap
calls on the buffer.
Change-Id: I11cd33f5f52b8c9c4f3a627c520bff57e340c8a4
Signed-off-by: Jayaprakash <jmadiset@codeaurora.org>
RM allocated reservations for the ongoing commit are cleared when
there is a delay in ongoing commit scheduling and back to back
prepare comes. This clearing occurs in the subsequent checkonly
commit with modechange property set.
Timeline of the issue:
--> C1 commit check_only + modeset, RM allocated resources
--> C2 commit check_only scheduled before C1 commit with
check_only + modeset, overridden C1 reservations with
its own into rsvp_nxt
--> C1 commit scheduled and RM committed reservations
allocated by C2.
Change-Id: I46cc924fd6515590e32c8e97a82847d2bde97270
Signed-off-by: Jayaprakash <jmadiset@codeaurora.org>
Modify the size of SID's passed as an argument during
scm call as per client requirement.
Change-Id: Idd3bb57a8f9e0a4e7eb6a23d96bfa5b68510063a
Signed-off-by: Jayaprakash <jmadiset@codeaurora.org>
In dual display continuous splash case, there are certain
scenarios where pipe being used in secondary display at boot up
is allocated by primary crtc. Add check to return failure
in such cases.
Change-Id: I9047b6e7f91e59a9daff5089abb41017c068b449
Signed-off-by: Jayaprakash <jmadiset@codeaurora.org>
Add null check for pingpong block used during
the commit phase.
Change-Id: I3ebbcfe9c42ee6d1201a141f553bbb0a0ae97ad6
Signed-off-by: Jayaprakash <jmadiset@codeaurora.org>
For CTL_ACTIVE targets, slave ctl need not to be reserved
as both the interfaces can be driven with single ctl.
Add a necessary check before enabling the feature.
Change-Id: Id68d7dd4fc1cf9534466fd5bfa50c3f551d06ce4
Signed-off-by: Jayaprakash <jmadiset@codeaurora.org>
Update rotator ot limits as per QOS recommendation.
Change-Id: I852155902149dc2518b78144658b96f9ee8b4b4d
Signed-off-by: Jayaprakash <jmadiset@codeaurora.org>
Reject composition if any seamless transition such as
VRR, dynclk is requested during power on/off commits.
Change-Id: I731bfc06b3bd1e7ae920c12cbc68f95f5cc01687
Signed-off-by: Kalyan Thota <kalyant@codeaurora.org>
Signed-off-by: Jayaprakash <jmadiset@codeaurora.org>
Add changes to support avr mode config update during
prepare commit which happens before gpu fence wait
for the input buffers.
Change-Id: Ib2cb5b7e1f10501914c003f6cf066b85048f79d4
Signed-off-by: Kalyan Thota <kalyant@codeaurora.org>
Signed-off-by: Jayaprakash <jmadiset@codeaurora.org>
Add support to enable one-shot mode during qsync
update. This feature ensures the frame drops can be
reduced due to delayed software flush for the
current commit. Also, add changes to disable the qsync
feature post commit.
Change-Id: Icb158853f52284bcf8fa641e5f62200c5460b660
Signed-off-by: Kalyan Thota <kalyant@codeaurora.org>
Signed-off-by: Jayaprakash <jmadiset@codeaurora.org>
Update the wr_ptr_success state to avoid waiting for
two frames pp_done_tx_irq. It ensures frame done callback
is triggered, if IRQ's are disabled for long time by
some external entity.
Change-Id: I9ee72bd65dd7251bf8db0b6843fad02b675935bc
Signed-off-by: Jayaprakash <jmadiset@codeaurora.org>
Allow Qsync and VRR features to be supported independently
by display driver. Restrict the feature availability in
same composition cycle.
Change-Id: I696eb72a2b4f9451e142ffdc5acccc8987c36b6d
Signed-off-by: Kalyan Thota <kalyant@codeaurora.org>
Signed-off-by: Jayaprakash <jmadiset@codeaurora.org>
Add null check before accessing pingpong hw block
allocated during mode set to physical encoder.
Change-Id: Ic464e7c7087f280b1198f6b7485bc0763322c532
Signed-off-by: Jayaprakash <jmadiset@codeaurora.org>
Add required changes to makefile and enable the config
keys for Bengal target compilation.
Change-Id: I7a27be5feffd132cbc35d4a7aa27521b6841e2fe
Signed-off-by: Jayaprakash <jmadiset@codeaurora.org>
In dual display cases when secondary display is resumed first,
primary CTL and LM is selected for secondary path which leads to
invalid configuration. Changes are made to correct the reservation
to select primary CTL and LM for primary connector and secondary
LM to secondary connector.
Change-Id: I6b2a8bedaf46f18bdb28b45ac765f32b26207304
Signed-off-by: Jayaprakash <jmadiset@codeaurora.org>
This change corrects the definitions of functions
invoked when their config keys are not enabled.
Change-Id: Iba4631b8019a5e5a6b95516c5c9f9e28942e60c9
Signed-off-by: Jayaprakash <jmadiset@codeaurora.org>
Currently LUTDMA kickoff is immediately followed by CTL flush,
immaterial of the LUTDMA DONE status in command mode. If LUTDMA
kickoff happens too close to the read_ptr in auto-refresh case, it might
cause a race condition between LUTDMA & CTL flush, due to a HW issue.
Serialize LUTDMA & CTL flush by making the LUTDMA kickoff as blocking
to avoid the race condition in auto-refresh case similar to video mode.
Change-Id: I4f4ae90a2c4f1bc8a0686d8fd4f8aa439123c531
Signed-off-by: Raviteja Tamatam <travitej@codeaurora.org>
Signed-off-by: Jayaprakash <jmadiset@codeaurora.org>
As per hardware recommendation, DMA pipe
width is reduced to 2880, while vig
pipewidth is 4096.
Change-Id: I70dbd44b4883f49879686003ba1fe9694434daab
Signed-off-by: Jayaprakash <jmadiset@codeaurora.org>
Disable ubwc constant color feature only when inline
rotation is enabled regardless of color format.
Change-Id: I8d1e73bf955d9796823947cc8b5fbc2a176b91d3
Signed-off-by: Jayaprakash <jmadiset@codeaurora.org>
Add required changes to makefile and enable the configs
for LITO support.
Change-Id: If6da5a5c139220680b0892d0cc8d408a296f1635
Signed-off-by: Jayaprakash <jmadiset@codeaurora.org>