Re: [PATCH v4 01/39] drm/msm/dp: remove cached drm_edid from panel
From: Dmitry Baryshkov
Date: Fri Apr 10 2026 - 09:52:20 EST
On Fri, Apr 10, 2026 at 05:33:36PM +0800, Yongxing Mou wrote:
> The cached drm_edid seems unnecessary here. Use the drm_edid pointer
> directly in the plug stage instead of caching it. Remove the cached
> drm_edid and the corresponding oneliner to simplify the code.
>
> Signed-off-by: Yongxing Mou <yongxing.mou@xxxxxxxxxxxxxxxx>
> ---
> drivers/gpu/drm/msm/dp/dp_display.c | 27 +++++++++++-------
> drivers/gpu/drm/msm/dp/dp_panel.c | 57 ++++---------------------------------
> drivers/gpu/drm/msm/dp/dp_panel.h | 13 +++------
> 3 files changed, 26 insertions(+), 71 deletions(-)
>
> diff --git a/drivers/gpu/drm/msm/dp/dp_display.c b/drivers/gpu/drm/msm/dp/dp_display.c
> index 5c6a24ec140d..e28cc1bbb5b1 100644
> --- a/drivers/gpu/drm/msm/dp/dp_display.c
> +++ b/drivers/gpu/drm/msm/dp/dp_display.c
> @@ -268,6 +268,7 @@ static int msm_dp_display_process_hpd_high(struct msm_dp_display_private *dp)
> const struct drm_display_info *info = &connector->display_info;
> int rc = 0;
> u8 dpcd[DP_RECEIVER_CAP_SIZE];
> + const struct drm_edid *drm_edid;
>
> rc = drm_dp_read_dpcd_caps(dp->aux, dpcd);
> if (rc)
> @@ -275,10 +276,20 @@ static int msm_dp_display_process_hpd_high(struct msm_dp_display_private *dp)
>
> dp->link->lttpr_count = msm_dp_display_lttpr_init(dp, dpcd);
>
> - rc = msm_dp_panel_read_sink_caps(dp->panel, connector);
> + rc = msm_dp_panel_read_link_caps(dp->panel, connector);
> if (rc)
> goto end;
>
> + drm_edid = drm_edid_read_ddc(connector, &dp->aux->ddc);
Where is it free?
> + drm_edid_connector_update(connector, drm_edid);
> +
> + if (!drm_edid) {
> + DRM_ERROR("panel edid read failed\n");
> + /* check edid read fail is due to unplug */
> + if (!msm_dp_aux_is_link_connected(dp->aux))
Does this work for USB-C AltMode usecase?
> + return -ETIMEDOUT;
> + }
> +
> msm_dp_link_process_request(dp->link);
>
> if (!dp->msm_dp_display.is_edp)
--
With best wishes
Dmitry