[PATCH v4 05/14] drm/amd/display: get panel id with drm_edid helper

Mario Limonciello mario.limonciello at amd.com
Fri Jun 13 18:51:43 UTC 2025


On 6/13/2025 9:58 AM, Melissa Wen wrote:
> Instead of using driver-specific code, use DRM helpers.
> 
> Signed-off-by: Melissa Wen <mwen at igalia.com>
Reviewed-by: Mario Limonciello <mario.limonciello at amd.com>
> ---
>   .../drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c | 15 +++++----------
>   1 file changed, 5 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c
> index 514da4d5d300..760da13612b9 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c
> @@ -48,16 +48,11 @@
>   #include "ddc_service_types.h"
>   #include "clk_mgr.h"
>   
> -static u32 edid_extract_panel_id(struct edid *edid)
> +static void apply_edid_quirks(struct drm_device *dev,
> +			      const struct drm_edid *drm_edid,
> +			      struct dc_edid_caps *edid_caps)
>   {
> -	return (u32)edid->mfg_id[0] << 24   |
> -	       (u32)edid->mfg_id[1] << 16   |
> -	       (u32)EDID_PRODUCT_ID(edid);
> -}
> -
> -static void apply_edid_quirks(struct drm_device *dev, struct edid *edid, struct dc_edid_caps *edid_caps)
> -{
> -	uint32_t panel_id = edid_extract_panel_id(edid);
> +	uint32_t panel_id = drm_edid_get_panel_id(drm_edid);
>   
>   	switch (panel_id) {
>   	/* Workaround for monitors that need a delay after detecting the link */
> @@ -140,7 +135,7 @@ enum dc_edid_status dm_helpers_parse_edid_caps(
>   
>   	edid_caps->edid_hdmi = connector->display_info.is_hdmi;
>   
> -	apply_edid_quirks(dev, edid_buf, edid_caps);
> +	apply_edid_quirks(dev, drm_edid, edid_caps);
>   
>   	sad_count = drm_edid_to_sad((struct edid *) edid->raw_edid, &sads);
>   	if (sad_count <= 0) {



More information about the dri-devel mailing list