summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/drm_edid.c
diff options
context:
space:
mode:
authorJani Nikula <jani.nikula@intel.com>2021-03-29 16:37:20 +0300
committerJani Nikula <jani.nikula@intel.com>2021-03-31 15:42:02 +0300
commitbfd4e1929b5a37dba838c82484e6d8260585ce9d (patch)
tree457f95ed61b39e7c36c30af6ae382e7eb13e7704 /drivers/gpu/drm/drm_edid.c
parent1ba63caf223d9eaed854f978d9fed860259d02e3 (diff)
downloadlinux-bfd4e1929b5a37dba838c82484e6d8260585ce9d.tar.bz2
drm/edid: use the new displayid iterator for tile info
Neatly reduce displayid boilerplate in code. Remove excessive debug logging while at it, no other functional changes. The old displayid iterator becomes unused; remove it as well as make drm_find_displayid_extension() static. Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Signed-off-by: Jani Nikula <jani.nikula@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/fa4b5c790b5bdd82063545a6f209f8e9d78a63a7.1617024940.git.jani.nikula@intel.com
Diffstat (limited to 'drivers/gpu/drm/drm_edid.c')
-rw-r--r--drivers/gpu/drm/drm_edid.c37
1 files changed, 7 insertions, 30 deletions
diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
index 4526e2557dca..81d5f2524246 100644
--- a/drivers/gpu/drm/drm_edid.c
+++ b/drivers/gpu/drm/drm_edid.c
@@ -5969,43 +5969,20 @@ static void drm_parse_tiled_block(struct drm_connector *connector,
}
}
-static void drm_displayid_parse_tiled(struct drm_connector *connector,
- const u8 *displayid, int length, int idx)
-{
- const struct displayid_block *block;
-
- idx += sizeof(struct displayid_hdr);
- for_each_displayid_db(displayid, block, idx, length) {
- DRM_DEBUG_KMS("block id 0x%x, rev %d, len %d\n",
- block->tag, block->rev, block->num_bytes);
-
- switch (block->tag) {
- case DATA_BLOCK_TILED_DISPLAY:
- drm_parse_tiled_block(connector, block);
- break;
- default:
- DRM_DEBUG_KMS("found DisplayID tag 0x%x, unhandled\n", block->tag);
- break;
- }
- }
-}
-
void drm_update_tile_info(struct drm_connector *connector,
const struct edid *edid)
{
- const void *displayid = NULL;
- int ext_index = 0;
- int length, idx;
+ const struct displayid_block *block;
+ struct displayid_iter iter;
connector->has_tile = false;
- for (;;) {
- displayid = drm_find_displayid_extension(edid, &length, &idx,
- &ext_index);
- if (!displayid)
- break;
- drm_displayid_parse_tiled(connector, displayid, length, idx);
+ displayid_iter_edid_begin(edid, &iter);
+ displayid_iter_for_each(block, &iter) {
+ if (block->tag == DATA_BLOCK_TILED_DISPLAY)
+ drm_parse_tiled_block(connector, block);
}
+ displayid_iter_end(&iter);
if (!connector->has_tile && connector->tile_group) {
drm_mode_put_tile_group(connector->dev, connector->tile_group);