summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/drm_edid.c
diff options
context:
space:
mode:
authorJani Nikula <jani.nikula@intel.com>2022-05-03 12:23:58 +0300
committerJani Nikula <jani.nikula@intel.com>2022-05-05 20:28:24 +0300
commitdfc0312596561ac462308fae32130a0c580b7ac1 (patch)
treef392b051c7009e05ab647079c50758ffe16b482c /drivers/gpu/drm/drm_edid.c
parent9975af040a04ba9aef33f3ef1ca4e8f04c7223dd (diff)
downloadlinux-dfc0312596561ac462308fae32130a0c580b7ac1.tar.xz
drm/edid: convert drm_parse_cea_ext() to use cea db iter
Iterate through all CTA data blocks across all CTA Extensions and DisplayID data blocks. Cc: Ville Syrjälä <ville.syrjala@linux.intel.com> Signed-off-by: Jani Nikula <jani.nikula@intel.com> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/7400792525c13f58652f288b891d6057637ed4c8.1651569697.git.jani.nikula@intel.com
Diffstat (limited to 'drivers/gpu/drm/drm_edid.c')
-rw-r--r--drivers/gpu/drm/drm_edid.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
index 3433d9fa4799..98b2e6164468 100644
--- a/drivers/gpu/drm/drm_edid.c
+++ b/drivers/gpu/drm/drm_edid.c
@@ -5497,8 +5497,9 @@ static void drm_parse_cea_ext(struct drm_connector *connector,
const struct edid *edid)
{
struct drm_display_info *info = &connector->display_info;
+ const struct cea_db *db;
+ struct cea_db_iter iter;
const u8 *edid_ext;
- int i, start, end;
edid_ext = drm_find_cea_extension(edid);
if (!edid_ext)
@@ -5517,26 +5518,26 @@ static void drm_parse_cea_ext(struct drm_connector *connector,
info->color_formats |= DRM_COLOR_FORMAT_YCBCR422;
}
- if (cea_db_offsets(edid_ext, &start, &end))
- return;
-
- for_each_cea_db(edid_ext, i, start, end) {
- const u8 *db = &edid_ext[i];
+ cea_db_iter_edid_begin(edid, &iter);
+ cea_db_iter_for_each(db, &iter) {
+ /* FIXME: convert parsers to use struct cea_db */
+ const u8 *data = (const u8 *)db;
if (cea_db_is_hdmi_vsdb(db))
- drm_parse_hdmi_vsdb_video(connector, db);
+ drm_parse_hdmi_vsdb_video(connector, data);
if (cea_db_is_hdmi_forum_vsdb(db) ||
cea_db_is_hdmi_forum_scdb(db))
- drm_parse_hdmi_forum_scds(connector, db);
+ drm_parse_hdmi_forum_scds(connector, data);
if (cea_db_is_microsoft_vsdb(db))
- drm_parse_microsoft_vsdb(connector, db);
+ drm_parse_microsoft_vsdb(connector, data);
if (cea_db_is_y420cmdb(db))
- drm_parse_y420cmdb_bitmap(connector, db);
+ drm_parse_y420cmdb_bitmap(connector, data);
if (cea_db_is_vcdb(db))
- drm_parse_vcdb(connector, db);
+ drm_parse_vcdb(connector, data);
if (cea_db_is_hdmi_hdr_metadata_block(db))
- drm_parse_hdr_metadata_block(connector, db);
+ drm_parse_hdr_metadata_block(connector, data);
}
+ cea_db_iter_end(&iter);
}
static