Commit 23e38d7b authored by Jani Nikula's avatar Jani Nikula

drm/edid: simplify block check when filtering invalid blocks

There's no need to handle complicated scenarios or debug log when
filtering blocks that have already been identified as invalid. Simplify
by adding an edid_block_valid() helper that operates on const data and
prints nothing.

(Finally, here's the justification for the previously added separate
edid_block_status_valid() function!)

Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
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/aa25131c3454c7dbc1e8fdb46549f3787bdf6354.1648752228.git.jani.nikula@intel.com
parent 18d83450
...@@ -1714,6 +1714,12 @@ static bool edid_block_status_valid(enum edid_block_status status, int tag) ...@@ -1714,6 +1714,12 @@ static bool edid_block_status_valid(enum edid_block_status status, int tag)
(status == EDID_BLOCK_CHECKSUM && tag == CEA_EXT); (status == EDID_BLOCK_CHECKSUM && tag == CEA_EXT);
} }
static bool edid_block_valid(const void *block, bool base)
{
return edid_block_status_valid(edid_block_check(block, base),
edid_block_tag(block));
}
/** /**
* drm_edid_block_valid - Sanity check the EDID block (base or extension) * drm_edid_block_valid - Sanity check the EDID block (base or extension)
* @raw_edid: pointer to raw EDID block * @raw_edid: pointer to raw EDID block
...@@ -2080,7 +2086,7 @@ struct edid *drm_do_get_edid(struct drm_connector *connector, ...@@ -2080,7 +2086,7 @@ struct edid *drm_do_get_edid(struct drm_connector *connector,
for (i = 0; i <= edid->extensions; i++) { for (i = 0; i <= edid->extensions; i++) {
void *block = edid + i; void *block = edid + i;
if (!drm_edid_block_valid(block, i, false, NULL)) if (!edid_block_valid(block, i == 0))
continue; continue;
memcpy(dest_block, block, EDID_LENGTH); memcpy(dest_block, block, EDID_LENGTH);
......
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