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>
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>
Enabling and disabling programmable fetch dynamically
across different fps can cause dsi underflow/overflow followed
by underrun. Add changes to always enable prog fetch to handle
such cases. Fix needed_prefill_lines calculation for vfp method
of dfps since linetime is constant in this method and hence
prefill lines need to be based on max_fps. For panels whose
linetime varies with fps, the needed_prefill_lines calculation
remains unchanged.
Change-Id: Ib7b68b577ff903fc2359a8e8c4573d62d55c3828
Signed-off-by: Jayaprakash <jmadiset@codeaurora.org>
Currently, driver hardcodes the DSC version to use
to v1.1 in DP driver even if the sink reports v1.2 in
the DPCD DSC_ALGORITHM_REVISISON register. This causes
a mismatch between the source DSC hardware programming
and the PPS packet information sent to sink.
This change sets the PPS DSC version field to the one
reported by the sink and falls back to v1.1 in case of
DPCD parsing error.
Change-Id: I76fb55b7bf9b3925ae3f408008f3257fc85cef2c
Signed-off-by: Amine Najahi <anajahi@codeaurora.org>
Add support to send PPS command with every frame for DP.
This is needed to satisfy the requirement of certain bridge
chips which need the PPS to be sent every frame.
Change-Id: I8711dff41e60d8b1e1c515a5d34a370a2409ce14
Signed-off-by: Abhinav Kumar <abhinavk@codeaurora.org>
Signed-off-by: Sudarsan Ramesh <sudarame@codeaurora.org>
This change fixes the rate control parameter namely
first_line_bpg_offset as per recommended hardware
settings.
Change-Id: I88cfc745443cdf6b96a8fca01306dec8a7572b1f
Signed-off-by: Abhijit Kulkarni <kabhijit@codeaurora.org>
The rechecks count in dsi_display_status_check_te defines the
number of times the TE status needs to be checked before exiting.
Avoid the execution if rechecks is set to zero as it would avoid
unnecessary irq status changes.
Change-Id: Ice31701ac06f5b0a82f29b5f415dcb0b055e7b16
Signed-off-by: Veera Sundaram Sankaran <veeras@codeaurora.org>
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>
On frame timeouts, the driver should only be responsible for
reporting the error event to user space clients. Handling of
the error events should be left to the user space clients.
This change removes explicit mechanism in SDE driver to track
error events for a pre-defined threshold levels and RESET hints
sent to the user space on handling those error events during
frame timeouts.
Change-Id: I7bdf2495fae6430384b4031a7edf043b6efe88c5
Signed-off-by: Jeykumar Sankaran <jsanka@codeaurora.org>
when a broadcast DSI command is scheduled, the command can get
triggered close to the schedule line. This might cause DMA
timeout. This change reads the video line count from
MDP_INTF_LINE_COUNT register and checks whether DMA trigger
happens close to the schedule line. If it is not close to the
schedule line, then DMA command transfer is triggered.
Change-Id: Ida92e63e46b4cc703d57ce24097834f810776aa8
Signed-off-by: Harigovindan P <harigovi@codeaurora.org>
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>
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>
During frame updates if vsync timeout happens, the probable reason
is pixel_clock is turned off. In such a case the recent update is
not applied on hw and can lead to issues. For example if a pipe
was detached it will not get detached since this update will not
take place.
This change detects the timeout and requests a hard reset from user mode
driver so as to ensure that all the displays are power off and footswitch
is turned off. This will ensure dpu hardware gets reset.
Change-Id: Ic9bade88b6502feb7334d239eaf669977233dbac
Signed-off-by: Abhijit Kulkarni <kabhijit@codeaurora.org>
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>
Currently, during ctl reset in video mode, irq register or
unregister might result in race condition with vblank
enable/disable calls on event thread resulting in enable
cnt mismatch. This change adds mutex locks to avoid race
conditions in such cases.
Change-Id: I45aef19864475ac1b02dd8e84810eee233fc60ea
Signed-off-by: Yashwanth <yvulapu@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>
In pstate_cmp the plane_state structures are accessed
without checking it is allocated or not, which leads to
null pointer dereference. To fix it NULL check is added.
Change-Id: I5982138b396b70979205d87bc9aa260d9501fee0
Signed-off-by: Mahadevan <mahap@codeaurora.org>
The irq register and unregister calls in ppdone timeout
path can result in race condition which can lead to
scenarios where irqs will be enabled with no
callback registered. Add vblank mutex lock to avoid
such scenarios.
Change-Id: I02b07b773d6b9a28c3af431eb3d8314292769f12
Signed-off-by: Krishna Manikandan <mkrishn@codeaurora.org>
There is a race between disable commit swap-state on display
thread and vblank work on event thread which may skip applying
the vblank vote if the encoder_mask has already been cleared.
To avoid the race, use a cached encoder_mask that is gauranteed
to be valid between the vblank_on and vblank_off calls.
Also, vblank queue work is initializing a variable that's never
used and msm_disable_outputs has 2 instances of pointers to old
CRTC state. Remove this dead code.
Change-Id: I5e4a482b8f067e272a2aef5afa08cc0e1ab89434
Signed-off-by: Steve Cohen <cohens@codeaurora.org>
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>
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>
Add check to avoid the dsi panel status check with TE
method as the GPIO support is not available in Trusted-vm.
Change-Id: I5ad6e7b77b189b5150302ab34767dfc4d97aaf61
Signed-off-by: Veera Sundaram Sankaran <veeras@codeaurora.org>
Add support to trigger ESD through debugfs by directly
modifying the reset GPIOs TLMM register in trusted-vm as GPIO
driver support is not enabled.
Change-Id: I859affe69c13dbe115a48b0a63a600a57027db58
Signed-off-by: Veera Sundaram Sankaran <veeras@codeaurora.org>
Parse all the GPIO pins used by the DSI host and the display panel
along with its register ranges and store it in panel struct. This
avoids parsing the device-tree everytime during transitions between
trusted and primary vm.
Change-Id: Ibbb646358c0409703afda1c4f758f044fc8c0001
Signed-off-by: Veera Sundaram Sankaran <veeras@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>