On Mon, 13 Jul 2026, Timo Prömer <[email protected]> wrote: > From: Timoyoungster <[email protected]> > > Drivers currently calculating EDID size by reading the `extensions` > field of the raw EDID structure (e.g., `edid->extensions + 1`) will > calculate the wrong size if the EDID contains an HF-EEODB (HDMI Forum > EDID Extension Override Data Block). The base extension flag does not > account for these override blocks, leading to truncated EDIDs. > > Remove the static declaration and export drm_edid_block_count() so > drivers can safely query the true block count. This allows drivers to > leverage the core DRM's proper handling of HF-EEODB and other edge > cases without having to parse the raw EDID fields themselves. > > Signed-off-by: Timo Prömer <[email protected]> > --- > drivers/gpu/drm/drm_edid.c | 3 ++- > include/drm/drm_edid.h | 1 + > 2 files changed, 3 insertions(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c > index df3c25bac..34560b33a 100644 > --- a/drivers/gpu/drm/drm_edid.c > +++ b/drivers/gpu/drm/drm_edid.c > @@ -1698,12 +1698,13 @@ static int __drm_edid_block_count(const struct > drm_edid *drm_edid) > } > > /* EDID block count, limited by allocated size */ > -static int drm_edid_block_count(const struct drm_edid *drm_edid) > +int drm_edid_block_count(const struct drm_edid *drm_edid) > { > /* Limit by allocated size */ > return min(__drm_edid_block_count(drm_edid), > (int)drm_edid->size / EDID_LENGTH); > } > +EXPORT_SYMBOL(drm_edid_block_count);
Not everything that's inside drm_edid.c is supposed to be looked into. It's abstracted and hidden for a reason. Please don't hack into this. BR, Jani. > > /* EDID extension block count, limited by allocated size */ > static int drm_edid_extension_block_count(const struct drm_edid *drm_edid) > diff --git a/include/drm/drm_edid.h b/include/drm/drm_edid.h > index 04f7a7f1f..4a990bf87 100644 > --- a/include/drm/drm_edid.h > +++ b/include/drm/drm_edid.h > @@ -481,6 +481,7 @@ const struct drm_edid *drm_edid_read_switcheroo(struct > drm_connector *connector, > int drm_edid_connector_update(struct drm_connector *connector, > const struct drm_edid *edid); > int drm_edid_connector_add_modes(struct drm_connector *connector); > +int drm_edid_block_count(const struct drm_edid *drm_edid); > bool drm_edid_is_digital(const struct drm_edid *drm_edid); > void drm_edid_get_product_id(const struct drm_edid *drm_edid, > struct drm_edid_product_id *id); -- Jani Nikula, Intel
