On an MST unplug, the MST topology manager state needs to be cleared
so it can properly destroy the current topology. But since the mst
active state is cleared prematurely in the driver, this call is
skipped and on a subsequent plug-in, the topology manager ends up
using stale topology from previous configuration. Incorrect RAD
values are used for sideband, causing them to fail.
This change fixes the order of operations, so the topology manager
state is properly updated on unplug. It also removes a duplicate
hpd notification to usermode.
Change-Id: Idcff17be113a361a0b58e54d85957f30d1d4e2d6
Signed-off-by: Sandeep Gangadharaiah <sandgang@codeaurora.org>
Handle host_ready failures and try to initialize host if not already.
Sometimes customizations for customers causes NOC error as host_ready
doesn't return early upon failure and the customer customization
tries to access aux register to reconfig upon aux failure while
reading EDID. Adding fix will make driver more robust to handle such
cases.
Change-Id: Ifa5c56daa32c4ef366a0e05718495ffcb40b96b3
Signed-off-by: Rajat Gupta <rajatgu@codeaurora.org>
Signed-off-by: Sandeep Gangadharaiah <sandgang@codeaurora.org>
DP driver, at probe time, checks for fsa probe completion by
registering a notifier callback. The fsa driver performs some
I2C operations at this time. But occasionally, it takes multiple
attempts to complete these I2C transactions,adding huge delays
to display driver probing.If this delay is long enough, then
display usermode services start before display driver probe completes
and as a result, it fails to enumerate any displays.
Since the fsa switch is needed only after an external display is hot
plugged,this change moves the fsa probe check to dp hotplug handler.
Change-Id: I1b592ec3921a0b406ca23142d07e1a7e8b72090e
Signed-off-by: Vara Reddy <varar@codeaurora.org>
The mode validation logic in DP checks for 3dmux only if DSC is
not supported by the sink. It does not cover the case where the
sink supports DSC but there are not enough DSC blocks available.
In this case, it filters out all the modes even though some of
the modes can be realized with 3dmux or without 3dmux or DSC.
This change updates the logic to check for DSC first and if
that fails, disable DSC for the panel and look for other modes
that can be supported with or without 3dmux alone.
Change-Id: Ie0497333c77d8de30d126e701b5458f354897b8c
Signed-off-by: Rajkumar Subbiah <rsubbia@codeaurora.org>
Currently the DP driver always uses a compression ratio of 3, if
DSC is enabled. So if the sink supports 30bpp, the compressed
output is set to 10bpp. But since the hardware supports
compressing this to 8bpp, it would require less link bandwidth
than 10bpp compressed output. For compliance testing, the
test equipment limits the link bandwidth based on the most
efficient compression ratio and for some resolutions there
is not enough link bandwidth for 3:1 compression.
This change always sets the compression output to 8bpp to
minimize the link bandwidth utilization.
Change-Id: Ifa6129444c2bab4e9c357ddfe49f76efa5b04be0
Signed-off-by: Rajkumar Subbiah <rsubbia@codeaurora.org>
The connector detect function is currently implemented as a
callback from the framework, and creates a context before
calling the detect_port_ctx MST callback. This change updates
the callflow so that the framework calls the new detect_ctx
function in the MST case. This removes the need for creating a
new context before calling further downstream functions.
In addition, references to the mst_connector_get_info
function were replaced by connector_get_info to avoid
redundancy.
Change-Id: I224d09e77fad4b6925a42b1bc912a05e3e4d060a
Signed-off-by: Sudarsan Ramesh <sudarame@codeaurora.org>
Currently, the max voltage swing supported is level 2. This change
adds support for voltage swing level 3 in the dp driver.
Change-Id: Idf1dbb4e74edff924067130a5edea869f392bf38
Signed-off-by: Sudarsan Ramesh <sudarame@codeaurora.org>
In dumping display registers, physical address will be appended after
each block name. This is to support register compare between kernel
and UEFI.
Change-Id: Ic20d3e2bd4c95aa7c71c4b646a149f7e83ad731a
Signed-off-by: Yu Wu <zwy@codeaurora.org>
Currently, 4K120 mode is being filtered by DP driver
due to invalid topology assignation. When 4 LMs are
needed, the number of DSCs must match the number of
LMs since only DSCMERGE based topologies are supported
for driving DSC capable panels.
This change fixes the topology validation logic and
aggregates LM and DSC validation functions in the topology
one since the number of LMs and DSCs must now be considered
in calculating the topology requirement.
Change-Id: I95577eabb34068cd490d23e70ffbb899d1c2d03a
Signed-off-by: Amine Najahi <anajahi@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>
Add support to the dump the DP register space and debugbus information.
Change-Id: I903471b07fdd1926b0fc505a980b2a5048387b69
Signed-off-by: Veera Sundaram Sankaran <veeras@codeaurora.org>
With the change in the clock names for newer targets, this fix
updates the driver to support different clock names per target.
Change-Id: I58c35fce34356f8c79adb0ac8a907e2fb60813ae
Signed-off-by: Sudarsan Ramesh <sudarame@codeaurora.org>
Remove edid/dpcd simulation function from dp_debug and calls to
sim bridge instead to simplify dp_debug module. Also add mst edid
support and mst hpd simulation from aux level.
Move selected mode from dp_debug module to dp_panel module to
simplify mst handling and decouple dp_debug from main dp driver.
Remove custom edid/dpcd mode from dp_panel and dp_aux module.
Remove mst connector list handling from dp_display module.
Change-Id: Ife1d2deb0e353f0a9695b7b90e5bf3459e1c81f7
Signed-off-by: Xiaowen Wu <wxiaowen@codeaurora.org>
Signed-off-by: Karim Henain <khenain@codeaurora.org>
Signed-off-by: Sudarsan Ramesh <sudarame@codeaurora.org>
Add dpcd/edid support to dp aux simulator to enable below features
as options:
skip edid read
skip link training
skip dpcd read
skip dpcd write
skip hot plug
skip sideband message
Also added debugfs support to update dpcd/edid and enable/disable
above features.
Change-Id: Ifa9153f2f00442f3cd5ee3db63fa93384ebc638f
Signed-off-by: Xiaowen Wu <wxiaowen@codeaurora.org>
Signed-off-by: Karim Henain <khenain@codeaurora.org>
Signed-off-by: Sudarsan Ramesh <sudarame@codeaurora.org>
Create the framework to support external dp aux bridge device which
can handle DPCD/I2C/HPD from external.
Change-Id: Iabd0998efc8bf7134d186b1751d219c00217385c
Signed-off-by: Xiaowen Wu <wxiaowen@codeaurora.org>
Signed-off-by: Karim Henain <khenain@codeaurora.org>
Signed-off-by: Sudarsan Ramesh <sudarame@codeaurora.org>
DP driver maintains the number of allocated DSCs per stream for managing
the availability of DSC blocks for each stream. In the current driver,
if there are errors in the disable path, it is possible for the refcount
to go negative thereby affecting the availability of DSC blocks in
subsequent enables.
This change fixes the refcount logic by making sure the DSC count in the
context correctly reflects the usage.
Change-Id: Id595ec87c186ddb3ed300e1390384f367ef79148
Signed-off-by: Sandeep Gangadharaiah <sandgang@codeaurora.org>
This change adds the support to request the dp link clk rate
through the mmrm driver. In the case the system can not
support the rate, user space is notified of the failure and
dp is diconnected.
Change-Id: I4a074054ce42425ca940d4aec505723724736b44
Signed-off-by: Christina Oliveira <coliveir@codeaurora.org>
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>
The current pll driver models the entire DP clock
hierarchy using the clock framework. This creates
unnecessary dependency between the dp driver and
the clock driver and also limits the flexibility
to dp driver when configuring the DP clocks.
This change models these clocks as single nodes
and provide full control to the dp driver and
also minimizes the dependency on the clock driver.
Change-Id: Id5221441ea33b576e7c543396a12cbeb7b44d319
Signed-off-by: Yuan Zhao <yzhao@codeaurora.org>
Audio off is done before handling link maintenance
requests from sink or receiver. After handling the
link maintenance, audio is enabled without
verifying the success condition of the link
maintenance. If the link maintenance fails, then the
DP link will not be established and source will
not send video data. So, there is no need to
enable audio.
This change will skip the audio enable portion of
the code whenever the link maintenance fails. The
sink may eventually issue another irq_hpd to retry
the link training.
Change-Id: I1e9aab07d6465ab1b5e6f92717ef7288dc85068f
Signed-off-by: Sankeerth Billakanti <sbillaka@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>
Add error handling mechanism in host init function to take necessary
action upon failure. For example, power init can fail if we try to
do host_init in between PM suspend. In this case sink sends an hpd
irq with hpd_high equals to 0 and hpd_high equals to 1, after which
ADSP sends the events to DP driver. Now as apps core is in PM suspend
all the devices are put to suspend state and cannot be resumed if
their disable_depth is greater than 1. When driver tries to process
the hpd_high equals to 1 and does host_init in between PM suspend,
it sometimes leads to power init module failure. Inadequate handling
of host init failure as described can lead to a NOC error.
Change-Id: I23eff28e137a18b43eef204fbccc695b743cf726
Signed-off-by: Rajat Gupta <rajatgu@codeaurora.org>
Signed-off-by: Sankeerth Billakanti <sbillaka@codeaurora.org>
Currently hpd uevent notification to usermode is triggered at different
points in the hpd handler callflow. With respect to the SST callflow,
the MST callflow has the following issues:
* the completion event object is getting reinitialized after the uevent
is sent
* The NOTIFIED states are not updated properly.
* dp_display_process_mst_hpd_high is overloaded to do two different
functions in the same flow and is controlled by the mst_probe argument.
This change cleans up the hpd callflows for MST and unifies the hpd
event notification. Also moved the mst check logic from
dp_display_process_mst_hpd_high to a separate function.
Change-Id: I8fdc92d2f9aae16d248c74643cb93688786dfbd5
Signed-off-by: Rajkumar Subbiah <rsubbia@codeaurora.org>
When processing mst hpd low, the driver is clearing mst_active before
triggering hpd notification. The hpd notifier is common for both
sst and mst and since mst_active is cleared it incorrectly treats
this as sst unplug.
This change switches the order of these operations to trigger hpd
notification before clearing mst_active.
Change-Id: I28f90da699e4f2fe177a4e4cfd1d9f03957c3176
Signed-off-by: Rajkumar Subbiah <rsubbia@codeaurora.org>
The lane_count used for validating the display mode
to be set is wrongly taken from the initial panel
capability. So, when lane count is reduced during
link training, the reduced lane count will not be
considered for validating supported modes. Hence
reporting incorrect display modes.
This change will use the correct lane count which
is obtained after the link training sequence.
Change-Id: Iab6239280c29961f7bc6f945ff3ecee9954b0b73
Signed-off-by: Sankeerth Billakanti <sbillaka@codeaurora.org>
We add support for Trusted UI (TUI) transitions and address the
following use cases:
1. Display was active before TUI start
- Power off on TUI start, power off on TUI stop
- Register access not allowed after TUI start (skip all
events except disconnect)
2. Hotplug while TUI is active
- Connect: skip sending connect uevent
- Disconnect: send disconnect uevent and skip any controller
programming
3. TUI start while processing HPD High
- Complete all connect work (and therefore any register access)
then send connect uevent
4. Audio
- Disable audio at TUI start and skip audio programming if TUI
is active
Change-Id: I553e5fa9f3b8265dd0410bf2d616a9accf90605f
Signed-off-by: Tatenda Chipeperekwa <tatendac@codeaurora.org>
Current implementation waits for 10ms prior to sending the connection
notification to user mode. This delay is to check for any potential
IRQ HPD event from the sink which may require a link maintenance.
However, this delay may not be sufficient for certain use cases.
Increase this delay to 150ms and modify the implementation to exit
the wait whenever an IRQ HPD is received. This ensures that we can
process the IRQ HPD in a timely manner as per the specification. To
further improve debug ability, add the support to configure this delay
though debugfs:
echo [delay_ms] > /sys/kernel/debug/drm_dp/connect_notification_delay_ms
Certain cables are unable to handle back-to-back HPD notifications and
may end up skipping some events. To improve interoperability, delay the
handling of disconnect notification. Sinks would typically issue an HPD
high following an HPD low only after they sense that the mainlink has
been torn down. Delaying the handling of HPD low would in turn delay the
issuing of the subsequent HPD high from the sink. Here again, make this
delay configurable through debugfs to improve debug ability of these
interop issues:
echo [delay_ms] > /sys/kernel/debug/drm_dp/disconnect_delay_ms
Change-Id: Ie29198af4dcda6d392798a3a93ebb3ddaa6746c8
Signed-off-by: Aravind Venkateswaran <aravindh@codeaurora.org>
There is a corner case when dp-mst stream is disabled twice:
1. stream 1 is enabled
2. cable plugged out, stream 1 is disabled by kernel
3. cable plugged in, enable stream 0 first
4. disable stream 1
Stream 1 is double disabled and will cause hw crash. This change
will add the check and skip stream_off if already disabled.
Change-Id: Icd1e815a1ed14cd4e784924f3db19b98eb06d571
Signed-off-by: Xiaowen Wu <wxiaowen@codeaurora.org>
Signed-off-by: Sankeerth Billakanti <sbillaka@codeaurora.org>
Don't process any attention requests after hpd off. During automation
tests, scripts are doing a mst unplug after hpd off. But sometimes
disconnect thread freezes waiting for audio ack. During this freeze
unplug happens and uninstalls connector and free the panel and audio
objects due to which lock associated with completion variable causes an
exception.
Change-Id: I4038fd7debc383a96d60906eef17ec6e2163b326
Signed-off-by: Rajat Gupta <rajatgu@codeaurora.org>
usbpd_attention_cb will do dp_display_disconnect_sync, but will
not deinit dp host. usbpd_disconnect_cb can deinit dp host, so
need to check dp state, if dp is unready, should not skip
usbpd_disconnect, can deinit dp host now.
Change-Id: I5a149923ecb043b3a7db973e092bd0d49a715981
Signed-off-by: Zhao, Yuan <yzhao@codeaurora.org>
This change adds more debug logs and event logs to MST callflows
to help with MST stability issues.
Change-Id: I9053eab5932487fccce522cc17ed2e9fb8d887ab
Signed-off-by: Rajkumar Subbiah <rsubbia@codeaurora.org>
Return early if the active streams are not present. Clean function
doesn't take into account the count of active stream which is being
changed during disable and link clk is turned off before that.
Adding active stream check in pre_off will ensures atleast one
stream is on and link clk is not turned off.
Change-Id: I6abf4b14ae4f99161eed3d5300b1961a1983977d
Signed-off-by: Rajat Gupta <rajatgu@codeaurora.org>
The debugfs api for mst control is a multi stage process where the
connector id is selected using the mst_con_id node, which is then
used on other commands such as edid_modes_mst for mode switch.
During mode switch control, the mode is set using the current id
for a display and then the switch is initiated through an unplug
and replug. But on an unplug the connector is destroyed and a new
id is assinged for that display on the subsequent plug. This
change detects this scenario and updates the cached connector id
with the id from the newly created connector.
Change-Id: Ib51566ac9e334d4a0b145b6ae549c59c537cb0cd
Signed-off-by: Rajkumar Subbiah <rsubbia@codeaurora.org>