commit 3ddbd345539e ("drm/edid: add drm_edid_get_product_id()")
introduced drm_edid_product_id. Use this to get debug info from
drm_edid instead of directly parsing the raw EDID.Signed-off-by: Melissa Wen <[email protected]> --- v5: - replace series url to commit hash (Mario) v8: - fix syntax in the commit message (Mario) --- .../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 ef7f27ce4b50..93db85543440 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 @@ -111,6 +111,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; const struct drm_edid *drm_edid; + struct drm_edid_product_id product_id; struct cea_sad *sads; int sad_count = -1; int sadb_count = -1; @@ -127,13 +128,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 = 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; edid_caps->analog = !(edid_buf->input & DRM_EDID_INPUT_DIGITAL); drm_edid_get_monitor_name(edid_buf, -- 2.51.0
