[Intel-gfx] [PATCH] drm/i915: Support HDMI EDID injection

Daniel Vetter daniel at ffwll.ch
Thu Feb 11 09:07:34 UTC 2016


On Mon, Feb 01, 2016 at 06:35:33PM +0200, Marius Vlad wrote:
> Allow HDMI EDID injection by making a copy of edid_blob_ptr. When disconnecting
> the connector, or forcing a disconnect, the copy will free'd by intel_hdmi_unset_edid().
> 
> Signed-off-by: Marius Vlad <marius.c.vlad at intel.com>
> ---
>  drivers/gpu/drm/i915/intel_hdmi.c | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/drivers/gpu/drm/i915/intel_hdmi.c b/drivers/gpu/drm/i915/intel_hdmi.c
> index 8698a64..4725e8d1 100644
> --- a/drivers/gpu/drm/i915/intel_hdmi.c
> +++ b/drivers/gpu/drm/i915/intel_hdmi.c
> @@ -1355,6 +1355,16 @@ intel_hdmi_set_edid(struct drm_connector *connector, bool force)
>  				    intel_gmbus_get_adapter(dev_priv,
>  				    intel_hdmi->ddc_bus));
>  
> +		/* for injected EDIDs */
> +		if (!edid && connector->override_edid) {
> +			edid = kzalloc(connector->edid_blob_ptr->length,
> +					GFP_KERNEL);
> +			if (edid) {
> +				memcpy(edid, connector->edid_blob_ptr->data,
> +						connector->edid_blob_ptr->length);
> +			}
> +		}
> +

You're sure this does anything? When forcing the edid, ->detect isn't
called. And the problem with hdmi injection isn't the edid, but that our
audio detection code is wrong. See how has_audio is set in
intel_hdmi_set_edid is handled. Similarly we need to fixup the eld code to
correctly update drm_connector->eld.

Finally this needs a testcase which:
1. injects hdmi edid without audio, then sets mode.
2. injects hdmi edid with audio, then sets mode.
3. injects hdmi edid without audio, then sets mode.

Just to exercise the code paths. Bonus points if you check through alsa
that the hdmi audio state indeed matches our expectations (compare the eld
you can grab from alsa with what you injected to make sure you look at the
right screen).

But given all our other oustanding troubles around CI I'd suggest we
deprioritize this task for now. Please add this comment to JIRA so it
wont' get lost.
-Daniel

>  		intel_display_power_put(dev_priv, POWER_DOMAIN_GMBUS);
>  	}
>  
> -- 
> 2.5.0
> 

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch


More information about the Intel-gfx mailing list