diff mbox

drm/edid: Don't print an error if the checksum of a CEA block is wrong

Message ID 1481202716-31317-1-git-send-email-tomeu.vizoso@collabora.com (mailing list archive)
State New, archived
Headers show

Commit Message

Tomeu Vizoso Dec. 8, 2016, 1:11 p.m. UTC
It's common to share screens within CI labs, and it's also common for
KVM switches to alter the contents of the CEA block but leave the
checksum outdated.

So in this case, print a debug message instead of an error.

References: https://bugs.freedesktop.org/show_bug.cgi?id=98228
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Tomi Sarvela <tomi.p.sarvela@intel.com>
Cc: intel-gfx@lists.freedesktop.org
Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
---
 drivers/gpu/drm/drm_edid.c | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

Comments

Daniel Vetter Feb. 8, 2017, 1:32 p.m. UTC | #1
On Wed, Feb 08, 2017 at 01:19:23PM +0000, Tahvanainen, Jari wrote:
> I applied this change on the couple-days old drm-tip, and was not able to get any "EDID checksum is invalid" messages with it on my SKL. Without this patch I could generate the ERROR quite easily by switching the outputs and displays manually.
> I don't know if this hides something that it should not but it seem to work for the problem related the noise on Patchwork CI execution caused by these EDID checksum is invalid messages.
> 
> Tested-by: Jari Tahvanainen <jari.tahvanainen@intel.com>
> 
> -----Original Message-----
> From: Tomeu Vizoso [mailto:tomeu.vizoso@collabora.com] 
> Sent: Thursday, December 8, 2016 3:12 PM
> To: linux-kernel@vger.kernel.org
> Cc: Tomeu Vizoso <tomeu.vizoso@collabora.com>; Tomi Sarvela <tomi.p.sarvela@intel.com>; intel-gfx@lists.freedesktop.org; David Airlie <airlied@linux.ie>; dri-devel@lists.freedesktop.org; Daniel Vetter <daniel.vetter@intel.com>
> Subject: drm/edid: Don't print an error if the checksum of a CEA block is wrong
> 
> It's common to share screens within CI labs, and it's also common for KVM switches to alter the contents of the CEA block but leave the checksum outdated.
> 
> So in this case, print a debug message instead of an error.
> 
> References: https://bugs.freedesktop.org/show_bug.cgi?id=98228
> Cc: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Tomi Sarvela <tomi.p.sarvela@intel.com>
> Cc: intel-gfx@lists.freedesktop.org
> Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>

Applied to drm-misc, thanks.
-Daniel

> ---
>  drivers/gpu/drm/drm_edid.c | 13 ++++++++-----
>  1 file changed, 8 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c index 6798c3ad9d53..db79bc949216 100644
> --- a/drivers/gpu/drm/drm_edid.c
> +++ b/drivers/gpu/drm/drm_edid.c
> @@ -1128,16 +1128,19 @@ bool drm_edid_block_valid(u8 *raw_edid, int block, bool print_bad_edid,
>  
>  	csum = drm_edid_block_checksum(raw_edid);
>  	if (csum) {
> -		if (print_bad_edid) {
> -			DRM_ERROR("EDID checksum is invalid, remainder is %d\n", csum);
> -		}
> -
>  		if (edid_corrupt)
>  			*edid_corrupt = true;
>  
>  		/* allow CEA to slide through, switches mangle this */
> -		if (raw_edid[0] != 0x02)
> +		if (raw_edid[0] == CEA_EXT) {
> +			DRM_DEBUG("EDID checksum is invalid, remainder is %d\n", csum);
> +			DRM_DEBUG("Assuming a KVM switch modified the CEA block but left the original checksum\n");
> +		} else {
> +			if (print_bad_edid)
> +				DRM_ERROR("EDID checksum is invalid, remainder is %d\n", csum);
> +
>  			goto bad;
> +		}
>  	}
>  
>  	/* per-block-type checks */
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
diff mbox

Patch

diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
index 6798c3ad9d53..db79bc949216 100644
--- a/drivers/gpu/drm/drm_edid.c
+++ b/drivers/gpu/drm/drm_edid.c
@@ -1128,16 +1128,19 @@  bool drm_edid_block_valid(u8 *raw_edid, int block, bool print_bad_edid,
 
 	csum = drm_edid_block_checksum(raw_edid);
 	if (csum) {
-		if (print_bad_edid) {
-			DRM_ERROR("EDID checksum is invalid, remainder is %d\n", csum);
-		}
-
 		if (edid_corrupt)
 			*edid_corrupt = true;
 
 		/* allow CEA to slide through, switches mangle this */
-		if (raw_edid[0] != 0x02)
+		if (raw_edid[0] == CEA_EXT) {
+			DRM_DEBUG("EDID checksum is invalid, remainder is %d\n", csum);
+			DRM_DEBUG("Assuming a KVM switch modified the CEA block but left the original checksum\n");
+		} else {
+			if (print_bad_edid)
+				DRM_ERROR("EDID checksum is invalid, remainder is %d\n", csum);
+
 			goto bad;
+		}
 	}
 
 	/* per-block-type checks */