drm/msm/dp: Drop the HPD state machine#956
Open
riteshk-quic wants to merge 10 commits intoqualcomm-linux:tech/mm/drmfrom
Open
drm/msm/dp: Drop the HPD state machine#956riteshk-quic wants to merge 10 commits intoqualcomm-linux:tech/mm/drmfrom
riteshk-quic wants to merge 10 commits intoqualcomm-linux:tech/mm/drmfrom
Conversation
The HPD state status is the 3 most significant bits, not 4 bits of the HPD_INT_STATUS register. Fix the bit shift macro so that the correct bits are returned in msm_dp_aux_is_link_connected(). Fixes: 19e52bc ("drm/msm/dp: return correct connection status after suspend") Signed-off-by: Jessica Zhang <jessica.zhang@oss.qualcomm.com> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com> Link: https://lore.kernel.org/all/20260314-hpd-refactor-v5-1-0c8450737d64@oss.qualcomm.com/
The ISR_HPD_* enum should represent values that can be read from the REG_DP_DP_HPD_INT_STATUS register. Swap ISR_HPD_IO_GLITCH_COUNT and ISR_HPD_REPLUG_COUNT to map them correctly to register values. While we are at it, correct the spelling for ISR_HPD_REPLUG_COUNT. Fixes: 8ede2ec ("drm/msm/dp: Add DP compliance tests on Snapdragon Chipsets") Signed-off-by: Jessica Zhang <jessica.zhang@oss.qualcomm.com> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com> Link:https://lore.kernel.org/all/20260314-hpd-refactor-v5-2-0c8450737d64@oss.qualcomm.com/
Instead of relying on the link_ready flag to specify if DP is connected, read the DPCD bits and get the sink count to accurately detect if DP is connected. Signed-off-by: Jessica Zhang <jessica.zhang@oss.qualcomm.com> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com> Link:https://lore.kernel.org/all/20260314-hpd-refactor-v5-3-0c8450737d64@oss.qualcomm.com/
Currently, the DP link training is being done during HPD. Move link training to atomic_enable() in accordance with the atomic_enable() documentation. Link disabling is already done in atomic_post_disable() (as part of the dp_ctrl_off_link_stream() helper). Finally, call the plug/unplug handlers directly in hpd_notify() instead of queueing them in the event thread so that they aren't preempted by other events. Signed-off-by: Jessica Zhang <jessica.zhang@oss.qualcomm.com> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com> Link:https://lore.kernel.org/all/20260314-hpd-refactor-v5-4-0c8450737d64@oss.qualcomm.com/
Currently, we queue an event for signalling HPD connect/disconnect. This can mean a delay in plug/unplug handling and notifying DRM core when a hotplug happens. Drop EV_USER_NOTIFICATION and signal the IRQ event as part of hotplug handling. Signed-off-by: Jessica Zhang <jessica.zhang@oss.qualcomm.com> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com> Link:https://lore.kernel.org/all/20260314-hpd-refactor-v5-5-0c8450737d64@oss.qualcomm.com/
With EV_USER_NOTIFICATION gone event's data is no longer useful. Drop it, removing also the argument from event handlers. Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com> Link:https://lore.kernel.org/all/20260314-hpd-refactor-v5-6-0c8450737d64@oss.qualcomm.com/
Handling of the HPD events in the MSM DP driver is plagued with lots of problems. It tries to work aside of the main DRM framework, handling the HPD signals on its own. There are two separate paths, one for the HPD signals coming from the DP HPD pin and another path for signals coming from outside (e.g. from the Type-C AltMode). It lies about the connected state, returning the link established state instead. It is not easy to understand or modify it. Having a separate event machine doesn't add extra clarity. Drop the whole event machine. When the DP receives a HPD event, send it to the DRM core. Then handle the events in the hpd_notify callback, unifying paths for HPD signals. Signed-off-by: Jessica Zhang <jessica.zhang@oss.qualcomm.com> Co-developed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com> Link:https://lore.kernel.org/all/20260314-hpd-refactor-v5-7-0c8450737d64@oss.qualcomm.com/
Add sink count to the debug logs for [un]plug and HPD IRQ handling. Signed-off-by: Jessica Zhang <jessica.zhang@oss.qualcomm.com> [DB: dropped link_ready handling] Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com> Link:https://lore.kernel.org/all/20260314-hpd-refactor-v5-8-0c8450737d64@oss.qualcomm.com/
Tracking when the DP link is ready isn't that useful from the driver point of view. It doesn't provide a direct information if the device should be suspended, etc. Replace it with the 'plugged' boolean, which is set when the driver knows that there is DPRX plugged. Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com> Link:https://lore.kernel.org/all/20260314-hpd-refactor-v5-9-0c8450737d64@oss.qualcomm.com/
Currently the driver only updates the EDID when it detects a connected monitor, which results in the connector still listing outdated modes even after the display is unplugged. Set connector's EDID to NULL on unplug to clear the list of modes. Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com> Link:https://lore.kernel.org/all/20260314-hpd-refactor-v5-10-0c8450737d64@oss.qualcomm.com/
quicmahap
approved these changes
Apr 16, 2026
quicmahap
approved these changes
Apr 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Currently, all HPD interrupt handling must go through the HPD state
machine.
This has caused many issues where the DRM framework assumes that DP is
in one state while the state machine is stuck in another state.
As discussed here [1], this series:
plugged in (as opposed to if the DP link is ready).