Commit 3a4a2ea3 authored by Tomas Bzatek's avatar Tomas Bzatek Committed by Dave Airlie

drm/displayid: Iterate over all DisplayID blocks

This will iterate over all DisplayID blocks found in the buffer.
Previously only the first block was parsed.

https://bugs.freedesktop.org/show_bug.cgi?id=95207Signed-off-by: default avatarTomas Bzatek <tomas@bzatek.net>
Reviewed-by: default avatarJani Nikula <jani.nikula@intel.com>
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
parent 5e546cd5
...@@ -4237,19 +4237,25 @@ static int drm_parse_display_id(struct drm_connector *connector, ...@@ -4237,19 +4237,25 @@ static int drm_parse_display_id(struct drm_connector *connector,
return -EINVAL; return -EINVAL;
} }
block = (struct displayid_block *)&displayid[idx + 4]; idx += sizeof(struct displayid_hdr);
DRM_DEBUG_KMS("block id %d, rev %d, len %d\n", while (block = (struct displayid_block *)&displayid[idx],
block->tag, block->rev, block->num_bytes); idx + sizeof(struct displayid_block) <= length &&
idx + sizeof(struct displayid_block) + block->num_bytes <= length &&
switch (block->tag) { block->num_bytes > 0) {
case DATA_BLOCK_TILED_DISPLAY: idx += block->num_bytes + sizeof(struct displayid_block);
ret = drm_parse_tiled_block(connector, block); DRM_DEBUG_KMS("block id 0x%x, rev %d, len %d\n",
if (ret) block->tag, block->rev, block->num_bytes);
return ret;
break; switch (block->tag) {
default: case DATA_BLOCK_TILED_DISPLAY:
printk("unknown displayid tag %d\n", block->tag); ret = drm_parse_tiled_block(connector, block);
break; if (ret)
return ret;
break;
default:
DRM_DEBUG_KMS("found DisplayID tag 0x%x, unhandled\n", block->tag);
break;
}
} }
return 0; return 0;
} }
......
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