Gráfico de commits

175 Commits

Autor SHA1 Mensaje Fecha
qctecmdr
2adf210808 Merge "disp: msm: dp: clear connected state if switch config fails" 2023-05-31 15:48:31 -07:00
Rajkumar Subbiah
2d4c6cf994 disp: msm: dp: clear connected state if switch config fails
During HPD High, the driver sets the CONNECTED state and then performs
a sequence of initialization operations. If any of them fails, it should
properly unwind the executed operations to restore the driver to its
initial state. This change adds error handling paths in the hpd high
handler to do just that.

Change-Id: I66a77ff73b7c11d0a59d80b8df3c4ea49a4ed3a6
Signed-off-by: Rajkumar Subbiah <quic_rsubbia@quicinc.com>
2023-05-29 14:41:06 -04:00
qctecmdr
fc7ef746c3 Merge "disp: msm: dp: fix pbn value for MST RG calculation" 2023-05-26 13:59:39 -07:00
Andrew Bartfeld
ed36c21587 disp: msm: dp: change to internal lm bookkeeping
Previously we were updating internal layer mixer allocation
bookkeeping during every mode validation regardless of whether
the mixers were already designated in use, resulting in double
counting of in-use layer mixers.

This change prevents modification of these values if the given
connector's mode has already been previously validated so valid
modes can be returned properly.

Change-Id: Iea5dccfbc4087cc76f186101d38b605792326b16
Signed-off-by: Andrew Bartfeld <quic_abartfel@quicinc.com>
2023-05-23 15:42:10 -07:00
Rajkumar Subbiah
4e82bfb0fa disp: msm: dp: fix pbn value for MST RG calculation
The DP MST driver calculates the PBN value for each mode during
mode enumeration. This PBN value is later used to calculate slot
count and also MST RG parameters. But if DSC and/or FEC is enabled,
then the slot calculation needs the PBN with overhead, but
RG calculator needs the one without. But currently, the driver is
using the PBN with overhead for both. This double counting of the
overhead for RG calculation causes MST FIFO overflow for certain
usecases.

This change fixes this by caching both PBN values during mode
enumeration and using the PBN value without overhead as input
to RG calculation.

Change-Id: Id58e91068c25202e6528a793ab736bc51732961f
Signed-off-by: Rajkumar Subbiah <quic_rsubbia@quicinc.com>
2023-05-11 22:48:10 -04:00
qctecmdr
337c29b341 Merge "disp: msm: dp: fix messaging on dp mode validation failure" 2023-04-19 14:34:14 -07:00
qctecmdr
d6553c5775 Merge "disp: msm: dp: turn off aux switch on dp cable disconnect" 2023-04-13 23:29:59 -07:00
Rajkumar Subbiah
6d55e0b68e disp: msm: dp: fix messaging on dp mode validation failure
Updated the log message on a LM check failure during mode validation
to print the correct available LM value that is being used in the
check.

Change-Id: Ie719dead04bacee70d44e30c0069ce9099a69570
Signed-off-by: Rajkumar Subbiah <quic_rsubbia@quicinc.com>
2023-04-12 14:40:31 -07:00
Nisarg Bhavsar
bd10effaeb disp: msm: dp: limit mode clock for MST
For a HBR2 dongle, limit mode clock to ensure only resolutions
under 4k@30fps are supported on each port for MST usecases.

This fixes functionality with dongles which only support HDMI 1.4,
but don't filter out higher unsupported resolutions.

Change-Id: I2f9e53e55a31ede7fa891f29b9e7d36e108d375c
Signed-off-by: Nisarg Bhavsar <quic_bhavsar@quicinc.com>
2023-04-10 09:24:32 -07:00
Soutrik Mukhopadhyay
7d74c23aa4 disp: msm: dp: turn off aux switch on dp cable disconnect
The dp_display_disconnect_sync is disabling the aux switch during
the attention hpd low processing. Ideally, the aux switch needs to
be turned off only when the dp cable is disconnected. With aux switch
getting turned off even while cable is connected is leading to HDCP
compliance test failure. This change will turn off aux switch only
when the cable is disconnected. It reverts the commit id
b6466ca7f597396cd2ecb3623d059435dfb0e4c6.

Change-Id: I90cc5f31b2be1afda61f74ea4e0a44332811ead3
Signed-off-by: Soutrik Mukhopadhyay <quic_mukhopad@quicinc.com>
Signed-off-by: Andrew Bartfeld <quic_abartfel@quicinc.com>
2023-04-03 14:31:04 -07:00
Sankeerth Billakanti
c3cd13a34a disp: msm: dp: do not skip wait for usb disconnect with dp_sim
Wait for the userspace to disable DP when usb cable is removed
during DP simulation. The usb notifier is a blocking call.

Change-Id: I6c00cc684b4d99da30a129f034eb17bf505738bb
Signed-off-by: Sankeerth Billakanti <quic_sbillaka@quicinc.com>
2023-03-23 14:35:17 -07:00
Rajkumar Subbiah
ae1ea3d993 disp: msm: dp: create dp aux log ipc context at probe time
Currently the ipc context for drm_dp_aux is being created
during dp_aux_init. This limits the IPC logs to be only
readable when the external display is in connected state
and it gets destroyed on unplug. This change moves the
context creation to probe time and the aux context will
be passed to the aux driver during initialization.

Change-Id: Id8d26c907c9cb2fd8c89b2842b98e7a908816abe
Signed-off-by: Rajkumar Subbiah <quic_rsubbia@quicinc.com>
2023-03-06 18:12:50 -08:00
Nisarg Bhavsar
548dc93b0e disp: msm: dp: update resource tracking for 8k@30
Update tracking of layer mixer resources to prevent valid modes
from being skipped during DP topology validation.

Change-Id: Id88337094c4113b721f307d24583a3ca30157216
Signed-off-by: Nisarg Bhavsar <quic_bhavsar@quicinc.com>
2023-02-21 08:15:50 -08:00
Sandeep Gangadharaiah
51ee816c56 disp: msm: dp: port API changes related to MST payload update
Latest LTS kernel has refactored the payload code for MST. This
change port the latest payload related API changes.

LINKED: https://patchwork.freedesktop.org/patch/498176/
Change-Id: I0f5bfe30824c5a9bbf4bc346a24f236a53bc0d70
Signed-off-by: Sandeep Gangadharaiah <quic_sandgang@quicinc.com>
Signed-off-by: Nisarg Bhavsar <quic_bhavsar@quicinc.com>
2023-01-26 12:57:47 -08:00
Nisarg Bhavsar
4a2e5b3fe1 disp: msm: dp: Add abstract and wcd939x aux switch support
Add functionality to change which aux switch is used
at compile time for different targets. Add wcd939x
switch support.

Change-Id: Iced3b11733009680063790dfa8f180b19002f963
Signed-off-by: Nisarg Bhavsar <quic_bhavsar@quicinc.com>
2022-11-01 19:15:01 -07:00
Sandeep Gangadharaiah
c76df5605c disp: msm: dp: enable aux switch from display HPD handler
Currently, aux switch is enabled by usbpd handler before
handing over the control to dispaly HPD handler. However,
in some scenarios there is a chance that altmode would
directly call into display HPD handler bypassing the usbpd
handler. This would lead to aux errors since aux switch
is not enabled. This change will enable aux switch in
display HPD handler which would avoid the resulting aux
errors. This issue is a regression caused by this change
b6466ca7f597396cd2ecb3623d059435dfb0e4c6.

Change-Id: I425991ba95b22411740f88cba5ca2083d13969e1
Signed-off-by: Sandeep Gangadharaiah <quic_sandgang@quicinc.com>
2022-10-29 16:23:35 -07:00
Sandeep Gangadharaiah
cc997cd3d1 disp: msm: dp: disable aux switch at the start of the disconnect path
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>
2022-09-23 11:48:47 -07:00
Rajkumar Subbiah
ecaabfefc9 disp: msm: dp: resend hpd notification to usermode
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>
2022-08-30 13:45:59 -07:00
Rajkumar Subbiah
5043291e1a disp: msm: dp: skip waits when processing usb disconnect in sim mode
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>
2022-08-30 13:43:49 -07:00
qctecmdr
c037ed6b7c Merge "disp: msm: dp: remove register call for regdump framework for DP domains" 2022-08-17 18:44:04 -07:00
qctecmdr
8ac778f8e1 Merge "disp: msm: dp: remove disconnect call for downstream port status change" 2022-08-12 16:02:35 -07:00
Sandeep Gangadharaiah
e60e9026fc disp: msm: dp: remove register call for regdump framework for DP domains
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>
2022-08-10 11:29:19 -07:00
qctecmdr
5a5adbba9f Merge "disp: msm: dp: address race condition in LM allocation" 2022-08-09 20:49:21 -07:00
Sandeep Gangadharaiah
f86e196de0 disp: msm: dp: remove disconnect call for downstream port status change
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>
2022-08-09 11:28:01 -07:00
Sandeep Gangadharaiah
0763e33723 disp: msm: dp: fix aux state during individual plug out/in
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>
2022-08-03 20:33:56 -07:00
Vara Reddy
df69a7d379 disp: msm: dp: destroy audio workqueue outside session_lock
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>
2022-07-29 16:19:42 -07:00
qctecmdr
66a9a093e7 Merge "disp: msm: dp: set DSC capabilities in mode only if panel supports DSC" 2022-07-28 21:43:58 -07:00
Sandeep Gangadharaiah
24d4662c83 disp: msm: dp: set DSC capabilities in mode only if panel supports DSC
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>
2022-07-27 12:27:03 -07:00
Sandeep Gangadharaiah
603ae09669 disp: msm: dp: update DP aux state with correct status
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>
2022-07-26 21:15:48 -07:00
Alex Danila
5ed42eb243 disp: msm: dp: address race condition in LM allocation
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>
2022-07-20 13:26:49 -04:00
Sandeep Gangadharaiah
d333d97bd6 disp: msm: dp: get DSC enable status from mode instead of panel
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>
2022-06-23 13:19:07 -07:00
Nisarg Bhavsar
15b7e73a10 disp: msm: dp: add debug logs to ipc logging
Add existing debug logs to ipc logging to be
accessed through debugfs.

Change-Id: Id9bfe61cb7921674eadc5635847c81a0fbdaef5c
Signed-off-by: Nisarg Bhavsar <quic_bhavsar@quicinc.com>
2022-06-14 17:09:54 -07:00
qctecmdr
8a1413eaad Merge "disp: msm: dp: change display status log level" 2022-05-18 18:55:00 -07:00
Sandeep Gangadharaiah
9e8f2710ea disp: msm: dp: change display status log level
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>
2022-05-18 10:34:00 -07:00
Sandeep Gangadharaiah
bbe2404b91 disp: msm: dp: update DSC resource book keeping for mst
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>
2022-05-18 06:49:07 -07:00
qctecmdr
705ad08735 Merge "disp: msm: dp: add ability to select pattern for tpg" 2022-05-13 09:58:57 -07:00
Rajkumar Subbiah
bbd8a4b5ab disp: msm: dp: add ability to select pattern for tpg
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>
2022-04-14 18:08:34 -04:00
Sandeep Gangadharaiah
e8ccba4d59 disp: msm: dp: set drm device pointer in dp aux object
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>
2022-04-11 09:42:50 -07:00
Aravind Venkateswaran
78c45e9d5d disp: msm: dp: fix configuration of aux switches and HPD sources
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>
2022-01-20 13:52:06 -05:00
qctecmdr
b5da8ebb6a Merge "disp: msm: dp: check for active panels ptr before cleanup" 2021-11-11 10:12:37 -08:00
Rajkumar Subbiah
6c8c95f99e disp: msm: dp: add qos vote during hdcp authentication
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>
2021-11-09 16:56:58 -05:00
Sandeep Gangadharaiah
ce678e896e disp: msm: dp: check for active panels ptr before cleanup
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>
2021-11-08 21:30:33 -05:00
Sandeep Gangadharaiah
d3d3794b51 disp: msm: dp: destroy mst topology on unplug
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>
2021-10-15 10:02:01 -04:00
qctecmdr
f04eb4120c Merge "disp: msm: dp: use 3dmux when dsc is not available" 2021-09-07 07:12:22 -07:00
Rajat Gupta
7f0f23c35f disp: msm: dp: fix to handle host ready failures
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>
2021-09-01 14:05:43 -04:00
qctecmdr
e8a4a92814 Merge "disp: msm: dp: move fsa init from dp probe to dp hotplug" 2021-08-26 14:23:36 -07:00
Vara Reddy
e0219f400c disp: msm: dp: move fsa init from dp probe to dp hotplug
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>
2021-08-25 16:36:19 -07:00
Rajkumar Subbiah
fd42eaf7ce disp: msm: dp: use 3dmux when dsc is not available
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>
2021-08-05 20:26:34 -04:00
Rajkumar Subbiah
eebce2ae4c disp: msm: dp: add support for 3.75:1 compression
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>
2021-08-05 20:26:34 -04:00
Sudarsan Ramesh
65f1c136ea disp: msm: dp: change the detect callback to detect_ctx
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>
2021-06-16 15:57:54 -04:00