Commit ab1747cc authored by Jani Nikula's avatar Jani Nikula

drm/edid: convert drm_for_each_detailed_block() to edid iter

We have an iterator for this, use it. It does include the base block,
but its tag is 0 and will be skipped.
Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
Reviewed-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/a68718819a3dbfbdaaaddca7f73afa5ac6b33d07.1652097712.git.jani.nikula@intel.com
parent be982415
...@@ -2574,6 +2574,8 @@ vtb_for_each_detailed_block(const u8 *ext, detailed_cb *cb, void *closure) ...@@ -2574,6 +2574,8 @@ vtb_for_each_detailed_block(const u8 *ext, detailed_cb *cb, void *closure)
static void static void
drm_for_each_detailed_block(const struct edid *edid, detailed_cb *cb, void *closure) drm_for_each_detailed_block(const struct edid *edid, detailed_cb *cb, void *closure)
{ {
struct drm_edid_iter edid_iter;
const u8 *ext;
int i; int i;
if (edid == NULL) if (edid == NULL)
...@@ -2582,9 +2584,8 @@ drm_for_each_detailed_block(const struct edid *edid, detailed_cb *cb, void *clos ...@@ -2582,9 +2584,8 @@ drm_for_each_detailed_block(const struct edid *edid, detailed_cb *cb, void *clos
for (i = 0; i < EDID_DETAILED_TIMINGS; i++) for (i = 0; i < EDID_DETAILED_TIMINGS; i++)
cb(&(edid->detailed_timings[i]), closure); cb(&(edid->detailed_timings[i]), closure);
for (i = 0; i < edid_extension_block_count(edid); i++) { drm_edid_iter_begin(edid, &edid_iter);
const u8 *ext = edid_extension_block_data(edid, i); drm_edid_iter_for_each(ext, &edid_iter) {
switch (*ext) { switch (*ext) {
case CEA_EXT: case CEA_EXT:
cea_for_each_detailed_block(ext, cb, closure); cea_for_each_detailed_block(ext, cb, closure);
...@@ -2596,6 +2597,7 @@ drm_for_each_detailed_block(const struct edid *edid, detailed_cb *cb, void *clos ...@@ -2596,6 +2597,7 @@ drm_for_each_detailed_block(const struct edid *edid, detailed_cb *cb, void *clos
break; break;
} }
} }
drm_edid_iter_end(&edid_iter);
} }
static void static void
......
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