summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJani Nikula <jani.nikula@intel.com>2022-04-11 17:00:32 +0300
committerJani Nikula <jani.nikula@intel.com>2022-04-14 16:51:50 +0300
commitd3da3f4072c82e5be5aaafd6168c8effdea1be19 (patch)
treed7ed7a72acaf7f80b5b7c3616a7865ebf7b4d37a
parentc12561ce43358ce59fc0f2275fc1853e24980908 (diff)
downloadlinux-d3da3f4072c82e5be5aaafd6168c8effdea1be19.tar.bz2
drm/edid: convert extension block read to EDID block read helper
Use the EDID block read helper also for extension block reads, making edid_block_read() the only place with the read retry logic. Note: We observe that drm_do_get_edid() does not use invalid extension blocks to flag the EDID as corrupt. 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/a6328b898db40235b85ad4635374bc0768b5a970.1649685475.git.jani.nikula@intel.com
-rw-r--r--drivers/gpu/drm/drm_edid.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
index d3951ac44f8f..202b54f95576 100644
--- a/drivers/gpu/drm/drm_edid.c
+++ b/drivers/gpu/drm/drm_edid.c
@@ -2143,17 +2143,16 @@ struct edid *drm_do_get_edid(struct drm_connector *connector,
for (j = 1; j <= edid->extensions; j++) {
void *block = edid + j;
- int try;
- for (try = 0; try < 4; try++) {
- if (read_block(context, block, j, EDID_LENGTH))
- goto out;
- if (drm_edid_block_valid(block, j, false, NULL))
- break;
- }
+ status = edid_block_read(block, j, read_block, context);
- if (try == 4)
+ edid_block_status_print(status, block, j);
+
+ if (!edid_block_status_valid(status, edid_block_tag(block))) {
+ if (status == EDID_BLOCK_READ_FAIL)
+ goto out;
invalid_blocks++;
+ }
}
if (invalid_blocks) {