Since [1], we can use drm_edid_product_id to get debug info from drm_edid instead of directly parsing EDID. Link: https://lore.kernel.org/dri-devel/cover.1712655867.git.jani.nikula@xxxxxxxxx/ [1] Signed-off-by: Melissa Wen <mwen@xxxxxxxxxx> --- .../drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 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 7edc23267ee7..0e37039dead0 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 @@ -109,6 +109,7 @@ enum dc_edid_status dm_helpers_parse_edid_caps( struct drm_device *dev = connector->dev; struct edid *edid_buf = edid ? (struct edid *) edid->raw_edid : NULL; struct drm_edid *drm_edid; + struct drm_edid_product_id product_id; struct cea_sad *sads; int sad_count = -1; int sadb_count = -1; @@ -126,13 +127,13 @@ enum dc_edid_status dm_helpers_parse_edid_caps( if (!drm_edid_valid(drm_edid)) result = EDID_BAD_CHECKSUM; - edid_caps->manufacturer_id = (uint16_t) edid_buf->mfg_id[0] | - ((uint16_t) edid_buf->mfg_id[1])<<8; - edid_caps->product_id = (uint16_t) edid_buf->prod_code[0] | - ((uint16_t) edid_buf->prod_code[1])<<8; - edid_caps->serial_number = edid_buf->serial; - edid_caps->manufacture_week = edid_buf->mfg_week; - edid_caps->manufacture_year = edid_buf->mfg_year; + drm_edid_get_product_id(drm_edid, &product_id); + + edid_caps->manufacturer_id = le16_to_cpu(product_id.manufacturer_name); + edid_caps->product_id = le16_to_cpu(product_id.product_code); + edid_caps->serial_number = le32_to_cpu(product_id.serial_number); + edid_caps->manufacture_week = product_id.week_of_manufacture; + edid_caps->manufacture_year = product_id.year_of_manufacture; drm_edid_get_monitor_name(edid_buf, edid_caps->display_name, -- 2.47.2