EXPORT_SYMBOL(drm_edid_is_valid);
static struct edid *edid_filter_invalid_blocks(const struct edid *edid,
- int valid_extensions)
+ int invalid_blocks)
{
struct edid *new, *dest_block;
+ int valid_extensions = edid->extensions - invalid_blocks;
int i;
new = kmalloc_array(valid_extensions + 1, EDID_LENGTH, GFP_KERNEL);
size_t len),
void *data)
{
- int j, valid_extensions = 0;
+ int j, invalid_blocks = 0;
struct edid *edid, *new, *override;
override = drm_get_override_edid(connector);
if (!edid)
return NULL;
- /* if there's no extensions or no connector, we're done */
- valid_extensions = edid->extensions;
- if (valid_extensions == 0)
+ if (edid->extensions == 0)
return edid;
- new = krealloc(edid, (valid_extensions + 1) * EDID_LENGTH, GFP_KERNEL);
+ new = krealloc(edid, (edid->extensions + 1) * EDID_LENGTH, GFP_KERNEL);
if (!new)
goto out;
edid = new;
}
if (try == 4)
- valid_extensions--;
+ invalid_blocks++;
}
- if (valid_extensions != edid->extensions) {
+ if (invalid_blocks) {
connector_bad_edid(connector, (u8 *)edid, edid->extensions + 1);
- edid = edid_filter_invalid_blocks(edid, valid_extensions);
+ edid = edid_filter_invalid_blocks(edid, invalid_blocks);
}
return edid;