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>
During MST display enablement, the time slots for the display are
calculated during mst atomic check, which is then used in the
enable path. But if for some reason the payload wasn't allocated
successfully, then the enable path will have the time slots set to
0 which causes a send video timeout and also the missing payload
could result in null pointer dereferencing in step2 of mst payload
addition.
This change checks for this situation during pre-enable and returns
an error so the enable does not continue ahead.
Change-Id: If139707537b7a6dba169841ac82841851b4c09cb
Signed-off-by: Rajkumar Subbiah <quic_rsubbia@quicinc.com>
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>
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>
When IRQ HPD is simulated for DP MST, the driver updates the EDID in port context
for all the ports in an effort to refresh the context with the new port count.
But currently this operation is not synchronized with other debugfs operations
and also the edid read operations on the existing port. This can cause the
sim driver to update or delete the edid data while the edid data is being
read on an existing port, which would result in an edid read failure on the
DRM driver.
This change synchronizes these operations to avoid these race conditions.
Change-Id: I692af092583ed12b3da8c6587a74ec97d98fdfec
Signed-off-by: Rajkumar Subbiah <quic_rsubbia@quicinc.com>
The driver currently does not cache the current status of the aux switch
and calls the switch configure on any hpd event. So when there are
back to back disconnect notifications, it ends up calling switch
disconnect multiple times. But this is disrupting other operations
since the switch driver restores default settings on any call to
update settings.
This change caches the switch state and reconfigures it only on a
configuration change.
Change-Id: Ieeeaf5ac3bf8a7771b3118735422365cf2ee1f7b
Signed-off-by: Rajkumar Subbiah <quic_rsubbia@quicinc.com>
This change checks if the mst panel is still valid before
accessing them when MST specific debugfs nodes are used.
Change-Id: I45f63009c1bff6a83e7af60a85f953674fef6797
Signed-off-by: Rajkumar Subbiah <quic_rsubbia@quicinc.com>
Update DP PHY tx drive level and pre-emphasis information
for mainlink training.
Move parameters from code to dtsi and add parameter parsing.
Change-Id: I7527327e39952d76184ea22adade7949c64d3734
Signed-off-by: Nisarg Bhavsar <quic_bhavsar@quicinc.com>
This change fixes the unused label warning, when compiling
this driver for kalama, introduced by change
I383680c54feb826676965282e76bb3e5c3e17c4c.
Change-Id: Ia7c51fd1956b847220ebeae29a51edcc9f4dbf7e
Signed-off-by: Rajkumar Subbiah <quic_rsubbia@quicinc.com>
Update vcpi start slot for other connectors when an individual connector is unplugged.
Currently the driver is caching the previous start slot and doing the adjustment
in a single pass. When the connectors are removed and added in a specific order,
it is possible that the list of payloads are not sorted by start_slot and the
removed payload is not the first payload in the list.
The current logic does not support this case and will leave the start_slot of
the first payload unadjusted thereby resulting in an invalid slot allocation.
This change does the caching and adjustment in two separate passes to make sure
the start slot adjustment happens irrespective of the order of the payloads.
Change-Id: I5ca7ded263740590b0fe3cc31c8d67441a42c92f
Signed-off-by: Nisarg Bhavsar <quic_bhavsar@quicinc.com>
This change checks for the atomic state and ensures
that allocation and deallocation of vcpi slots is
prevented in the same phase.
Change-Id: I05c87db43eca8ba749ed8a0907dcaf95945dd645
Signed-off-by: Soutrik Mukhopadhyay <quic_mukhopad@quicinc.com>
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>
During atomic check for MST plugins, the driver is not catching and
propagating failures properly thereby incorrectly returning a
success even though the slot allocation had failed. This causes
invalid access of payload data in the MST topology manager.
This change checks the return code for slot allocation and atomic
check calls and propagates them to caller.
Change-Id: I383680c54feb826676965282e76bb3e5c3e17c4c
Signed-off-by: Rajkumar Subbiah <quic_rsubbia@quicinc.com>
After MST mode enumeration, check the mode count and print
an error message if no modes are returned.
Change-Id: I89352263c137680a1260dabbe8ab38e32e2a4882
Signed-off-by: Rajkumar Subbiah <quic_rsubbia@quicinc.com>
If an aux transaction fails at its lowest level, there is a builtin
retry mechanism before erroring out. Currently an error message is
printed after each failed attempt even though the aux transaction
might succeed on retry.
This change switches the alert level to warning on these attempts
and makes sure an error message is printed if the transfer errors
out after retries.
Change-Id: I47fb27fe0aa15eb5e2400c4338f9b9c59439983f
Signed-off-by: Rajkumar Subbiah <quic_rsubbia@quicinc.com>
Stop forcing max supported bpp to 24 in MST usecases.
Revert of I5b0e6ad86df39915073f469ea67e6addea165965.
Change-Id: Ibaa55952eeb6130afcb72910ad498f44d9aca9b1
Signed-off-by: Nisarg Bhavsar <quic_bhavsar@quicinc.com>
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>
-Add support to display-drivers modules using DDK framework for pineapple.
-Add macro that makes it easy to register new modules.
Change-Id: Id9cc0f367cff5b95b526fb42193471b3f3abd012
Signed-off-by: Varsha Suresh <quic_varssure@quicinc.com>
The inactive simulated DP MST connectors will not have a panel assigned.
So, the driver needs check for a valid panel before dereferencing the
panel object.
Change-Id: I60a4ca666f3c7c81a4e92e08cf572d5abac4ee78
Signed-off-by: Sankeerth Billakanti <quic_sbillaka@quicinc.com>
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>
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>
In MST atomic check function, allow to release vcpi slots for
any case of changes in modes, active state or connectors for a crtc state.
This reverts the commmit id 28cde80bd3666b6b339a21cac3d04b3b11c318b6.
Change-Id: Ice13790f2e652b336619e1d78b42ddb708b4cb2e
Signed-off-by: Soutrik Mukhopadhyay <quic_mukhopad@quicinc.com>
When a display is disabled, the mst slot payloads get updated in the
topology manager and also the start_slot for the remaining payloads
get adjusted, if necessary to start from 1. But the copy of these
values in dp_mst_drm context are getting readjusted properly. But
since the local context is used to update the slot configuration in
the dp controller, it is possible for the slot configuration in the
source and sink to mismatch causing blank output.
This change introduces a 2 pass solution while updating timeslots to
make sure the values in the bridge context reflect the values in
the topology manager.
Change-Id: Ia6f66e8d5ffcde3f25b1b2649733a547a06de995
Signed-off-by: Rajkumar Subbiah <quic_rsubbia@quicinc.com>
This is a partial revert of I67ace5c064b2b56d03732a78f334ea6b1b649608 which tries
to enable Sink CRC irrespective of the sink's CRC capability to workaround an
issue with a specific sinks which reports incorrect capability on first plugin.
But this causes some MST dongles to misbehave causing one or both outputs to
be blank.
Change-Id: I70c70db8ac371fe0094a45780216a2518d688a36
Signed-off-by: Rajkumar Subbiah <quic_rsubbia@quicinc.com>
During DP disable, it is possible for audio and display to race
causing the audio to send teardown notification after display driver
has disabled all the clocks. This change adds a check for panel state to
avoid accessing registers during this callback.
Change-Id: I6322726a04745bc6c73338cd33f65cfdbfe42ec7
Signed-off-by: Nisarg Bhavsar <quic_bhavsar@quicinc.com>
Force max supported bpp to 24 to improve stability of MST usecases.
Change-Id: I5b0e6ad86df39915073f469ea67e6addea165965
Signed-off-by: Nisarg Bhavsar <quic_bhavsar@quicinc.com>
Signed-off-by: Rajkumar Subbiah <quic_rsubbia@quicinc.com>
The DP debugfs node for CRC read currently does not check
if the panel is enabled before attempting the read. This
could cause unclocked access of DP registers. This change
adds the necessary protection and bails out if the clocks
are not turned on.
Change-Id: Ia555e2473fc9f0f7434ee3665eb4fb7cfb4f97cf
Signed-off-by: Rajkumar Subbiah <quic_rsubbia@quicinc.com>
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>
Some rate limited logs in dp aux and dp ctrl are using
pr_err_ratelimited function to print the logs instead of
the standard DP log macros. So this change adds a new
ratelimited DP log macro and make the logging consistent.
Change-Id: I75d7306d94c7c360783f39259c509c32fe59cdf5
Signed-off-by: Rajkumar Subbiah <quic_rsubbia@quicinc.com>
Some monitors seem to be not enabling Sink CRC capability on first plugin
and therefore the CRC read returns all zeros. But on subsequent plugins
the capability is set properly and CRC values are calculated. To
workaround this quirk on the sink side, this change reenables sink CRC
if the values are read as zeros.
Change-Id: I67ace5c064b2b56d03732a78f334ea6b1b649608
Signed-off-by: Rajkumar Subbiah <quic_rsubbia@quicinc.com>
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>