From patchwork Wed Nov 27 15:59:02 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Wood X-Patchwork-Id: 3248921 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 2B14C9F3A0 for ; Wed, 27 Nov 2013 15:59:12 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id F0D2320582 for ; Wed, 27 Nov 2013 15:59:10 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id BA841200C1 for ; Wed, 27 Nov 2013 15:59:09 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 37EFCFA995; Wed, 27 Nov 2013 07:59:07 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wg0-f52.google.com (mail-wg0-f52.google.com [74.125.82.52]) by gabe.freedesktop.org (Postfix) with ESMTP id D52D6FA995 for ; Wed, 27 Nov 2013 07:59:05 -0800 (PST) Received: by mail-wg0-f52.google.com with SMTP id x13so7008400wgg.19 for ; Wed, 27 Nov 2013 07:59:04 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=KLhuXKWbWiEYyFTwLetoCyEnvufN0GI3Nn3FzSww9x4=; b=NbQEfZO9uQAmOMfC1t8sCfAjsD2UFD277K8PzHaWZGJ7CUHmy95KDmoX28x39fK1Ea cGOZl/2YTT59Mv2DUeDN1CVJd3EdfMhAT8pGZ5LhcMHTrX/P9qzciKlqmvmV7BFtEM3W qqgjRnsk41A4jUfMCbSXfJJYbmIJmpeiFJtwACo813oZxiz/LBqz+UmnxiRJk7XzYi+b rrTfJAxxcHV/1dgs5zA6p7jofaN31G8Xs44wqlzHhxiXZdyExsIeeQMVkbMdS/mUc2Ev UyzH4y4zEABAv+qycjVIm6O3NXGsVZp4ADHspnmoIUNc7Rp+hd0c+7eal0rsxabVPu/a CaaA== X-Gm-Message-State: ALoCoQkv/sMD7UwTFEYhsaaQTfPOaqNgt0rRaftXg9rI+1JherLRQM6fG+CZM3lzUufRiIjpc66r X-Received: by 10.180.80.233 with SMTP id u9mr6728661wix.6.1385567944842; Wed, 27 Nov 2013 07:59:04 -0800 (PST) Received: from pistachio.icx.intel.com ([83.217.123.106]) by mx.google.com with ESMTPSA id a19sm72010088wib.1.2013.11.27.07.59.03 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 27 Nov 2013 07:59:03 -0800 (PST) From: Thomas Wood To: dri-devel@lists.freedesktop.org Subject: [PATCH v2 edid-decode] Parse the list of additional 3D modes Date: Wed, 27 Nov 2013 15:59:02 +0000 Message-Id: <1385567942-6049-1-git-send-email-thomas.wood@intel.com> X-Mailer: git-send-email 1.8.4.2 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dri-devel-bounces@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, 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 Parse 2D_VIC_order_X and 3D_Structure_X from the list at the end of the HDMI Vendor Specific Block. v2: check 3D_Detail_X indicates horizontal sub-sampling in side-by-side (half) mode Signed-off-by: Thomas Wood --- edid-decode.c | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/edid-decode.c b/edid-decode.c index 4265843..3f7e4da 100644 --- a/edid-decode.c +++ b/edid-decode.c @@ -851,6 +851,7 @@ cea_hdmi_block(unsigned char *x) if (x[10 + b] & 0x01) printf(" 3D: Frame-packing\n"); b += 2; + len_3d -= 2; } if (mask) { int i; @@ -864,14 +865,40 @@ cea_hdmi_block(unsigned char *x) printf(" %d", i + 8); printf("\n"); b += 2; + len_3d -= 2; } /* - * XXX list of nibbles: + * list of nibbles: * 2D_VIC_Order_X * 3D_Structure_X * (optionally: 3D_Detail_X and reserved) */ + if (len_3d > 0) { + int end = b + len_3d; + + while (b < end) { + printf(" VIC index %d supports ", x[9 + b] >> 4); + switch (x[9 + b] & 0x0f) { + case 0: printf("frame packing"); break; + case 6: printf("top-and-bottom"); break; + case 8: + if ((x[10 + b] >> 4) == 1) { + printf("side-by-side (half, horizontal)"); + break; + } + default: printf("unknown"); + } + printf("\n"); + + if ((x[9 + b] & 0x0f) > 7) { + /* Optional 3D_Detail_X and reserved */ + b++; + } + b++; + } + } + } }