From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christian Schmidt Subject: [PATCH] Fix wrong assumptions in cea_for_each_detailed_block Date: Sun, 13 Nov 2011 02:04:54 +0100 Message-ID: <4EBF17B6.9060108@digadd.de> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------010509020500030501090106" Return-path: Received: from mx1.digadd.de (mx2.digadd.de [195.47.195.236]) by gabe.freedesktop.org (Postfix) with ESMTP id 2162C9E82F for ; Sat, 12 Nov 2011 17:05:28 -0800 (PST) Received: from [192.168.5.128] by mx1.digadd.de with esmtpsa (TLSv1:CAMELLIA256-SHA:256) (Exim 4.76) (envelope-from ) id 1RPOVj-00021H-6H for dri-devel@lists.freedesktop.org; Sun, 13 Nov 2011 02:05:27 +0100 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org Errors-To: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org To: dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org This is a multi-part message in MIME format. --------------010509020500030501090106 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit The current logic misunderstands the spec about CEA 18byte descriptors. First, the spec doesn't state "detailed timing descriptors" but "18 byte descriptors", so any data record could be stored, mixed timings and other data, just as in the standard EDID. Second, the lower four bit of byte 3 of the CEA record do not contain the number of descriptors, but "the total number of DTDs defining native formats in the whole EDID [...], starting with the first DTD in the DTD list (which starts in the base EDID block)." A device can of course support non-native formats. As such the number can't be used to determine n, and the existing code will filter non-timing 18byte descriptors anyway. Signed-off-by: Christian Schmidt --------------010509020500030501090106 Content-Type: text/x-patch; name="fix_cea_for_each_detailed_block.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="fix_cea_for_each_detailed_block.patch" diff -ur linux-3.2-rc1.orig/drivers/gpu/drm/drm_edid.c linux-3.2-rc1/drivers/gpu/drm/drm_edid.c --- linux-3.2-rc1.orig/drivers/gpu/drm/drm_edid.c 2011-11-13 01:42:29.771092473 +0100 +++ linux-3.2-rc1/drivers/gpu/drm/drm_edid.c 2011-11-13 01:54:32.031062983 +0100 @@ -511,22 +511,7 @@ u8 rev = ext[0x01], d = ext[0x02]; u8 *det_base = ext + d; - switch (rev) { - case 0: - /* can't happen */ - return; - case 1: - /* have to infer how many blocks we have, check pixel clock */ - for (i = 0; i < 6; i++) - if (det_base[18*i] || det_base[18*i+1]) - n++; - break; - default: - /* explicit count */ - n = min(ext[0x03] & 0x0f, 6); - break; - } - + n = (127 - d) / 18; for (i = 0; i < n; i++) cb((struct detailed_timing *)(det_base + 18 * i), closure); } --------------010509020500030501090106 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/dri-devel --------------010509020500030501090106--