]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
drm/msm/dp: clear EDID on display unplug
authorDmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Sun, 24 May 2026 10:33:38 +0000 (13:33 +0300)
committerDmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Fri, 29 May 2026 11:59:26 +0000 (14:59 +0300)
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.

Tested-by: Val Packett <val@packett.cool> # x1e80100-dell-latitude-7455
Tested-by: Yongxing Mou <yongxing.mou@oss.qualcomm.com> # Hamoa IOT EVK, QCS8300 Ride
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Patchwork: https://patchwork.freedesktop.org/patch/727619/
Link: https://lore.kernel.org/r/20260524-hpd-refactor-v6-10-cf3ab488dd7b@oss.qualcomm.com
drivers/gpu/drm/msm/dp/dp_display.c
drivers/gpu/drm/msm/dp/dp_panel.c
drivers/gpu/drm/msm/dp/dp_panel.h

index 8aaf925ee72d36779ed60761efcac9e5b9bb074a..133c84f33056da49321e3621e6e9bb9160021082 100644 (file)
@@ -451,6 +451,10 @@ static int msm_dp_hpd_unplug_handle(struct msm_dp_display_private *dp)
        if (!dp->plugged)
                return 0;
 
+       /* Don't forget modes for eDP */
+       if (!dp->msm_dp_display.is_edp)
+               msm_dp_panel_unplugged(dp->panel, dp->msm_dp_display.connector);
+
        /* triggered by irq_hdp with sink_count = 0 */
        if (dp->link->sink_count == 0)
                msm_dp_display_host_phy_exit(dp);
index 891211b23202393d430016554126d84fa1593152..6bb021820d7c5341369fe38cd8ad38e7a3a8abd1 100644 (file)
@@ -293,6 +293,14 @@ end:
        return rc;
 }
 
+void msm_dp_panel_unplugged(struct msm_dp_panel *msm_dp_panel,
+                           struct drm_connector *connector)
+{
+       drm_edid_connector_update(connector, NULL);
+       drm_edid_free(msm_dp_panel->drm_edid);
+       msm_dp_panel->drm_edid = NULL;
+}
+
 u32 msm_dp_panel_get_mode_bpp(struct msm_dp_panel *msm_dp_panel,
                u32 mode_edid_bpp, u32 mode_pclk_khz)
 {
index 177c1328fd99739fac360250f5c9331c12bc7f81..9173e90a505309836a6a155fe7a7f93e7cd1c12d 100644 (file)
@@ -49,6 +49,8 @@ int msm_dp_panel_deinit(struct msm_dp_panel *msm_dp_panel);
 int msm_dp_panel_timing_cfg(struct msm_dp_panel *msm_dp_panel, bool wide_bus_en);
 int msm_dp_panel_read_sink_caps(struct msm_dp_panel *msm_dp_panel,
                struct drm_connector *connector);
+void msm_dp_panel_unplugged(struct msm_dp_panel *msm_dp_panel,
+                           struct drm_connector *connector);
 u32 msm_dp_panel_get_mode_bpp(struct msm_dp_panel *msm_dp_panel, u32 mode_max_bpp,
                        u32 mode_pclk_khz);
 int msm_dp_panel_get_modes(struct msm_dp_panel *msm_dp_panel,