During suspend, there might be a chance that lib auth work is queued
but not yet started. So during pm cycle it might start execution
before host_init which can lead to noc error while accessing dp_aux
registers. To prevent that set abort flag to abort lib auth work and
set interrupts before host_deinit.
Change-Id: Ie2c3ac9b0846644d3c2b37f410c341659b030c16
Signed-off-by: Rajat Gupta <rajatgu@codeaurora.org>
Signed-off-by: Tatenda Chipeperekwa <tatendac@codeaurora.org>
Ensure host_init is executed when the DP display driver is resuming
from a video session teardown. The host_deinit is executed when DP
video session teardown is initiated by the userspace while DP cable
is connected. If the DP display is disconnected from dongle while
the video session is in teardown, the host_init is not executed
when the session is restored. All subsequent display connections
will fail because the core clocks are not on and aux abort is not
reset.
This change will ensure host_init is executed whenever the
host_deinit is executed during DP video session teardown by userspace.
Change-Id: If1ae3eb731a96bd929cd023733c098b513436a1c
Signed-off-by: Sankeerth Billakanti <sbillaka@codeaurora.org>
Signed-off-by: Tatenda Chipeperekwa <tatendac@codeaurora.org>
The hpd notification is skipped in connect_work if there is an
attention_work pending. So, the notification has to be sent in
attention_work.
Some dongles issue multiple attention events with LINK_STATUS_UPDATED
while the connect_work is in progress. So, once the link training
is successfully completed the LINK_STATUS_UPDATED attention event is
considered handled and the attention_work scheduled to execute after
the connect_work will return early without handling the
hpd_notification cases.
This change will ensure the hpd_notification is sent from
attention_work in such cases.
Change-Id: I5ef6781354b80842d2a6f44360cde25ee6d2b0b7
Signed-off-by: Sankeerth Billakanti <sbillaka@codeaurora.org>
Signed-off-by: Tatenda Chipeperekwa <tatendac@codeaurora.org>
The DP display driver issues an audio disconnect notification
after the video disconnect notification. Sometimes audio driver
is waiting for the video commit to complete before turning off
the audio engine. In such cases, there is a brief screen freeze
observed on the primary. In other cases, when the off call from
audio driver gets delayed, a momentary screen freeze is seen.
The audio notification happens as part of the display commit call.
The order of notification is video and then audio while
processing display connect and the same order is followed for
disconnect also, which is causing this issue. These changes will
modify the order of notification to send audio disconnect first
and then video while processing DP cable disconnect.
Change-Id: I8bece39c164620b319d971e5a2597d9dc187566e
Signed-off-by: Sankeerth Billakanti <sbillaka@codeaurora.org>
Signed-off-by: Tatenda Chipeperekwa <tatendac@codeaurora.org>
When DP_LINK_STATUS_UPDATED irq_hpd occurs, the mst audio instances
are turned off, irq_hpd handled and audio instances are turned on
again. While turning on, an audio instance different from the ones
turned off is being sent, causing ops mismatches eventually leading
to a NOC error. These changes will correct the pointer to the audio
or the panel instances to match the ones that are turned off.
Change-Id: Idd9c013fd64cd6db06bbec34f5083029e4ab522c
Signed-off-by: Sankeerth Billakanti <sbillaka@codeaurora.org>
Signed-off-by: Tatenda Chipeperekwa <tatendac@codeaurora.org>
Delay the hotplug connect notification to check for any test
requests issued by the sink. This will avoid unwanted connection
event callbacks.
Change-Id: Id7a04dbbb5ad5b86c3791ac2db5de2c92e98fc46
Signed-off-by: Aravind Venkateswaran <aravindh@codeaurora.org>
Signed-off-by: Tatenda Chipeperekwa <tatendac@codeaurora.org>
Upon completing the link setup, check to see if any IRQ HPD
notification is pending prior to sending the connect notification
to the user mode. If an IRQ HPD is pending, address the IRQ first
prior to sending the notification. This will ensure that the link
setup is stable first before the connection setup is started. This
will also help in adhering to the CTS timing requirements for
responding to IRQ HPD notifications. The current patchset limits
this logic only for SST connections.
Change-Id: I3f5e8e9290f915b98ec5e9e6cf9ff14aa9929d96
Signed-off-by: Aravind Venkateswaran <aravindh@codeaurora.org>
Signed-off-by: Tatenda Chipeperekwa <tatendac@codeaurora.org>
Ensure that session lock is held while handling link maintenance
to ensure that connect/disconnect handling and link maintenance are
serialized. This will avoid un-intended interleaving of session
setup/teardown with link maintenance which can result in link training
failures.
Change-Id: I96bb5b01a80433e26d675a019b8827de9fecb75b
Signed-off-by: Aravind Venkateswaran <aravindh@codeaurora.org>
Signed-off-by: Tatenda Chipeperekwa <tatendac@codeaurora.org>
It is possible that by the time DP display is initialized by the
user mode in response to a hotplug connect event, the DP display has
already been disconnected. In such cases, the link aborted flag is
set by the driver prior to sending the HPD disconnect event. Current
implementation will abort the connection callback when this aborted
flag is set. As a result, the DP stream clocks would not be enabled
and the DP interface will not be able to generate any vsyncs. This can
cause a lot of instability. Allow the connection callbacks from the
usermode to complete successfully to avoid these issues. This will also
help in subsequent disconnect and connect notifications to be handled
gracefully.
Change-Id: I9a0d44492a3590e1b6026bc545ee81f7414925cd
Signed-off-by: Aravind Venkateswaran <aravindh@codeaurora.org>
Signed-off-by: Tatenda Chipeperekwa <tatendac@codeaurora.org>
DP host initialization and de-initialization need to be done only
in response to cable connect/disconnect events. De-initializing host
(which includes turning off all regulators), for every HPD low events
is unnecessary and can cause unintended issues with DP CTS tests.
Change-Id: I95ac71853dc14a46e4175cf0bee4c3eae315fc1e
Signed-off-by: Aravind Venkateswaran <aravindh@codeaurora.org>
Signed-off-by: Tatenda Chipeperekwa <tatendac@codeaurora.org>
During resume, DP uses AUX to perform various functionalities
like DPCD/EDID read or link training etc. This involves other
hardware modules as well like USB and Charger. In a situation
like continuous suspend/resume, while DP is processing resume,
suspend can trigger resulting in dependent hardware modules
to go to sleep. As AUX communication is hardware interrupt
based, this can result in unstable system.
Abort all functionalities before going to suspend to
avoid unnecessary AUX and other functionality failures.
Change-Id: Id52d408270232adf7258a7eb064ee969eba4be71
Signed-off-by: Sankeerth Billakanti <sbillaka@codeaurora.org>
Signed-off-by: Tatenda Chipeperekwa <tatendac@codeaurora.org>
Add more state and event based logging in order to enhance
state transition and use case based debugging in the driver.
Change-Id: I00dee6fcff832c104d3f8b651635a41d9cfc6921
Signed-off-by: Tatenda Chipeperekwa <tatendac@codeaurora.org>
Refactor the mode validation and HDCP worker functions in order
to reduce code complexity and improve readability.
Change-Id: I6b33599d66b73d16a6cb9cc120605a032dada996
Signed-off-by: Tatenda Chipeperekwa <tatendac@codeaurora.org>
Use the new altmode framework to receive the connect, disconnect
and attention events.
Change-Id: Ic542525b526e1abd0f153c293bca6e4cdbb6bf0b
Signed-off-by: Tatenda Chipeperekwa <tatendac@codeaurora.org>
Add support for PLL programming in the DisplayPort driver.
Change-Id: I4f08a621dcae5d1f54d67bb5c34409249012cc7b
Signed-off-by: Tatenda Chipeperekwa <tatendac@codeaurora.org>
Move away from using the supported colorspaces in drm_connector
and replace it with sde_connector to satisfy GKI requirement.
Change-Id: I947c91ea6672e242e572151f72cf0db2e71990cb
Signed-off-by: Abhinav Kumar <abhinavk@codeaurora.org>
Update the mode validation logic by halving the mode clock
when widebus is enabled.
Change-Id: I8f060d8b60403aa5020496983bec0b3e2878b08b
Signed-off-by: Tatenda Chipeperekwa <tatendac@codeaurora.org>
As overall display driver is moving away from hard-coded compression
ratios, prepare the DP driver for the same by removing the usage of
the compression ratio enum.
Change-Id: I298db7d20baed8afec9f96dff8c7e950702bfec9
Signed-off-by: Abhinav Kumar <abhinavk@codeaurora.org>
This change enforces dp, dsi and the sde drivers to use the
drm framework defined dsc_config data structure. As a part of this,
it introduces the sde_dsc_helper API to configure the dsc params
and creating a PPS command. Earlier each driver implemented it's
private versions leading to duplication of code. Additionaly the
helper api supports DSC spec 1.2 422 and 420 mode.
Change-Id: I25933fab08cdabbc6787079926885d1a78945e97
Signed-off-by: Abhijit Kulkarni <kabhijit@codeaurora.org>
When doing multiple immediate plug-unplug, the DP display
driver is waiting for a link training to exhaust the retry
count before processing the disconnect request while flushing
the connect_work. The driver should stop link training and
exit if the link is disconnected. This change will use the
ctrl_aborted flag to early return from link training and
perform the host init/deinit and host ready/unready in pairs
while handling connect/disconnect to reset the abort flags
for the next connect.
Change-Id: If321136ecf12ab2f67d13ef841f1590142aad406
Signed-off-by: Sankeerth Billakanti <sbillaka@codeaurora.org>
Some Type-C multi-port adapters which do not support usb connection
are advertising the multi-functionality in DP alt mode. If
multi-functionality is preferred, the DP driver assumes the adapter
supports usb connection and USB phy driver will program the PHY mode
to DP+USB.
In source mode, usb PD driver checks for the peer_usb_connection
of the adapter. If it does not support usb then it will stop usb stack
and update the PHY MODE to USB only mode from phy_suspend path.
The result is, usb may program the combo PHY to usb only mode when DP
is already connected. This is causing AUX read/write timeouts when DP
is trying to access the phy registers.
To fix this issue, a flag in SVID connect handler in usbpd driver to
notify peer_usb_comm support to the DP driver. DP driver will read this
flag and program the phy mode.
Change-Id: I0164b239bf2832d480795d90f5e9fc221bcc12ba
Signed-off-by: Sankeerth Billakanti <sbillaka@codeaurora.org>
Update the topology allocation by considering the required
mode clock (vtotal x htotal x fps * fudge factor). Modes with
a clock that exceeds the maximum SDE clock will be denoted as
requiring a topology that uses two layer mixers.
Change-Id: I3c773598b0d79cb6fea9d3a0e04d89ff84d67e13
Signed-off-by: Tatenda Chipeperekwa <tatendac@codeaurora.org>
Ensure that the driver is handling DSC and FEC
enablement properly. FEC can now be independently
enabled without DSC. FEC configuration is also
now performed after link training in order to
avoid link training failures as per the DP spec.
Consequently, DSC can now be left on during
compliance testing. For DSC use-cases, ensure
that the minimum supported bpp is set to 24, as
required by the DSC spec.
CRs-Fixed: 2517994
Change-Id: I40339585da5b4e51251a3be7119b6959954954d7
Signed-off-by: Fuad Hossain <fhossain@codeaurora.org>
DP MST userspace connect and disconnect notifications
are sent from dp_mst_drm. When a MST disconnect event
is notified from dp_mst_drm, the dp_display skips
sending the disconnect event and proceeds to process
the host unready. This is causing graceful dp display
disable to fail and affect the next dp display enable.
DP driver should ideally wait for the graceful disable
of DP display and then proceed. In this change, the DP
driver will wait for the display disable, if enabled,
before proceeding with host_unready.
Change-Id: Ief6857a9d59bf3995543792c8022245ddeac9ae6
Signed-off-by: Sankeerth Billakanti <sbillaka@codeaurora.org>
Return immediately after releasing the lock if the connect event
has already been processed.
Change-Id: I80552b4c569d436ec85a945f4ddc3d389e3af43f
Signed-off-by: Tatenda Chipeperekwa <tatendac@codeaurora.org>
The DP link layer CTS tests issue continuous DP plug/unplug.
When that happens, sometimes the DP sw state machine is going
into a bad state causing DP blankout. This is happening when
the post_enable call fails and the hpd handling logic in the DP
driver skips sending the disconnect and next subsequent connect
notifications. This change will fix the conditions to correctly
notify the userspace about the DP connection status.
Change-Id: I41310c8c465901eb5e5bd8fdec2038fe3c01e50a
Signed-off-by: Sankeerth Billakanti <sbillaka@codeaurora.org>
Remove session lock for power state update to improve functionality
for fast hotplug use cases. This allows the controller and aux modules
to be updated asynchronously based on hotplug state. For example,
in disconnected state all aux transactions will be aborted.
Updates to the power state can be done without the session lock
since this path is only exercised during compliance testing.
Change-Id: Ibe175624ef56d9f7b953b9b54928682f1cac906a
Signed-off-by: Tatenda Chipeperekwa <tatendac@codeaurora.org>
There is an audio turn off timeout error whenever DP handles
the link state toggling requests from sink during audio
playback session. The audio hw is waiting for DMA write done
interrupts before issuing a audio session tear down. As the
DP controller is put into reset before link training, the
DMA write done is not sent by the DP controller hence causing
audio timeout errors. These changes turn off audio before the
DP controller is put into reset so that the audio session
tear down takes place within the stipulated time.
Change-Id: I7b88d0385a84f308d8537c2766e6fbc25a2ddc3b
Signed-off-by: RAJAT GUPTA <rajatgu@codeaurora.org>
Currently the DP display's states are not able to handle
the use cases like suspend/resume. The required steps of
host initialization and ready are not properly followed
in such cases. Define proper DP display states, set and
unset at the right places to make sure dp is in proper
state in such cases.
Change-Id: Ibf6d35dec3ab373a7225b30ac1c2f9864bb6ff78
Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>
Send the hotplug notification to the user space only when there
is a state change e.g. from connect to disconnect, or vice versa.
This ensures that there are no spurious notifications that are
sent to the user space.
CRs-Fixed: 2478822
Change-Id: Ic3fdc95de5f2573a14cb526203d7e4ab58c567ba
Signed-off-by: Tatenda Chipeperekwa <tatendac@codeaurora.org>
Add the colorspace property for DP controller for MSM. Also, change
the default method to send the colorimetry information to the sink
from MISC bits of MSA to VSC SDP packets if the sink supports it. This
helps to avoid dynamic switches between the packet types for sending
the colorimetry information during BT2020 and DCI-P3 use-cases.
Change-Id: I7ddf879a187b023fcf7404d64028e4d19b031119
Signed-off-by: Abhinav Kumar <abhinavk@codeaurora.org>
Populate the supported colorspaces property for DP
as part of getting the display modes.
This will expose the supported colorspaces of the sink to
userspace and in-turn the userspace shall pick the colorspace
suitable for the use-case.
Change-Id: I70408c719610bc63f9c06dad8cd50f7fa5d94908
Signed-off-by: Abhinav Kumar <abhinavk@codeaurora.org>
Adding prefixes for error, debug and info
messages in dp files. To enable debug logs
run "echo 0x100 > /sys/module/drm/parameters/debug"
CRs-Fixed: 2493739
Change-Id: Ibf509e837f527be6bff6b7a1c34b0cde2921b388
Signed-off-by: Satya Rama Aditya Pinapala <psraditya30@codeaurora.org>
Break the host initialization and de-initialization to
create late initialization and early de-initialization.
Call host init/deinit on physical connect/disconnect only
As attention messages from sink doesn't change the physical
cable configurations, call only late init/early deinit in
this case to avoid unnecessary hardware resources
re-initialization.
CRs-Fixed: 2490128
Change-Id: Ib930d250724ab3ea811a7388c7ad0aeae1164e21
Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>
Remove qfprom regmap reference from DP driver as it is not
used anymore.
Change-Id: I2e90363a68e50e24a07b0f2d173c14de5ff513cc
Signed-off-by: RAJAT GUPTA <rajatgu@codeaurora.org>
Update the connected state to false during display clean up. This
will allow subsequent connections to be processed correctly in
the face of disconnect failures due to unresponsive user mode
clients.
Change-Id: If30f5d722bf742060c9d4d2dec2207d7baf27fc2
Signed-off-by: Tatenda Chipeperekwa <tatendac@codeaurora.org>
Disable audio for every active panel during display clean
up use cases when the driver times out waiting for the
video path to tear down. This ensures that the audio
subsystem is notified before the clean up shuts down the
timing engine, and also ensures that the audio module
state is correctly updated to indicate that the session
has ended. This change will reduce the likelihood of the
audio subsystem attempting to program DP audio, and also
ensure that the state checks will correctly prevent any
attempts to program audio after the session has ended.
Change-Id: I937f894e80b55164f9700f021d852863aeb18959
Signed-off-by: Tatenda Chipeperekwa <tatendac@codeaurora.org>
Not considering the currently available sde resources and
caps while filtering/validating a mode will report unavailable
modes and result in an atomic commit failure.
DP should calculate the number of required lms and verify
if lms/3dmux are available before a validating a mode.
Change-Id: Idadcc655c30f5a831c47cf22b60085052b5b9fcd
Signed-off-by: Nilaan Gunabalachandran <ngunabal@codeaurora.org>
Improve dp mst simulator mode by adding support
for up to 8 connectors, the ability to add and
remove ports dynamically, and allowing for
different EDIDs for each connector.
CRs-Fixed: 2459530
Change-Id: I945e3292a7e5150ab7a6bbe0addc4f4f46d58e82
Signed-off-by: Fuad Hossain <fhossain@codeaurora.org>
This snapshot ports changes from 4.14 to 4.19 into
the msm and sde layer. Snapshot was taken as of
commit 0f8fb25421ff ("cnss2: Add device version to
SOC info structure").
Change-Id: I59b799a78319c2db6930a2a10bc38976f8c09898
Signed-off-by: Samantha Tran <samtran@codeaurora.org>
Perform mst phy operations during suspend/resume
to allow sinks to be in a correct state. A usbpd
api must also be called before and after the phy
operations to allow the system to go into deep
suspend and resume in a timely manner.
CRs-Fixed: 2363921
Change-Id: Ie21ef9b1caf2044e598466373a6059d2a1e5e58c
Signed-off-by: Fuad Hossain <fhossain@codeaurora.org>
Add extra sleep between SST and MST mode if MSTM_CTRL is not cleared
at hpd to make sure dongle exit from previous MST state.
CRs-Fixed: 2411911
Change-Id: I5b1785c71a91df95167bf5083e9d752a275872a8
Signed-off-by: Xiaowen Wu <wxiaowen@codeaurora.org>
Signed-off-by: Fuad Hossain <fhossain@codeaurora.org>
The DP HDCP layer fails to wait on and clear its internal thread
upon an HDCP stop or failure. This can result in use after free
failures if a read or write over aux channel operation is already
queued.
Update the DP HDCP layer to stop and wait on kthread completion
upon HDCP failures, and clear the kthread command queue before
resuming kthread execution. Additionally, ensure the SDE HDCP
worker thread correctly starts and stops execution upon HDCP
enablement and disablement respectively.
Change-Id: I4218d7935f89416b5e5d74afd8f5d22e031b9a38
Signed-off-by: Christopher Braga <cbraga@codeaurora.org>