mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2 00/10] drm/msm/dp: fix DisplayPort hotplug, link training, and multi-lane PHY setup
@ 2026-11-27 10:14 Gianfranco Mariotti
  2026-11-27 10:14 ` [PATCH v2 01/10] drm/msm/dp: configure voltage swing and pre-emphasis for all active lanes Gianfranco Mariotti
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: Gianfranco Mariotti @ 2026-11-27 10:14 UTC (permalink / raw)
  To: Rob Clark, Dmitry Baryshkov, Abhinav Kumar, Jessica Zhang,
	Sean Paul, Marijn Suijten, David Airlie, Simona Vetter
  Cc: Yongxing Mou, Xiangxu Yin, Dale Whinham, Stephen Boyd,
	Jens Glathe, linux-arm-msm, dri-devel, freedreno, linux-kernel,
	Gianfranco Mariotti

On platforms with a native DisplayPort connector using direct HPD
interrupts, DisplayPort initializes on cold boot, but physical cable
unplug and re-plug cycles leave the display blank even though link
training and stream enable callbacks report success.

This series fixes the underlying PHY lane setup, DPCD link-info caching,
SST training-pattern handover, link maintenance completion/stream
handling, and HPD / sink_count / runtime-PM / PHY / EDID state tracking
issues:

1. Configure PHY voltage swing and pre-emphasis across all active lanes
   and refresh lanes/link_rate in msm_dp_ctrl_set_vx_px().
2. Zero out cached link_info in msm_dp_panel_read_dpcd() so re-plugging
   a different sink does not reuse stale rate, use_rate_set, or
   capability flags.
3. Avoid redundant back-to-back link training in
   msm_dp_display_prepare_link() and keep DP_TRAINING_PATTERN_SET active
   until msm_dp_ctrl_on_stream() is ready to switch REG_DP_STATE_CTRL to
   DP_STATE_CTRL_SEND_VIDEO.
4. Guard msm_dp_ctrl_push_idle(), reinitialize ctrl->video_comp, and
   keep training pattern active until stream clocks are enabled in
   msm_dp_ctrl_link_maintenance().
5. Use asynchronous pm_runtime_put() on HPD unplug/notify paths called
   from msm_dp_display_irq_thread() to avoid a synchronous disable_irq()
   self-deadlock in msm_dp_pm_runtime_suspend().
6. Track drm_dp_read_sink_count_cap() in link->has_sink_count and keep
   sink_count and prev_sink_count synchronized across plug and unplug.
7. Keep dp->plugged, AUX transfer enablement, and runtime PM references
   balanced across plug, unplug, detect, prepare_link, and empty branch
   dongle notifications.
8. Keep the DP PHY initialized across msm_dp_display_unprepare() and
   system sleep while a sink remains plugged in (removing now-unused
   msm_dp_ctrl_reinit_phy()).
9. Re-read EDID on demand in msm_dp_display_get_modes() when
   edid_blob_ptr is NULL (e.g. after DRM_FORCE_OFF).
10. Dispatch DP_DP_IRQ_HPD_INT_MASK to msm_dp_irq_hpd_handle(), skipping
    sink requests when mainlink clocks are off and emitting bridge HPD
    notifications on branch DS_PORT_STATUS_CHANGED events (kept at the
    end of the series so it can be dropped if superseded by in-flight
    DRM_CONNECTOR_DP_IRQ_HPD changes).

Changes in v2:
- Add Jens Glathe's Tested-by on unchanged patches 1, 3, and 5.
- Patch 1: clarify commit message regarding persistent ctrl->phy_opts
  staleness on link maintenance and update Fixes tag to 937f941ca06f.
- Patch 2: zero out the entire link_info struct (rate, use_rate_set,
  and capabilities) before parsing DPCD.
- Patch 4: drop redundant msm_dp_ctrl_configure_source_params() call (as
  msm-next already calls msm_dp_ctrl_config_ctrl_streams() inside
  msm_dp_ctrl_link_train(), avoiding unclocked pixel_base access when
  no stream is active), guard msm_dp_ctrl_push_idle() and
  msm_dp_ctrl_clear_training_pattern() / SEND_VIDEO with stream_clks_on,
  and update Fixes tag to 8ede2ecc3e5e.
- Reorder and split HPD changes (was patch 7) into four focused patches
  (patches 6-9):
  - Patch 6: DP_SINK_COUNT capability and prev_sink_count synchronization.
  - Patch 7: dp->plugged, AUX gate, msm_dp_bridge_detect() runtime PM
    release, prepare_link locking, and empty branch dongle handling.
  - Patch 8: PHY lifecycle across msm_dp_display_unprepare(), unplug, and
    system sleep, removing msm_dp_ctrl_reinit_phy().
  - Patch 9: on-demand EDID re-read in msm_dp_display_get_modes() and
    DRM_FORCE_OFF error log suppression.
- Patch 10 (was 5): move to end of series, guard
  msm_dp_ctrl_handle_sink_request() with ctrl->link_clks_on, guard
  msm_dp_irq_hpd_handle() with dp->plugged, and handle branch
  DS_PORT_STATUS_CHANGED connect/disconnect with non-reentrant
  drm_bridge_hpd_notify().
- Link to v1: https://lore.kernel.org/r/20261121214105.32596-1-gianfranco.mariotti94@gmail.com

Testing:
Hardware-tested across cold boot, unplug/re-plug, monitor swap (4K60
native DP and DP-to-HDMI branch adapter), connector DPMS/off cycles, and
IRQ_HPD link-retrain cycles on a QCS8275 (Monaco) SMARC board (SECO F86)
with a native DisplayPort connector running v6.18 + the FROMLIST DP
HPD/MST series (Qualcomm Linux / QLI 2.0), then forward-ported and
build-tested against msm-next.

Signed-off-by: Gianfranco Mariotti <gianfranco.mariotti94@gmail.com>

Gianfranco Mariotti (10):
  drm/msm/dp: configure voltage swing and pre-emphasis for all active
    lanes
  drm/msm/dp: reset cached link_info before reading DPCD capabilities
  drm/msm/dp: keep training pattern active until stream video is ready
  drm/msm/dp: reinit video_comp and guard stream state on link
    maintenance
  drm/msm/dp: avoid synchronous runtime PM put from HPD IRQ thread
  drm/msm/dp: track DP_SINK_COUNT capability and sync prev_sink_count
  drm/msm/dp: fix HPD plugged, AUX gate, and runtime PM tracking
  drm/msm/dp: keep PHY initialized while plugged across link unprepare
  drm/msm/dp: re-read EDID on demand in get_modes when blob is missing
  drm/msm/dp: dispatch native IRQ_HPD directly to
    msm_dp_irq_hpd_handle()

 drivers/gpu/drm/msm/dp/dp_ctrl.c    |  44 +++---
 drivers/gpu/drm/msm/dp/dp_ctrl.h    |   1 -
 drivers/gpu/drm/msm/dp/dp_display.c | 228 +++++++++++++++++++---------
 drivers/gpu/drm/msm/dp/dp_link.c    |  26 +++-
 drivers/gpu/drm/msm/dp/dp_link.h    |   2 +
 drivers/gpu/drm/msm/dp/dp_panel.c   |  20 ++-
 6 files changed, 215 insertions(+), 106 deletions(-)


base-commit: d024361c631b3f020a26c07d683e5103404b0fbf
-- 
2.25.1


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2026-11-27 10:14 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-27 10:14 [PATCH v2 00/10] drm/msm/dp: fix DisplayPort hotplug, link training, and multi-lane PHY setup Gianfranco Mariotti
2026-11-27 10:14 ` [PATCH v2 01/10] drm/msm/dp: configure voltage swing and pre-emphasis for all active lanes Gianfranco Mariotti
2026-11-27 10:14 ` [PATCH v2 02/10] drm/msm/dp: reset cached link_info before reading DPCD capabilities Gianfranco Mariotti
2026-11-27 10:14 ` [PATCH v2 03/10] drm/msm/dp: keep training pattern active until stream video is ready Gianfranco Mariotti
2026-11-27 10:14 ` [PATCH v2 04/10] drm/msm/dp: reinit video_comp and guard stream state on link maintenance Gianfranco Mariotti
2026-11-27 10:14 ` [PATCH v2 05/10] drm/msm/dp: avoid synchronous runtime PM put from HPD IRQ thread Gianfranco Mariotti
2026-11-27 10:14 ` [PATCH v2 06/10] drm/msm/dp: track DP_SINK_COUNT capability and sync prev_sink_count Gianfranco Mariotti
2026-11-27 10:14 ` [PATCH v2 07/10] drm/msm/dp: fix HPD plugged, AUX gate, and runtime PM tracking Gianfranco Mariotti
2026-11-27 10:14 ` [PATCH v2 08/10] drm/msm/dp: keep PHY initialized while plugged across link unprepare Gianfranco Mariotti
2026-11-27 10:14 ` [PATCH v2 09/10] drm/msm/dp: re-read EDID on demand in get_modes when blob is missing Gianfranco Mariotti
2026-11-27 10:14 ` [PATCH v2 10/10] drm/msm/dp: dispatch native IRQ_HPD directly to msm_dp_irq_hpd_handle() Gianfranco Mariotti

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®