All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/edid: Try harder to fix up base EDID blocks
@ 2012-04-16 14:40 Adam Jackson
  2012-04-24 18:56 ` Adam Jackson
  2012-04-24 19:13 ` Chris Wilson
  0 siblings, 2 replies; 4+ messages in thread
From: Adam Jackson @ 2012-04-16 14:40 UTC (permalink / raw)
  To: dri-devel

Requiring the first byte of the EDID base block header to be 0 means we
don't fix up as many transfer errors as we could.  Instead have the
callers specify whether it's meant to be block 0 or not, and
conditionally run header fixup based on that.

Bugzilla: https://bugzilla.redhat.com/812890
Signed-off-by: Adam Jackson <ajax@redhat.com>
---
 drivers/gpu/drm/drm_edid.c |   10 +++++-----
 include/drm/drm_crtc.h     |    2 +-
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
index 5a18b0d..43aecd8 100644
--- a/drivers/gpu/drm/drm_edid.c
+++ b/drivers/gpu/drm/drm_edid.c
@@ -149,13 +149,13 @@ EXPORT_SYMBOL(drm_edid_header_is_valid);
  * Sanity check the EDID block (base or extension).  Return 0 if the block
  * doesn't check out, or 1 if it's valid.
  */
-bool drm_edid_block_valid(u8 *raw_edid)
+bool drm_edid_block_valid(u8 *raw_edid, int block)
 {
 	int i;
 	u8 csum = 0;
 	struct edid *edid = (struct edid *)raw_edid;
 
-	if (raw_edid[0] == 0x00) {
+	if (block == 0) {
 		int score = drm_edid_header_is_valid(raw_edid);
 		if (score == 8) ;
 		else if (score >= 6) {
@@ -219,7 +219,7 @@ bool drm_edid_is_valid(struct edid *edid)
 		return false;
 
 	for (i = 0; i <= edid->extensions; i++)
-		if (!drm_edid_block_valid(raw + i * EDID_LENGTH))
+		if (!drm_edid_block_valid(raw + i * EDID_LENGTH, i))
 			return false;
 
 	return true;
@@ -299,7 +299,7 @@ drm_do_get_edid(struct drm_connector *connector, struct i2c_adapter *adapter)
 	for (i = 0; i < 4; i++) {
 		if (drm_do_probe_ddc_edid(adapter, block, 0, EDID_LENGTH))
 			goto out;
-		if (drm_edid_block_valid(block))
+		if (drm_edid_block_valid(block, 0))
 			break;
 		if (i == 0 && drm_edid_is_zero(block, EDID_LENGTH)) {
 			connector->null_edid_counter++;
@@ -324,7 +324,7 @@ drm_do_get_edid(struct drm_connector *connector, struct i2c_adapter *adapter)
 				  block + (valid_extensions + 1) * EDID_LENGTH,
 				  j, EDID_LENGTH))
 				goto out;
-			if (drm_edid_block_valid(block + (valid_extensions + 1) * EDID_LENGTH)) {
+			if (drm_edid_block_valid(block + (valid_extensions + 1) * EDID_LENGTH, j)) {
 				valid_extensions++;
 				break;
 			}
diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h
index e250eda..a3180f7 100644
--- a/include/drm/drm_crtc.h
+++ b/include/drm/drm_crtc.h
@@ -1012,7 +1012,7 @@ extern int drm_add_modes_noedid(struct drm_connector *connector,
 				int hdisplay, int vdisplay);
 
 extern int drm_edid_header_is_valid(const u8 *raw_edid);
-extern bool drm_edid_block_valid(u8 *raw_edid);
+extern bool drm_edid_block_valid(u8 *raw_edid, int block);
 extern bool drm_edid_is_valid(struct edid *edid);
 struct drm_display_mode *drm_mode_find_dmt(struct drm_device *dev,
 					   int hsize, int vsize, int fresh);
-- 
1.7.7.6

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

* Re: [PATCH] drm/edid: Try harder to fix up base EDID blocks
  2012-04-16 14:40 [PATCH] drm/edid: Try harder to fix up base EDID blocks Adam Jackson
@ 2012-04-24 18:56 ` Adam Jackson
  2012-04-24 19:09   ` Alex Deucher
  2012-04-24 19:13 ` Chris Wilson
  1 sibling, 1 reply; 4+ messages in thread
From: Adam Jackson @ 2012-04-24 18:56 UTC (permalink / raw)
  To: dri-devel

On 4/16/12 10:40 AM, Adam Jackson wrote:
> Requiring the first byte of the EDID base block header to be 0 means we
> don't fix up as many transfer errors as we could.  Instead have the
> callers specify whether it's meant to be block 0 or not, and
> conditionally run header fixup based on that.

Anybody?  This appears to be a pretty common form of EDID corruption.

- ajax

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

* Re: [PATCH] drm/edid: Try harder to fix up base EDID blocks
  2012-04-24 18:56 ` Adam Jackson
@ 2012-04-24 19:09   ` Alex Deucher
  0 siblings, 0 replies; 4+ messages in thread
From: Alex Deucher @ 2012-04-24 19:09 UTC (permalink / raw)
  To: Adam Jackson; +Cc: dri-devel

On Tue, Apr 24, 2012 at 2:56 PM, Adam Jackson <ajax@redhat.com> wrote:
> On 4/16/12 10:40 AM, Adam Jackson wrote:
>>
>> Requiring the first byte of the EDID base block header to be 0 means we
>> don't fix up as many transfer errors as we could.  Instead have the
>> callers specify whether it's meant to be block 0 or not, and
>> conditionally run header fixup based on that.
>
>
> Anybody?  This appears to be a pretty common form of EDID corruption.

Seems reasonable to me.

Reviewed-by: Alex Deucher <alexdeucher@gmail.com>

>
> - ajax
>
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* Re: [PATCH] drm/edid: Try harder to fix up base EDID blocks
  2012-04-16 14:40 [PATCH] drm/edid: Try harder to fix up base EDID blocks Adam Jackson
  2012-04-24 18:56 ` Adam Jackson
@ 2012-04-24 19:13 ` Chris Wilson
  1 sibling, 0 replies; 4+ messages in thread
From: Chris Wilson @ 2012-04-24 19:13 UTC (permalink / raw)
  To: Adam Jackson, dri-devel

On Mon, 16 Apr 2012 10:40:08 -0400, Adam Jackson <ajax@redhat.com> wrote:
> Requiring the first byte of the EDID base block header to be 0 means we
> don't fix up as many transfer errors as we could.  Instead have the
> callers specify whether it's meant to be block 0 or not, and
> conditionally run header fixup based on that.
> 
> Bugzilla: https://bugzilla.redhat.com/812890
> Signed-off-by: Adam Jackson <ajax@redhat.com>

The patch does watch it says on the tin. I don't pretend to know how
frequent this corruption is, but as it stands the current code fails to
be as effective as it could be.

Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre

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

end of thread, other threads:[~2012-04-24 19:14 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-16 14:40 [PATCH] drm/edid: Try harder to fix up base EDID blocks Adam Jackson
2012-04-24 18:56 ` Adam Jackson
2012-04-24 19:09   ` Alex Deucher
2012-04-24 19:13 ` Chris Wilson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.