From patchwork Sun Nov 16 02:04:32 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Stefan_Br=C3=BCns?= X-Patchwork-Id: 5312731 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 80F53C11AC for ; Sun, 16 Nov 2014 02:14:34 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id AD65C201DD for ; Sun, 16 Nov 2014 02:14:33 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id AD80D201ED for ; Sun, 16 Nov 2014 02:14:32 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 12EDE6E59D; Sat, 15 Nov 2014 18:14:32 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mx-out-2.rwth-aachen.de (mx-out-2.rwth-aachen.de [134.130.5.187]) by gabe.freedesktop.org (Postfix) with ESMTP id 95B136E1F4 for ; Sat, 15 Nov 2014 18:14:28 -0800 (PST) X-IronPort-AV: E=Sophos;i="5.07,394,1413237600"; d="scan'208";a="270755910" Received: from hub2.rwth-ad.de (HELO mail.rwth-aachen.de) ([134.130.26.143]) by mx-2.rz.rwth-aachen.de with ESMTP; 16 Nov 2014 03:04:38 +0100 Received: from appserver.fset.rwth-aachen.de (137.226.172.40) by mail.rwth-aachen.de (134.130.26.143) with Microsoft SMTP Server (TLS) id 14.3.195.1; Sun, 16 Nov 2014 03:04:32 +0100 From: =?UTF-8?q?Stefan=20Br=C3=BCns?= To: Subject: [PATCH] drm/edid: Check for empty block prior to checksumming Date: Sun, 16 Nov 2014 03:04:32 +0100 X-Mailer: git-send-email 1.8.4.5 MIME-Version: 1.0 X-PMWin-Version: 3.1.3.0, Antivirus-Engine: 3.53.0, Antivirus-Data: 5.08 Message-ID: Cc: stefan.bruens@rwth-aachen.de 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: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP drm_edid_block_valid will dump the whole EDID block. Shorten the log output to a single line stating the block is empty. Signed-off-by: Stefan BrĂ¼ns --- drivers/gpu/drm/drm_edid.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c index 3bf9991..0755d01 100644 --- a/drivers/gpu/drm/drm_edid.c +++ b/drivers/gpu/drm/drm_edid.c @@ -1198,12 +1198,17 @@ 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, 0, print_bad_edid)) - break; if (i == 0 && drm_edid_is_zero(block, EDID_LENGTH)) { connector->null_edid_counter++; - goto carp; + if (print_bad_edid) { + dev_warn(connector->dev->dev, "%s: EDID block 0 empty.\n", + connector->name); + } + connector->bad_edid_counter++; + goto out; } + if (drm_edid_block_valid(block, 0, print_bad_edid)) + break; } if (i == 4) goto carp;