From patchwork Mon Feb 17 03:39:41 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Lisandro_Dami=C3=A1n_Nicanor_P=C3=A9rez_Meyer?= X-Patchwork-Id: 3661661 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 9D2769F38B for ; Mon, 17 Feb 2014 09:46:42 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9B26520155 for ; Mon, 17 Feb 2014 09:46:41 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 3C0202013A for ; Mon, 17 Feb 2014 09:46:40 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 227F3FA452; Mon, 17 Feb 2014 01:46:38 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-yh0-f44.google.com (mail-yh0-f44.google.com [209.85.213.44]) by gabe.freedesktop.org (Postfix) with ESMTP id 029DAFA378 for ; Sun, 16 Feb 2014 19:39:55 -0800 (PST) Received: by mail-yh0-f44.google.com with SMTP id f73so13842819yha.31 for ; Sun, 16 Feb 2014 19:39:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:reply-to:cc:subject:date:message-id:user-agent:in-reply-to :references:mime-version:content-type; bh=tG8UwlrAlajK457UJudQQQyTSXoXAt039a3uGA06kzU=; b=n1D5fBPsc8F+KaA5X6YQd1Gt/Dkqrve5iY4QQa9NTEcSV79ItbUQWBafnh/BC6LFtW 6gaaFK/aElpiCMzNO81YL/cSU4R/EOML4wPIqu6f370NHmLg+hSDH0uMkT4WFb50CPWY cIBb6tbc0EyZlktVxWcwCBm8cApGoqmLcw4BEe6Dzi5miBt2jnlaXWzW9AK5q1qDC3yO 5Icz/qZdxH72hzMxKMf9q4nFTn/vRDep9J+q4PMa1dtfuieHpIfe6HzX68T4UP14UmNT dYs/MSFV6LRDneMU2EyYJwpM7/9ZllWb2Jsu4gfTl9tahBxSI7nDaUndOr/gSJq5ElQQ ClyA== X-Received: by 10.236.85.112 with SMTP id t76mr13738838yhe.74.1392608395260; Sun, 16 Feb 2014 19:39:55 -0800 (PST) Received: from luna.localnet ([190.97.19.82]) by mx.google.com with ESMTPSA id b24sm43999044yhl.25.2014.02.16.19.39.51 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 16 Feb 2014 19:39:53 -0800 (PST) From: "Lisandro =?ISO-8859-1?Q?Dami=E1n_Nicanor_P=E9rez?= Meyer" To: 622993@bugs.debian.org, Stuart Pook Subject: Re: Bug#622993: every 10s I get "[drm:drm_edid_block_valid] *ERROR* EDID checksum is invalid ..." Date: Mon, 17 Feb 2014 00:39:41 -0300 Message-ID: <6090341.IquQv0jnHJ@luna> User-Agent: KMail/4.11.5 (Linux/3.12-1-amd64; KDE/4.11.5; x86_64; ; ) In-Reply-To: <4DBD7B90.8080509@pook.it> References: <201104292156.32388.perezmeyer@gmail.com> <20110430040921.GA7942@elie> <4DBD7B90.8080509@pook.it> MIME-Version: 1.0 X-Mailman-Approved-At: Mon, 17 Feb 2014 01:46:37 -0800 Cc: Jonathan Nieder , dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list Reply-To: 622993@bugs.debian.org List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org X-Spam-Status: No, score=-4.6 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, 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 (Sorry if I'm spawning a very old thread here). After all this time I have been patching my kernels to workaround [0][1] [0] [1] Some time ago I found [2] and today I finally solved the problem. [2] Some stuff I learned: the kernel does ignores checksums mismatches by 8... in the positive side! My mismatch was exactly -1, ie, 255. I have been modifying the original patch to workaround this since 2011. I'm attaching my last patch in case someone else needs it. It does adds a kernel parameter to ignore edid mismatches. Kinds regards, Lisandro. diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c index 830f750..773c5d0 100644 --- a/drivers/gpu/drm/drm_edid.c +++ b/drivers/gpu/drm/drm_edid.c @@ -1018,6 +1018,9 @@ bool drm_edid_block_valid(u8 *raw_edid, int block, bool print_bad_edid) } } + if (!drm_edid_strict) + return 1; + for (i = 0; i < EDID_LENGTH; i++) csum += raw_edid[i]; if (csum) { @@ -2021,7 +2024,7 @@ do_inferred_modes(struct detailed_timing *timing, void *c) closure->modes += drm_dmt_modes_for_range(closure->connector, closure->edid, timing); - + if (!version_greater(closure->edid, 1, 1)) return; /* GTF not defined yet */ @@ -2258,7 +2261,7 @@ do_cvt_mode(struct detailed_timing *timing, void *c) static int add_cvt_modes(struct drm_connector *connector, struct edid *edid) -{ +{ struct detailed_mode_closure closure = { connector, edid, 0, 0, 0 }; diff --git a/drivers/gpu/drm/drm_stub.c b/drivers/gpu/drm/drm_stub.c index 39d8645..487a6ef 100644 --- a/drivers/gpu/drm/drm_stub.c +++ b/drivers/gpu/drm/drm_stub.c @@ -49,6 +49,9 @@ EXPORT_SYMBOL(drm_vblank_offdelay); unsigned int drm_timestamp_precision = 20; /* Default to 20 usecs. */ EXPORT_SYMBOL(drm_timestamp_precision); +int drm_edid_strict = 1; /* 0 to disable strict edid conformance */ +EXPORT_SYMBOL(drm_edid_strict); + /* * Default to use monotonic timestamps for wait-for-vblank and page-flip * complete events. @@ -63,12 +66,14 @@ MODULE_PARM_DESC(rnodes, "Enable experimental render nodes API"); MODULE_PARM_DESC(vblankoffdelay, "Delay until vblank irq auto-disable [msecs]"); MODULE_PARM_DESC(timestamp_precision_usec, "Max. error on timestamps [usecs]"); MODULE_PARM_DESC(timestamp_monotonic, "Use monotonic timestamps"); +MODULE_PARM_DESC(edid_strict, "Strict EDID checks (0 = disable)"); module_param_named(debug, drm_debug, int, 0600); module_param_named(rnodes, drm_rnodes, int, 0600); module_param_named(vblankoffdelay, drm_vblank_offdelay, int, 0600); module_param_named(timestamp_precision_usec, drm_timestamp_precision, int, 0600); module_param_named(timestamp_monotonic, drm_timestamp_monotonic, int, 0600); +module_param_named(edid_strict, drm_edid_strict, int, 0600); struct idr drm_minors_idr; diff --git a/include/drm/drmP.h b/include/drm/drmP.h index b46fb45..b86d239 100644 --- a/include/drm/drmP.h +++ b/include/drm/drmP.h @@ -1462,6 +1462,7 @@ extern unsigned int drm_rnodes; extern unsigned int drm_vblank_offdelay; extern unsigned int drm_timestamp_precision; extern unsigned int drm_timestamp_monotonic; +extern int drm_edid_strict; extern struct class *drm_class; extern struct dentry *drm_debugfs_root;