diff options
author | Jani Nikula <jani.nikula@intel.com> | 2022-05-03 12:23:56 +0300 |
---|---|---|
committer | Jani Nikula <jani.nikula@intel.com> | 2022-05-05 20:28:13 +0300 |
commit | 4ce08703a8c4be77b060aefd14eda272f50a45e4 (patch) | |
tree | 1ec57fc4c0975db3fdf3b3fa6ff0b907da2c9691 /drivers/gpu/drm/drm_edid.c | |
parent | b07debc2a8ce7324c85479a28d145eaa05382286 (diff) | |
download | linux-4ce08703a8c4be77b060aefd14eda272f50a45e4.tar.xz |
drm/edid: convert drm_detect_hdmi_monitor() to use cea db iter
Iterate through all CTA data blocks, not just the first CTA extension.
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/b867e7b628189d2f8fa7eac5b9aa701892724711.1651569697.git.jani.nikula@intel.com
Diffstat (limited to 'drivers/gpu/drm/drm_edid.c')
-rw-r--r-- | drivers/gpu/drm/drm_edid.c | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c index 1ea27278652b..ca594d502941 100644 --- a/drivers/gpu/drm/drm_edid.c +++ b/drivers/gpu/drm/drm_edid.c @@ -5131,27 +5131,24 @@ EXPORT_SYMBOL(drm_av_sync_delay); */ bool drm_detect_hdmi_monitor(const struct edid *edid) { - const u8 *edid_ext; - int i; - int start_offset, end_offset; - - edid_ext = drm_find_cea_extension(edid); - if (!edid_ext) - return false; - - if (cea_db_offsets(edid_ext, &start_offset, &end_offset)) - return false; + const struct cea_db *db; + struct cea_db_iter iter; + bool hdmi = false; /* * Because HDMI identifier is in Vendor Specific Block, * search it from all data blocks of CEA extension. */ - for_each_cea_db(edid_ext, i, start_offset, end_offset) { - if (cea_db_is_hdmi_vsdb(&edid_ext[i])) - return true; + cea_db_iter_edid_begin(edid, &iter); + cea_db_iter_for_each(db, &iter) { + if (cea_db_is_hdmi_vsdb(db)) { + hdmi = true; + break; + } } + cea_db_iter_end(&iter); - return false; + return hdmi; } EXPORT_SYMBOL(drm_detect_hdmi_monitor); |