From patchwork Thu Dec 8 13:11:56 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomeu Vizoso X-Patchwork-Id: 87256 Delivered-To: patch@linaro.org Received: by 10.140.20.101 with SMTP id 92csp836938qgi; Thu, 8 Dec 2016 05:13:23 -0800 (PST) X-Received: by 10.84.218.8 with SMTP id q8mr158191029pli.138.1481202803690; Thu, 08 Dec 2016 05:13:23 -0800 (PST) Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTPS id r77si28815465pfb.73.2016.12.08.05.13.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 08 Dec 2016 05:13:23 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) client-ip=131.252.210.177; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 46BFC6E773; Thu, 8 Dec 2016 13:12:51 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wj0-x241.google.com (mail-wj0-x241.google.com [IPv6:2a00:1450:400c:c01::241]) by gabe.freedesktop.org (Postfix) with ESMTPS id 2BBEE6E772; Thu, 8 Dec 2016 13:12:49 +0000 (UTC) Received: by mail-wj0-x241.google.com with SMTP id he10so40248585wjc.2; Thu, 08 Dec 2016 05:12:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id; bh=+iegW3MCfhOTnG+MJXzn+fnYYBJZhD2R6eADYZwi5+M=; b=tpcHDB8VA9aKyJkR4YqXSx5jTmtWPxm4V7ILWEEhAUwwzgyhKakfZdVlpa7vaWWyqD iXj7W1CURjBeZVuOAPteZEMieslYbATfvl88qbmxqTz+DBuXu0DX8uVr2jCcMdqwq2eu spPjApapkxEtrynqQB8BIpKdCouJEPaJtYZFF5hOidCmTIQYGH4S3seQU7bKyYi4qFdc jSYO1igxc4gk61xZYdo+P3iERcgrIAFS2bhNfatSNRrMq/ynjDq4CMJd+b+vgczA6Hiz PYLZXuMN2h+VKUn6FspLApGdmRPKJNE/bh8SkXR/zcTpxsqggDEMZJQ7HDzx/mn8/+V/ a8bw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id; bh=+iegW3MCfhOTnG+MJXzn+fnYYBJZhD2R6eADYZwi5+M=; b=FQz6tUcJytNAMyXDWrPLb640b/9Dw2MByw8wUWZBhIt10ihMNTZvNtDjB7FPkfzaK0 WuhSV2Zd/5gzepnpGgYWiPsvtOORS4ZmIQE1Um/6Ye4yzwEpKt3mWQO2uoh8Ju/7alYG vDh+/5t32ja8BIZtTvkZsXnasaPDEe+SsntkZGZZ50CbKsLmSTyo/pIw675wQ8GKDm2m q3H28iC4TelHWcdFDk1F5Aaj2ewgX6awIStdpVHderBjI3lcRFJ/EdrCVRSQsuQ4+Ry/ jXYXdJr7bL4kPKLyeoYARP0zUjcxXYczT/v9lZQKc/JMbKrMumtrZunhuqa6Fa708Rm3 LoNA== X-Gm-Message-State: AKaTC03rQ6+e7qyfwrsJZnwxQV7AzMZK1/nrd80ddfDnVFs2cmtl9JKAaUnc8k64uukigA== X-Received: by 10.194.94.132 with SMTP id dc4mr62446280wjb.231.1481202767637; Thu, 08 Dec 2016 05:12:47 -0800 (PST) Received: from cizrna.lan ([109.72.12.145]) by smtp.gmail.com with ESMTPSA id j1sm36976762wjm.26.2016.12.08.05.12.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 08 Dec 2016 05:12:46 -0800 (PST) From: Tomeu Vizoso To: linux-kernel@vger.kernel.org Subject: [PATCH] drm/edid: Don't print an error if the checksum of a CEA block is wrong Date: Thu, 8 Dec 2016 14:11:56 +0100 Message-Id: <1481202716-31317-1-git-send-email-tomeu.vizoso@collabora.com> X-Mailer: git-send-email 2.7.4 Cc: Tomeu Vizoso , Tomi Sarvela , intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, Daniel Vetter X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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 Cc: Tomi Sarvela Cc: intel-gfx@lists.freedesktop.org Signed-off-by: Tomeu Vizoso --- 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 */