mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Gianfranco Mariotti <gianfranco.mariotti94@gmail.com>
To: Rob Clark <robin.clark@oss.qualcomm.com>,
	Dmitry Baryshkov <lumag@kernel.org>,
	Abhinav Kumar <abhinav.kumar@linux.dev>,
	Jessica Zhang <jessica.zhang@oss.qualcomm.com>,
	Sean Paul <sean@poorly.run>,
	Marijn Suijten <marijn.suijten@somainline.org>,
	David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>
Cc: Yongxing Mou <yongxing.mou@oss.qualcomm.com>,
	Xiangxu Yin <xiangxu.yin@oss.qualcomm.com>,
	Dale Whinham <daleyo@gmail.com>,
	Stephen Boyd <swboyd@chromium.org>,
	Jens Glathe <jens.glathe@oldschoolsolutions.biz>,
	linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org,
	freedreno@lists.freedesktop.org, linux-kernel@vger.kernel.org,
	Gianfranco Mariotti <gianfranco.mariotti94@gmail.com>
Subject: [PATCH v2 09/10] drm/msm/dp: re-read EDID on demand in get_modes when blob is missing
Date: Fri, 27 Nov 2026 11:14:16 +0100	[thread overview]
Message-ID: <20261127101417.24303-10-gianfranco.mariotti94@gmail.com> (raw)
In-Reply-To: <20261127101417.24303-1-gianfranco.mariotti94@gmail.com>

When a DisplayPort connector is forced off (DRM_FORCE_OFF),
drm_helper_probe_single_connector_modes() clears
connector->edid_blob_ptr, and drm_edid_read_ddc() returns NULL if HPD
plug runs while the connector is forced off.

Since commit db6f98b9515f ("drm/msm/dp: remove cached drm_edid from
panel"), msm_dp_display_get_modes() only calls
drm_edid_connector_add_modes() on the existing edid_blob_ptr, so
re-enabling detection without physically replugging the cable falls back
to 640x480.

Re-read EDID via drm_edid_read_ddc() in msm_dp_display_get_modes() when
a sink is plugged in with a NULL edid_blob_ptr, and suppress the false
"panel edid read failed" error log when connector->force is
DRM_FORCE_OFF.

Fixes: db6f98b9515f ("drm/msm/dp: remove cached drm_edid from panel")
Signed-off-by: Gianfranco Mariotti <gianfranco.mariotti94@gmail.com>
---
 drivers/gpu/drm/msm/dp/dp_display.c | 19 +++++++++++++++++--
 1 file changed, 17 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/msm/dp/dp_display.c b/drivers/gpu/drm/msm/dp/dp_display.c
index d3f4b5a9e723..fd9d5f176329 100644
--- a/drivers/gpu/drm/msm/dp/dp_display.c
+++ b/drivers/gpu/drm/msm/dp/dp_display.c
@@ -290,7 +290,8 @@ static int msm_dp_display_process_hpd_high(struct msm_dp_display_private *dp)
 	drm_edid_connector_update(connector, drm_edid);
 
 	if (!drm_edid) {
-		DRM_ERROR("panel edid read failed\n");
+		if (connector->force != DRM_FORCE_OFF)
+			DRM_ERROR("panel edid read failed\n");
 		/* check edid read fail is due to unplug */
 		if (!msm_dp_aux_is_link_connected(dp->aux))
 			return -ETIMEDOUT;
@@ -810,6 +811,7 @@ enum drm_mode_status msm_dp_display_mode_valid(struct msm_dp *dp,
 int msm_dp_display_get_modes(struct msm_dp *dp)
 {
 	struct msm_dp_display_private *msm_dp_display;
+	struct drm_connector *connector;
 
 	if (!dp) {
 		DRM_ERROR("invalid params\n");
@@ -817,8 +819,21 @@ int msm_dp_display_get_modes(struct msm_dp *dp)
 	}
 
 	msm_dp_display = container_of(dp, struct msm_dp_display_private, msm_dp_display);
+	connector = msm_dp_display->panel->connector;
 
-	return drm_edid_connector_add_modes(msm_dp_display->panel->connector);
+	guard(mutex)(&msm_dp_display->plugged_lock);
+
+	if (msm_dp_display->plugged && msm_dp_display->link->sink_count &&
+	    !connector->edid_blob_ptr) {
+		const struct drm_edid *drm_edid;
+
+		drm_edid = drm_edid_read_ddc(connector, &msm_dp_display->aux->ddc);
+		drm_edid_connector_update(connector, drm_edid);
+		msm_dp_display->audio_supported = connector->display_info.has_audio;
+		drm_edid_free(drm_edid);
+	}
+
+	return drm_edid_connector_add_modes(connector);
 }
 
 bool msm_dp_display_check_video_test(struct msm_dp *dp)
-- 
2.25.1


  parent reply	other threads:[~2026-11-27 10:14 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 ` Gianfranco Mariotti [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261127101417.24303-10-gianfranco.mariotti94@gmail.com \
    --to=gianfranco.mariotti94@gmail.com \
    --cc=abhinav.kumar@linux.dev \
    --cc=airlied@gmail.com \
    --cc=daleyo@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=freedreno@lists.freedesktop.org \
    --cc=jens.glathe@oldschoolsolutions.biz \
    --cc=jessica.zhang@oss.qualcomm.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lumag@kernel.org \
    --cc=marijn.suijten@somainline.org \
    --cc=robin.clark@oss.qualcomm.com \
    --cc=sean@poorly.run \
    --cc=simona@ffwll.ch \
    --cc=swboyd@chromium.org \
    --cc=xiangxu.yin@oss.qualcomm.com \
    --cc=yongxing.mou@oss.qualcomm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®