drm/i915: Support HDMI EDID injection
diff mbox

Message ID 1487227398-8931-1-git-send-email-abdiel.janulgue@linux.intel.com
State New
Headers show

Commit Message

Abdiel Janulgue Feb. 16, 2017, 6:43 a.m. UTC
From: marius vlad <marius.c.vlad@intel.com>

Make a copy of drm_property_blob data for user-supplied EDID blobs.

Signed-off-by: Abdiel Janulgue <abdiel.janulgue@linux.intel.com>
Signed-off-by: Marius Vlad <marius.c.vlad@intel.com>
---
 drivers/gpu/drm/i915/intel_hdmi.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

Comments

Jani Nikula Feb. 16, 2017, 10:39 a.m. UTC | #1
On Thu, 16 Feb 2017, Abdiel Janulgue <abdiel.janulgue@linux.intel.com> wrote:
> From: marius vlad <marius.c.vlad@intel.com>
>
> Make a copy of drm_property_blob data for user-supplied EDID blobs.

I'd like to stop this approach from spreading by handling the EDID
overrides at a lower level [1]. Otherwise, we'll fill all drivers with
special casing.


BR,
Jani.


[1] https://patchwork.freedesktop.org/series/19764/

> Signed-off-by: Abdiel Janulgue <abdiel.janulgue@linux.intel.com>
> Signed-off-by: Marius Vlad <marius.c.vlad@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 a580de8..76b8023 100644
> --- a/drivers/gpu/drm/i915/intel_hdmi.c
> +++ b/drivers/gpu/drm/i915/intel_hdmi.c
> @@ -1463,6 +1463,16 @@ intel_hdmi_set_edid(struct drm_connector *connector)
>  			    intel_gmbus_get_adapter(dev_priv,
>  			    intel_hdmi->ddc_bus));
>  
> +	/*
> +	 * Use the user-supplied EDID blob in case we don't have an
> +	 * EDID from the display.
> +	 */
> +	if (!edid && connector->override_edid) {
> +		edid = kmemdup(connector->edid_blob_ptr->data,
> +			       connector->edid_blob_ptr->length,
> +			       GFP_KERNEL);
> +	}
> +
>  	intel_hdmi_dp_dual_mode_detect(connector, edid != NULL);
>  
>  	intel_display_power_put(dev_priv, POWER_DOMAIN_GMBUS);

Patch
diff mbox

diff --git a/drivers/gpu/drm/i915/intel_hdmi.c b/drivers/gpu/drm/i915/intel_hdmi.c
index a580de8..76b8023 100644
--- a/drivers/gpu/drm/i915/intel_hdmi.c
+++ b/drivers/gpu/drm/i915/intel_hdmi.c
@@ -1463,6 +1463,16 @@  intel_hdmi_set_edid(struct drm_connector *connector)
 			    intel_gmbus_get_adapter(dev_priv,
 			    intel_hdmi->ddc_bus));
 
+	/*
+	 * Use the user-supplied EDID blob in case we don't have an
+	 * EDID from the display.
+	 */
+	if (!edid && connector->override_edid) {
+		edid = kmemdup(connector->edid_blob_ptr->data,
+			       connector->edid_blob_ptr->length,
+			       GFP_KERNEL);
+	}
+
 	intel_hdmi_dp_dual_mode_detect(connector, edid != NULL);
 
 	intel_display_power_put(dev_priv, POWER_DOMAIN_GMBUS);