intel-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/i915: Support HDMI EDID injection
@ 2016-02-02 13:01 Marius Vlad
  2016-02-02 13:18 ` ✓ Fi.CI.BAT: success for " Patchwork
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Marius Vlad @ 2016-02-02 13:01 UTC (permalink / raw)
  To: intel-gfx

Use the drm_property_blob data for user-supplied EDID blobs.

Signed-off-by: Marius Vlad <marius.c.vlad@intel.com>
---
 drivers/gpu/drm/i915/intel_hdmi.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/intel_hdmi.c b/drivers/gpu/drm/i915/intel_hdmi.c
index 8698a64..a10f3d9 100644
--- a/drivers/gpu/drm/i915/intel_hdmi.c
+++ b/drivers/gpu/drm/i915/intel_hdmi.c
@@ -1336,7 +1336,8 @@ intel_hdmi_unset_edid(struct drm_connector *connector)
 	intel_hdmi->has_audio = false;
 	intel_hdmi->rgb_quant_range_selectable = false;
 
-	kfree(to_intel_connector(connector)->detect_edid);
+	if (!connector->override_edid)
+		kfree(to_intel_connector(connector)->detect_edid);
 	to_intel_connector(connector)->detect_edid = NULL;
 }
 
@@ -1355,6 +1356,9 @@ intel_hdmi_set_edid(struct drm_connector *connector, bool force)
 				    intel_gmbus_get_adapter(dev_priv,
 				    intel_hdmi->ddc_bus));
 
+		if (!edid && connector->override_edid)
+			edid = (struct edid *) connector->edid_blob_ptr->data;
+
 		intel_display_power_put(dev_priv, POWER_DOMAIN_GMBUS);
 	}
 
-- 
2.7.0.rc3

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* ✓ Fi.CI.BAT: success for drm/i915: Support HDMI EDID injection
  2016-02-02 13:01 [PATCH] drm/i915: Support HDMI EDID injection Marius Vlad
@ 2016-02-02 13:18 ` Patchwork
  2016-02-02 15:32 ` [PATCH] " Jani Nikula
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: Patchwork @ 2016-02-02 13:18 UTC (permalink / raw)
  To: marius vlad; +Cc: intel-gfx

== Summary ==

Series 3007v1 drm/i915: Support HDMI EDID injection
http://patchwork.freedesktop.org/api/1.0/series/3007/revisions/1/mbox/

Test kms_pipe_crc_basic:
        Subgroup read-crc-pipe-b-frame-sequence:
                dmesg-warn -> PASS       (skl-i5k-2)
        Subgroup suspend-read-crc-pipe-b:
                dmesg-warn -> PASS       (byt-nuc)

bdw-ultra        total:159  pass:147  dwarn:0   dfail:0   fail:0   skip:12 
bsw-nuc-2        total:159  pass:129  dwarn:0   dfail:0   fail:0   skip:30 
byt-nuc          total:159  pass:136  dwarn:0   dfail:0   fail:0   skip:23 
hsw-brixbox      total:159  pass:146  dwarn:0   dfail:0   fail:0   skip:13 
hsw-gt2          total:159  pass:149  dwarn:0   dfail:0   fail:0   skip:10 
ilk-hp8440p      total:159  pass:111  dwarn:0   dfail:0   fail:0   skip:48 
ivb-t430s        total:159  pass:145  dwarn:0   dfail:0   fail:0   skip:14 
skl-i5k-2        total:159  pass:144  dwarn:1   dfail:0   fail:0   skip:14 
snb-dellxps      total:159  pass:137  dwarn:0   dfail:0   fail:0   skip:22 

Results at /archive/results/CI_IGT_test/Patchwork_1341/

5d3deb0902a962218ad9b0e583e4d1bbdec29f9a drm-intel-nightly: 2016y-02m-01d-20h-05m-03s UTC integration manifest
d1a2abdb37d35bee0cfba298bdef41b320771486 drm/i915: Support HDMI EDID injection

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] drm/i915: Support HDMI EDID injection
  2016-02-02 13:01 [PATCH] drm/i915: Support HDMI EDID injection Marius Vlad
  2016-02-02 13:18 ` ✓ Fi.CI.BAT: success for " Patchwork
@ 2016-02-02 15:32 ` Jani Nikula
  2016-02-02 16:00   ` Marius Vlad
  2016-02-03 16:49 ` [PATCH v2] " Marius Vlad
  2016-02-03 17:15 ` ✗ Fi.CI.BAT: warning for drm/i915: Support HDMI EDID injection (rev2) Patchwork
  3 siblings, 1 reply; 6+ messages in thread
From: Jani Nikula @ 2016-02-02 15:32 UTC (permalink / raw)
  To: Marius Vlad, intel-gfx

On Tue, 02 Feb 2016, Marius Vlad <marius.c.vlad@intel.com> wrote:
> Use the drm_property_blob data for user-supplied EDID blobs.
>
> Signed-off-by: Marius Vlad <marius.c.vlad@intel.com>
> ---
>  drivers/gpu/drm/i915/intel_hdmi.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_hdmi.c b/drivers/gpu/drm/i915/intel_hdmi.c
> index 8698a64..a10f3d9 100644
> --- a/drivers/gpu/drm/i915/intel_hdmi.c
> +++ b/drivers/gpu/drm/i915/intel_hdmi.c
> @@ -1336,7 +1336,8 @@ intel_hdmi_unset_edid(struct drm_connector *connector)
>  	intel_hdmi->has_audio = false;
>  	intel_hdmi->rgb_quant_range_selectable = false;
>  
> -	kfree(to_intel_connector(connector)->detect_edid);
> +	if (!connector->override_edid)
> +		kfree(to_intel_connector(connector)->detect_edid);
>  	to_intel_connector(connector)->detect_edid = NULL;
>  }
>  
> @@ -1355,6 +1356,9 @@ intel_hdmi_set_edid(struct drm_connector *connector, bool force)
>  				    intel_gmbus_get_adapter(dev_priv,
>  				    intel_hdmi->ddc_bus));
>  
> +		if (!edid && connector->override_edid)
> +			edid = (struct edid *) connector->edid_blob_ptr->data;
> +

If the user goes on to update the edid by hand, ->detect_edid will end
up pointing at released memory. You should probably kmemdup the edid
(like some other drivers do, git grep for edid_blob_ptr), even though
that will lead to using a stale edid until intel_hdmi_set_edid is called
again.

The other question is, why do you base the decision to use override edid
on whether we can get the actual edid or not?

/me thinks this is all really messy at the drm level, including the
handling of edid firmware.

BR,
Jani.



>  		intel_display_power_put(dev_priv, POWER_DOMAIN_GMBUS);
>  	}

-- 
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] drm/i915: Support HDMI EDID injection
  2016-02-02 15:32 ` [PATCH] " Jani Nikula
@ 2016-02-02 16:00   ` Marius Vlad
  0 siblings, 0 replies; 6+ messages in thread
From: Marius Vlad @ 2016-02-02 16:00 UTC (permalink / raw)
  To: Jani Nikula; +Cc: intel-gfx


[-- Attachment #1.1: Type: text/plain, Size: 2686 bytes --]

On Tue, Feb 02, 2016 at 05:32:21PM +0200, Jani Nikula wrote:
> On Tue, 02 Feb 2016, Marius Vlad <marius.c.vlad@intel.com> wrote:
> > Use the drm_property_blob data for user-supplied EDID blobs.
> >
> > Signed-off-by: Marius Vlad <marius.c.vlad@intel.com>
> > ---
> >  drivers/gpu/drm/i915/intel_hdmi.c | 6 +++++-
> >  1 file changed, 5 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/gpu/drm/i915/intel_hdmi.c b/drivers/gpu/drm/i915/intel_hdmi.c
> > index 8698a64..a10f3d9 100644
> > --- a/drivers/gpu/drm/i915/intel_hdmi.c
> > +++ b/drivers/gpu/drm/i915/intel_hdmi.c
> > @@ -1336,7 +1336,8 @@ intel_hdmi_unset_edid(struct drm_connector *connector)
> >  	intel_hdmi->has_audio = false;
> >  	intel_hdmi->rgb_quant_range_selectable = false;
> >  
> > -	kfree(to_intel_connector(connector)->detect_edid);
> > +	if (!connector->override_edid)
> > +		kfree(to_intel_connector(connector)->detect_edid);
> >  	to_intel_connector(connector)->detect_edid = NULL;
> >  }
> >  
> > @@ -1355,6 +1356,9 @@ intel_hdmi_set_edid(struct drm_connector *connector, bool force)
> >  				    intel_gmbus_get_adapter(dev_priv,
> >  				    intel_hdmi->ddc_bus));
> >  
> > +		if (!edid && connector->override_edid)
> > +			edid = (struct edid *) connector->edid_blob_ptr->data;
> > +
> 
> If the user goes on to update the edid by hand, ->detect_edid will end
> up pointing at released memory. You should probably kmemdup the edid
> (like some other drivers do, git grep for edid_blob_ptr), even though
> that will lead to using a stale edid until intel_hdmi_set_edid is called
> again.

My initial approach was doing just that. Then I noticed I might get away
without doing any kind of allocations. I've some tests that work
both ways.

In intel_hdmi_unset_edid(), kfree(detect_edid) is only called when
connector->override_edid is not set, in this way it won't deallocate
random data.

> 
> The other question is, why do you base the decision to use override edid
> on whether we can get the actual edid or not?

In case edid is not set (failed to communicate with the display) and
the override_edid is set (which is set by edid_write() in drm_debugfs()
meaing a user supplied a EDID blob) I can assume that the user
did injected a HDMI EDID, and use data from drm_property_blob.

Seems to be the only place before looking for CEA extensions in HDMI
supplied EDID.

> 
> /me thinks this is all really messy at the drm level, including the
> handling of edid firmware.
> 
> BR,
> Jani.
> 
> 
> 
> >  		intel_display_power_put(dev_priv, POWER_DOMAIN_GMBUS);
> >  	}
> 
> -- 
> Jani Nikula, Intel Open Source Technology Center

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

[-- Attachment #2: Type: text/plain, Size: 159 bytes --]

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH v2] drm/i915: Support HDMI EDID injection
  2016-02-02 13:01 [PATCH] drm/i915: Support HDMI EDID injection Marius Vlad
  2016-02-02 13:18 ` ✓ Fi.CI.BAT: success for " Patchwork
  2016-02-02 15:32 ` [PATCH] " Jani Nikula
@ 2016-02-03 16:49 ` Marius Vlad
  2016-02-03 17:15 ` ✗ Fi.CI.BAT: warning for drm/i915: Support HDMI EDID injection (rev2) Patchwork
  3 siblings, 0 replies; 6+ messages in thread
From: Marius Vlad @ 2016-02-03 16:49 UTC (permalink / raw)
  To: intel-gfx

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

v2: Allocate and memcopy drm_property_blob->data instead of pointing
to it.

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 8698a64..4c9bb5f 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));
 
+		/*
+		 * 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_display_power_put(dev_priv, POWER_DOMAIN_GMBUS);
 	}
 
-- 
2.7.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* ✗ Fi.CI.BAT: warning for drm/i915: Support HDMI EDID injection (rev2)
  2016-02-02 13:01 [PATCH] drm/i915: Support HDMI EDID injection Marius Vlad
                   ` (2 preceding siblings ...)
  2016-02-03 16:49 ` [PATCH v2] " Marius Vlad
@ 2016-02-03 17:15 ` Patchwork
  3 siblings, 0 replies; 6+ messages in thread
From: Patchwork @ 2016-02-03 17:15 UTC (permalink / raw)
  To: marius vlad; +Cc: intel-gfx

== Summary ==

Series 3007v2 drm/i915: Support HDMI EDID injection
http://patchwork.freedesktop.org/api/1.0/series/3007/revisions/2/mbox/

Test kms_flip:
        Subgroup basic-flip-vs-modeset:
                pass       -> DMESG-WARN (skl-i7k-2)
Test kms_pipe_crc_basic:
        Subgroup nonblocking-crc-pipe-a-frame-sequence:
                pass       -> DMESG-WARN (skl-i7k-2)
        Subgroup nonblocking-crc-pipe-c-frame-sequence:
                dmesg-warn -> PASS       (skl-i7k-2)

bdw-nuci7        total:156  pass:147  dwarn:0   dfail:0   fail:0   skip:9  
bdw-ultra        total:159  pass:147  dwarn:0   dfail:0   fail:0   skip:12 
bsw-nuc-2        total:159  pass:131  dwarn:0   dfail:0   fail:0   skip:28 
byt-nuc          total:159  pass:136  dwarn:0   dfail:0   fail:0   skip:23 
hsw-brixbox      total:159  pass:146  dwarn:0   dfail:0   fail:0   skip:13 
hsw-gt2          total:159  pass:149  dwarn:0   dfail:0   fail:0   skip:10 
hsw-xps12        total:156  pass:146  dwarn:0   dfail:0   fail:0   skip:10 
ilk-hp8440p      total:159  pass:111  dwarn:0   dfail:0   fail:0   skip:48 
ivb-t430s        total:159  pass:145  dwarn:0   dfail:0   fail:0   skip:14 
skl-i7k-2        total:159  pass:142  dwarn:3   dfail:0   fail:0   skip:14 
snb-dellxps      total:159  pass:137  dwarn:0   dfail:0   fail:0   skip:22 
snb-x220t        total:159  pass:137  dwarn:0   dfail:0   fail:1   skip:21 

Results at /archive/results/CI_IGT_test/Patchwork_1358/

64800473a902f6b9033ed9b519585426cf6affa9 drm-intel-nightly: 2016y-02m-03d-14h-02m-22s UTC integration manifest
51fbf584278d89c72b2f4ca1851c71f16efeab90 drm/i915: Support HDMI EDID injection

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2016-02-03 17:15 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-02 13:01 [PATCH] drm/i915: Support HDMI EDID injection Marius Vlad
2016-02-02 13:18 ` ✓ Fi.CI.BAT: success for " Patchwork
2016-02-02 15:32 ` [PATCH] " Jani Nikula
2016-02-02 16:00   ` Marius Vlad
2016-02-03 16:49 ` [PATCH v2] " Marius Vlad
2016-02-03 17:15 ` ✗ Fi.CI.BAT: warning for drm/i915: Support HDMI EDID injection (rev2) Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).