Currently the aux switch is disabled at the end of the disconnect
path which would include the wait time upto 5 secs becauase of usermode
cleanup. However, the PMIC module is expecting the aux switch to be
disabled within 400 msec after the disconnect is notified. If not, this
would trigger an LPD failure. This change moves aux switch disable
further up in the disconnect path, before waiting on completion of
usermode cleanup.
Change-Id: I42e0608f06127729a78de11631d16d0a3ca0d2b4
Signed-off-by: Sandeep Gangadharaiah <quic_sandgang@quicinc.com>
This change adds robustness to hpd notification by resending
it if there was no action in 2 seconds, just in case, the
first notification didn't make it to the usermode.
Change-Id: Iaf00669ec77e8c50618ee5618735a98518ad7f1a
Signed-off-by: Rajkumar Subbiah <quic_rsubbia@quicinc.com>
With real DP over Type-C sinks, DP driver requests access to USB
combo PHY from USB driver. But in DP SIM mode, there is no real
sink and PD management, so the combo PHY is managed by USB driver
and DP driver uses it without actually claiming it. If the USB
cable is unplugged in this scenario, USB driver notifies the
disconnection through an atomic notifier call. It does not expect
the handler to go into sleep, but the disconnect handler inside
DP driver has multiple wait for events and also sleeps to wait for
HW state updates.
This change passes a skip_wait flag to all the disable functions
to complete disconnect processing by skipping all processor sleeps
and event waits.
Change-Id: Ia98de0e7fa6b0573e644615ee59015914a93f4cf
Signed-off-by: Rajkumar Subbiah <quic_rsubbia@quicinc.com>
Currently regdump framework for all the DP domains are registered during
init. But, unlike other modules in DP each SWI module is controlled by
its own clock and cannot be read without turning on the corresponding
clocks. Trying to do so might lead to unexpected behavior. This change
removes registering these nodes.
Change-Id: Ib20d7212bde24f3858558009e1679661731d16df
Signed-off-by: Sandeep Gangadharaiah <quic_sandgang@quicinc.com>
During MST scenario, plugging out all the downstream monitors connected
to the MST hub would trigger a disconnect handler which would cleanup
display structure. This isn't required since MST hub is still connected
and the display cleanup would be taken care during the actual MST hub
disconnect. Also, handling the disconnect immediately on port status
notification leaves the usermode in an invalid state where it assumes
the display is still enabled and results in commit errors.
Change-Id: Ia9a58fadd89bd05746da25f142b54b31e8567258
Signed-off-by: Sandeep Gangadharaiah <quic_sandgang@quicinc.com>
When a display is powered off, the DP driver currently clears the aux
state and forces it to OFF, expecting a subsequent hpd_low. But in MST
scenarios it is possible for individual displays to be unplugged and then
plugged back in without disconnecting the hub. In this use case, after
the unplug of last display, the aux state is in OFF, and on the
subsequent plug-in, the driver appends the ON flag, leaving both flags
to be set which is an incorrect state. This change removes this
assumption and properly sets the ON/OFF state on enable/disable
respectively.
Change-Id: I96355938a14c77fe958b86bd5f1dabad67584e4e
Signed-off-by: Sandeep Gangadharaiah <quic_sandgang@quicinc.com>
Change moves destroying dp audio workqueue outside dp session_lock.
As part of disconnect, USB driver uses atomic notifier which holds
rcu_read_lock and calls into DP disconnect callback which needs
session_lock. If another DP threads holds DP session_lock then
we block RCU operations.
Change-Id: I5d565ca149a3a34ebd5ede4fb662982d87454f16
Signed-off-by: Vara Reddy <quic_varar@quicinc.com>
During mode validation, DSC book-keeping logic is executed irrespective
of the panel DSC status. If the DSC blocks are available then the
corresponding mode is also set as DSC capable. This step is uncalled for
in a non-DSC panel scenario and might lead to unexpected behavior. This
change checks for panel DSC status before updating DSC book-keeping and
capability for the mode.
Change-Id: I30d6a4d7f3e772b7b13fcca6e318e96372a8becb
Signed-off-by: Sandeep Gangadharaiah <quic_sandgang@quicinc.com>
End section of the display post enable which is supposed
to do the cleanup before exit is also setting DP aux state
as powered on and notifying the connect as successful.
If there is a race condition between connect and disconnect
paths then the code execution would skip to the end section
since display is already disabled. In this case, the DP aux
state would be misleading. This change will set the status
and notify complete only during success case.
Change-Id: I1eca511e042d2dea619bf85fcc28adf9e0cc9536
Signed-off-by: Sandeep Gangadharaiah <quic_sandgang@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>
DSC enable status is updated in DP panel struct as per the DPCD reg
read which is done at the start of the HPD ISR. However, there is a
chance that DSC is actually disabled later during mode query due to
shortage of DSC blocks. This status is stored as part of compression
info structure. This change checks for the latter struct to determine
the actual DSC status.
Change-Id: Id7cd4e65060f2ec939f945e9ac4f4e66260605d3
Signed-off-by: Sandeep Gangadharaiah <quic_sandgang@quicinc.com>
Add existing debug logs to ipc logging to be
accessed through debugfs.
Change-Id: Id9bfe61cb7921674eadc5635847c81a0fbdaef5c
Signed-off-by: Nisarg Bhavsar <quic_bhavsar@quicinc.com>
Some of the display status changes such as re-enable
or re-disable are not critical errors and can be ignored.
This change downgrades such errors as warnings.
Change-Id: I6800e534fc7fb825a472f37bb78a928e2e78d63a
Signed-off-by: Sandeep Gangadharaiah <quic_sandgang@quicinc.com>
Currently in an MST scenario, DSC resources are updated in
bookkeeping only when the corresponding stream is enabled.
This would lead to assigning already reserved DSC blocks to the
2nd stream, if 2nd stream is validated before the 1st stream is
enabled. This change would update the bookkeeping as soon as the
mode is validated.
Change-Id: I7f89a16639efcde3e5dfdf423715ed354e1de66a
Signed-off-by: Sandeep Gangadharaiah <quic_sandgang@quicinc.com>
Currently the tpg_ctrl node takes a boolean flag to enable or disable
test pattern output on DP controller. It always sets the pattern type
to a default pattern. This change updates this interface to accept an
integer value so the user can select different patterns supported by
the controller.
Change-Id: I399091a57f353b2fb8d29a48a8390898ca9afb55
Signed-off-by: Rajkumar Subbiah <quic_rsubbia@quicinc.com>
drm device pointer is not set in dp aux object which
is leading to a warning message during device bootup.
This change will set that pointer before registering
aux object.
Change-Id: Ib79ece56d7d5efd098e06104eb020648d1d075f7
Signed-off-by: Sandeep Gangadharaiah <quic_sandgang@quicinc.com>
Decouple the configuration and parsing of aux switches with the
parsing and configuration of HPD sources. HPD notification can come from
either GPIO based approach or a PD module through a SW interface. The
presence of AUX switch on the board should have no bearing in deciding
which configuration for HPD detection is used. Update the implementation
to allow for flexibility in selecting any combination of the HPD source
and aux switches.
Change-Id: I96d558f1d88a359d523fae6dc746045393884d5a
Signed-off-by: Aravind Venkateswaran <aravindh@codeaurora.org>
Signed-off-by: Rajkumar Subbiah <quic_rsubbia@quicinc.com>
Signed-off-by: Sandeep Gangadharaiah <quic_sandgang@quicinc.com>
HDCP authentication has strict timing requirements and if the
display is on static screen during this time, it is possible
that SDE removes the QOS vote when it detects static display,
thereby affecting the hdcp authentication process.
This change adds qos support in dp driver to vote exclusively
for DP. If valid QOS settings are provided in dtsi, then the
driver adds the vote when it starts authentication and removes
the vote when authentication is completed.
Change-Id: I1d8bc098d0857b13fdf1ca089b6dd2d3f381bdb8
Signed-off-by: Rajkumar Subbiah <quic_rsubbia@quicinc.com>
During a probable race condition where usermode is triggering
a delayed cleanup, this instance would be empty leading to a null
pointer dereference. This change will add protection around this
pointer.
Change-Id: I8e90a1ba3ca925f08678e5fa67616420204edae7
Signed-off-by: Sandeep Gangadharaiah <sandgang@codeaurora.org>
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>