From patchwork Mon Nov 5 08:48:34 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Niedermaier X-Patchwork-Id: 10669893 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2227313BF for ; Tue, 6 Nov 2018 08:15:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 144B82A13D for ; Tue, 6 Nov 2018 08:15:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 07EB22A174; Tue, 6 Nov 2018 08:15:14 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 1BE162A13D for ; Tue, 6 Nov 2018 08:15:13 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5D8446E355; Tue, 6 Nov 2018 08:15:01 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org X-Greylist: delayed 316 seconds by postgrey-1.36 at gabe; Mon, 05 Nov 2018 08:53:52 UTC Received: from mout.kundenserver.de (mout.kundenserver.de [217.72.192.74]) by gabe.freedesktop.org (Postfix) with ESMTPS id A3BD76E134 for ; Mon, 5 Nov 2018 08:53:52 +0000 (UTC) Received: from sun05.dh.corp ([188.193.90.127]) by mrelayeu.kundenserver.de (mreue109 [212.227.15.183]) with ESMTPA (Nemesis) id 1MkHEN-1feFGg0cP3-00ke6s; Mon, 05 Nov 2018 09:48:31 +0100 Received: from sun05.dh.corp ([188.193.90.127]) by mrelayeu.kundenserver.de (mreue109 [212.227.15.183]) with ESMTPA (Nemesis) id 1MkHEN-1feFGg0cP3-00ke6s; Mon, 05 Nov 2018 09:48:31 +0100 Received: from sun1049.dh.corp (unknown [10.64.9.49]) by sun05.dh.corp (Postfix) with ESMTP id D38261FA48; Mon, 5 Nov 2018 09:48:29 +0100 (CET) Received: from localhost (10.64.31.3) by sun1049.dh.corp (10.64.9.49) with Microsoft SMTP Server id 14.3.408.0; Mon, 5 Nov 2018 09:48:35 +0100 From: Christoph Niedermaier To: , Subject: [PATCH 1/2] Docs/EDID: Fixed erroneous bits of XOFFSET, XPULSE, YOFFSET and YPULSE Date: Mon, 5 Nov 2018 09:48:34 +0100 Message-ID: <1541407715-5417-2-git-send-email-cniedermaier@dh-electronics.de> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1541407715-5417-1-git-send-email-cniedermaier@dh-electronics.de> References: <1541407715-5417-1-git-send-email-cniedermaier@dh-electronics.de> MIME-Version: 1.0 X-Originating-IP: [10.64.31.3] X-Provags-ID: V03:K1:ek0VsIyVf54nywl2erJ+i6j2SW8DidCap21KjQKZ75PGeO7Ob6Y jqABoggXqAz6uLWltNjQ8nxn8RPBoWbJm2FrN7H9e6393hdzSB3z1GmB0kNOTwDPsCxOGGt /mNY6EBF/dCjPYdTqhe1USQ7l8Mbf2no1dqC2W9YJ2aNfCZItT3s5VK8BWyQYHPD4bB/lLt NOlu71sp3TZm2QYLuYQvA== X-UI-Out-Filterresults: notjunk:1;V01:K0:TwH2P6Tu2AY=:5dWy5RTWeag18ttE9jbmep PwmKYuH51TOjRsmG60124SHiKx//+/prJCqY10wZ9Vnz9siEfeJ0D9j6pWucJQsq/GcrYBXmg Ew8kWgzqgyzp3KRqDqRYbCCmUZcsCqnzs9wudG/umUP0BBK5Er76TY3yQSvNl7FAczr3vPWJt agYPOpXTOjZ3lV2e9s5w2XtbrwF9dkpe8li00PaGSZnCqGcb3rY+OCnW5qAqJ5A1BTtfVGW7j 1uIc6AHAcetxmUt+IUTgpP7D/dyWV64Ua5egk0kCzTQ0itzQ2TUb0cXXWLzamIOAKvw8lFUOL U7ItzenKCIHiO74xRKhS3tIJlSGs1OsPdB5ip8PrxjSk95h9iOoHjRDBrOK98EN6La9BS/qa+ s1xmB/Tan6rrJ745uqqL57ekhlxzTn2PigDLM4uHy40QjykIsvJGratZTXu+fScGh9AS5csdd 40/bVcTggRlS/w9eU0ZbwOZhTsHEERrKBDPwYDZXzD3vcqsK+V+PBkU2cV2HNavSZAqo9ITeO GhwnF8jqErRGK0rYE0+Md/MdwFCk8vyRgOVZW8fgvjGbfRne59eGzNWJR44rUx5BkVDbVVV4P 12G3l1lycCdYouK/mfsIdBy4GH7A3am2OU7gi9Pla3X+5nzTkWkhiM53d4NnQpPusLJvWJePs J0BtCfPotjaM8zFHRg06aMfHBB9mChhQJWtK76t/9qOBSkN95WCjircpMC49Cu81Z4C58vBD2 3G3Hu7c50wCLhL7GlfZZS5GiVkSMJ5psa6TlLMJYq1TICFJiHGuIyuwzw7H/KKH064sW/ebmo a9Sjm2omWmogTGNGpf8W3GQ1dRToq4yBKD3jy6XpLaZCK4uayA= X-Mailman-Approved-At: Tue, 06 Nov 2018 08:14:57 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP The problem was found when EDID data sets for displays other than the provided samples were generated. The patch has no effect on the provided samples that still match the data used in drivers/gpu/drm/drm_edid_load.c. The provided samples use small values for XOFFSET, XPULSE, YOFFSET and YPULSE, where the error doesn't occur. This fix corrects the use of that values in case of high values, because the most significant bits were treated incorrectly. So in edid.S msbs4 should use bit 8 and 9 of XOFFSET and XPULS. For YOFFSET and YPULSE msbs4 should use bit 4 and 5. lsbs2 was introduced for a better overview, without functional change. Removing also the useless value 63 of all files, because it is added in the *.S description files and then it is subtracted in edid.S. Signed-off-by: Christoph Niedermaier Reviewed-by: Carsten Emde --- Documentation/EDID/1024x768.S | 4 ++-- Documentation/EDID/1280x1024.S | 4 ++-- Documentation/EDID/1600x1200.S | 4 ++-- Documentation/EDID/1680x1050.S | 4 ++-- Documentation/EDID/1920x1080.S | 4 ++-- Documentation/EDID/800x600.S | 4 ++-- Documentation/EDID/HOWTO.txt | 4 ++-- Documentation/EDID/edid.S | 10 ++++++---- 8 files changed, 20 insertions(+), 18 deletions(-) diff --git a/Documentation/EDID/1024x768.S b/Documentation/EDID/1024x768.S index 6f3e4b7..ff4013e 100644 --- a/Documentation/EDID/1024x768.S +++ b/Documentation/EDID/1024x768.S @@ -31,8 +31,8 @@ #define YBLANK 38 #define XOFFSET 8 #define XPULSE 144 -#define YOFFSET (63+3) -#define YPULSE (63+6) +#define YOFFSET 3 +#define YPULSE 6 #define DPI 72 #define VFREQ 60 /* Hz */ #define TIMING_NAME "Linux XGA" diff --git a/Documentation/EDID/1280x1024.S b/Documentation/EDID/1280x1024.S index bd9bef2a..ce0e85b 100644 --- a/Documentation/EDID/1280x1024.S +++ b/Documentation/EDID/1280x1024.S @@ -31,8 +31,8 @@ #define YBLANK 42 #define XOFFSET 48 #define XPULSE 112 -#define YOFFSET (63+1) -#define YPULSE (63+3) +#define YOFFSET 1 +#define YPULSE 3 #define DPI 72 #define VFREQ 60 /* Hz */ #define TIMING_NAME "Linux SXGA" diff --git a/Documentation/EDID/1600x1200.S b/Documentation/EDID/1600x1200.S index a45101c..5eeb751 100644 --- a/Documentation/EDID/1600x1200.S +++ b/Documentation/EDID/1600x1200.S @@ -31,8 +31,8 @@ #define YBLANK 50 #define XOFFSET 64 #define XPULSE 192 -#define YOFFSET (63+1) -#define YPULSE (63+3) +#define YOFFSET 1 +#define YPULSE 3 #define DPI 72 #define VFREQ 60 /* Hz */ #define TIMING_NAME "Linux UXGA" diff --git a/Documentation/EDID/1680x1050.S b/Documentation/EDID/1680x1050.S index b0d7c69..ec67950 100644 --- a/Documentation/EDID/1680x1050.S +++ b/Documentation/EDID/1680x1050.S @@ -31,8 +31,8 @@ #define YBLANK 39 #define XOFFSET 104 #define XPULSE 176 -#define YOFFSET (63+3) -#define YPULSE (63+6) +#define YOFFSET 3 +#define YPULSE 6 #define DPI 96 #define VFREQ 60 /* Hz */ #define TIMING_NAME "Linux WSXGA" diff --git a/Documentation/EDID/1920x1080.S b/Documentation/EDID/1920x1080.S index 3084355e..e0657af 100644 --- a/Documentation/EDID/1920x1080.S +++ b/Documentation/EDID/1920x1080.S @@ -31,8 +31,8 @@ #define YBLANK 45 #define XOFFSET 88 #define XPULSE 44 -#define YOFFSET (63+4) -#define YPULSE (63+5) +#define YOFFSET 4 +#define YPULSE 5 #define DPI 96 #define VFREQ 60 /* Hz */ #define TIMING_NAME "Linux FHD" diff --git a/Documentation/EDID/800x600.S b/Documentation/EDID/800x600.S index 6644e26..b6853b2 100644 --- a/Documentation/EDID/800x600.S +++ b/Documentation/EDID/800x600.S @@ -28,8 +28,8 @@ #define YBLANK 28 #define XOFFSET 40 #define XPULSE 128 -#define YOFFSET (63+1) -#define YPULSE (63+4) +#define YOFFSET 1 +#define YPULSE 4 #define DPI 72 #define VFREQ 60 /* Hz */ #define TIMING_NAME "Linux SVGA" diff --git a/Documentation/EDID/HOWTO.txt b/Documentation/EDID/HOWTO.txt index 835db33..7d05a7d 100644 --- a/Documentation/EDID/HOWTO.txt +++ b/Documentation/EDID/HOWTO.txt @@ -45,8 +45,8 @@ EDID: #define YPIX vdisp #define YBLANK vtotal-vdisp -#define YOFFSET (63+(vsyncstart-vdisp)) -#define YPULSE (63+(vsyncend-vsyncstart)) +#define YOFFSET vsyncstart-vdisp +#define YPULSE vsyncend-vsyncstart The CRC value in the last line #define CRC 0x55 diff --git a/Documentation/EDID/edid.S b/Documentation/EDID/edid.S index ef082dc..c3d1381 100644 --- a/Documentation/EDID/edid.S +++ b/Documentation/EDID/edid.S @@ -47,9 +47,11 @@ #define mfgname2id(v1,v2,v3) \ ((((v1-'@')&0x1f)<<10)+(((v2-'@')&0x1f)<<5)+((v3-'@')&0x1f)) #define swap16(v1) ((v1>>8)+((v1&0xff)<<8)) +#define lsbs2(v1,v2) (((v1&0x0f)<<4)+(v2&0x0f)) #define msbs2(v1,v2) ((((v1>>8)&0x0f)<<4)+((v2>>8)&0x0f)) #define msbs4(v1,v2,v3,v4) \ - (((v1&0x03)>>2)+((v2&0x03)>>4)+((v3&0x03)>>6)+((v4&0x03)>>8)) + ((((v1>>8)&0x03)<<6)+(((v2>>8)&0x03)<<4)+\ + (((v3>>4)&0x03)<<2)+((v4>>4)&0x03)) #define pixdpi2mm(pix,dpi) ((pix*25)/dpi) #define xsize pixdpi2mm(XPIX,DPI) #define ysize pixdpi2mm(YPIX,DPI) @@ -200,9 +202,9 @@ y_msbs: .byte msbs2(YPIX,YBLANK) x_snc_off_lsb: .byte XOFFSET&0xff /* Horizontal sync pulse width pixels 8 lsbits (0-1023) */ x_snc_pls_lsb: .byte XPULSE&0xff -/* Bits 7-4 Vertical sync offset lines 4 lsbits -63) - Bits 3-0 Vertical sync pulse width lines 4 lsbits -63) */ -y_snc_lsb: .byte ((YOFFSET-63)<<4)+(YPULSE-63) +/* Bits 7-4 Vertical sync offset lines 4 lsbits (0-63) + Bits 3-0 Vertical sync pulse width lines 4 lsbits (0-63) */ +y_snc_lsb: .byte lsbs2(YOFFSET, YPULSE) /* Bits 7-6 Horizontal sync offset pixels 2 msbits Bits 5-4 Horizontal sync pulse width pixels 2 msbits Bits 3-2 Vertical sync offset lines 2 msbits