Commit 0ac57ca3 authored by Jani Nikula's avatar Jani Nikula

drm/edid: avoid drm_edid_find_extension() internally

Prefer the EDID iterators over drm_edid_find_extension() in
drm_edid_has_cta_extension(), even if this leads to more code. The key
is to use the same patterns as much as possible.
Reviewed-by: default avatarThomas Zimmermann <tzimmermann@suse.de>
Link: https://patchwork.freedesktop.org/patch/msgid/9fa366147b06a28304527be48f1b363c3484c8a3.1713259151.git.jani.nikula@intel.comSigned-off-by: default avatarJani Nikula <jani.nikula@intel.com>
parent 64ac4a14
......@@ -4230,11 +4230,21 @@ static bool drm_edid_has_cta_extension(const struct drm_edid *drm_edid)
{
const struct displayid_block *block;
struct displayid_iter iter;
int ext_index = 0;
struct drm_edid_iter edid_iter;
const u8 *ext;
bool found = false;
/* Look for a top level CEA extension block */
if (drm_edid_find_extension(drm_edid, CEA_EXT, &ext_index))
drm_edid_iter_begin(drm_edid, &edid_iter);
drm_edid_iter_for_each(ext, &edid_iter) {
if (ext[0] == CEA_EXT) {
found = true;
break;
}
}
drm_edid_iter_end(&edid_iter);
if (found)
return true;
/* CEA blocks can also be found embedded in a DisplayID block */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment