Re: [PATCH RFC 1/5] drm/edid: Add support to get edid early

From: Jani Nikula
Date: Mon Aug 17 2015 - 03:49:34 EST


On Fri, 14 Aug 2015, Srinivas Kandagatla <srinivas.kandagatla@xxxxxxxxxx> wrote:
> This patch adds support to get edid way early before the connector is
> created, this is mainly used for panel drivers to auto-probe the panel
> based on the vendor and product id from EDID.
>
> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@xxxxxxxxxx>
> ---
> drivers/gpu/drm/drm_edid.c | 8 ++++++++
> include/drm/drm_crtc.h | 1 +
> 2 files changed, 9 insertions(+)
>
> diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
> index 7087da3..30359cd 100644
> --- a/drivers/gpu/drm/drm_edid.c
> +++ b/drivers/gpu/drm/drm_edid.c
> @@ -1388,6 +1388,14 @@ struct edid *drm_get_edid(struct drm_connector *connector,
> }
> EXPORT_SYMBOL(drm_get_edid);
>
> +struct edid *drm_get_edid_early(struct i2c_adapter *adapter)
> +{
> + struct drm_connector dummy_connector;
> +
> + return drm_get_edid(&dummy_connector, adapter);

This will oops the kernel on bad EDID.

BR,
Jani.


> +}
> +EXPORT_SYMBOL(drm_get_edid_early);
> +
> /**
> * drm_edid_duplicate - duplicate an EDID and the extensions
> * @edid: EDID to duplicate
> diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h
> index 57ca8cc..35d8763 100644
> --- a/include/drm/drm_crtc.h
> +++ b/include/drm/drm_crtc.h
> @@ -1330,6 +1330,7 @@ extern void drm_reinit_primary_mode_group(struct drm_device *dev);
> extern bool drm_probe_ddc(struct i2c_adapter *adapter);
> extern struct edid *drm_get_edid(struct drm_connector *connector,
> struct i2c_adapter *adapter);
> +extern struct edid *drm_get_edid_early(struct i2c_adapter *adapter);
> extern struct edid *drm_edid_duplicate(const struct edid *edid);
> extern int drm_add_edid_modes(struct drm_connector *connector, struct edid *edid);
> extern void drm_mode_config_init(struct drm_device *dev);
> --
> 1.9.1
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@xxxxxxxxxxxxxxxxxxxxx
> http://lists.freedesktop.org/mailman/listinfo/dri-devel

--
Jani Nikula, Intel Open Source Technology Center
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/