From patchwork Thu Nov 28 17:12:47 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Wood X-Patchwork-Id: 3255271 Return-Path: X-Original-To: patchwork-intel-gfx@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 B1A11C045B for ; Thu, 28 Nov 2013 17:32:36 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5ED6320638 for ; Thu, 28 Nov 2013 17:32:34 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 5842D2062B for ; Thu, 28 Nov 2013 17:32:32 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3708FFAD86 for ; Thu, 28 Nov 2013 09:13:26 -0800 (PST) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-wi0-f173.google.com (mail-wi0-f173.google.com [209.85.212.173]) by gabe.freedesktop.org (Postfix) with ESMTP id 93ED7FACD5 for ; Thu, 28 Nov 2013 09:13:02 -0800 (PST) Received: by mail-wi0-f173.google.com with SMTP id hm4so1110899wib.0 for ; Thu, 28 Nov 2013 09:13:01 -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:subject:date:message-id:in-reply-to :references; bh=ftPdUbG/UtMJsJLsEioSOZr8dnbciD+ffwE6mm308q4=; b=Navk/AMkACo8dlaxRN4YItekNsJBzHyGm6tGDdd3Ly7oMDZuK9OYSbiTaeYejocKF6 XsECBRtTBcPhKytW5jzvr0MHwTpcU1DoSq9D0bwjA+hN65mwSiqKajwbuSxLATojCuCH jqupdHqH0emeq8i2Kjc0enMj54Q8XSaOMyv/stDzEiNbIRmaHvlsWqks6xKBncc81ljn WzD02GV9oXbkf779AtChK0AGSlwGTXLQstrQzv/aux59uaVf2Oha2RHFcREq439FMHs+ kasA5mmWqV9KNgo/RAnVqCCdyQPW2y/wIgY2IunGsoZUq3jOBWByo1BtAir1xd5erNA0 CmMQ== X-Gm-Message-State: ALoCoQlWKkprLcz2PwKeghipYx8hnK76s4H0p6i3+PPK3wqqxtNd5UWKkI2QVfN1RakksI2O9fqw X-Received: by 10.180.189.49 with SMTP id gf17mr3288785wic.23.1385658781790; Thu, 28 Nov 2013 09:13:01 -0800 (PST) Received: from pistachio.icx.intel.com ([83.217.123.106]) by mx.google.com with ESMTPSA id dn2sm83077388wid.1.2013.11.28.09.13.00 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 28 Nov 2013 09:13:01 -0800 (PST) From: Thomas Wood To: dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org Date: Thu, 28 Nov 2013 17:12:47 +0000 Message-Id: <1385658767-24924-3-git-send-email-thomas.wood@intel.com> X-Mailer: git-send-email 1.8.4.2 In-Reply-To: <1385658767-24924-1-git-send-email-thomas.wood@intel.com> References: <1385658767-24924-1-git-send-email-thomas.wood@intel.com> Subject: [Intel-gfx] [PATCH 2/2] drm/edid: parse the list of additional 3D modes X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@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 Data Block. Signed-off-by: Thomas Wood --- drivers/gpu/drm/drm_edid.c | 50 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c index 1dd82cd..eb6b363 100644 --- a/drivers/gpu/drm/drm_edid.c +++ b/drivers/gpu/drm/drm_edid.c @@ -2808,6 +2808,56 @@ do_hdmi_vsdb_modes(struct drm_connector *connector, const u8 *db, u8 len, video_len, i); } + if (hdmi_3d_len <= 4) + goto out; + + offset += 4; + + for (i = 0; i < (hdmi_3d_len - 4); i++) { + int vic_index; + struct drm_display_mode *newmode = NULL; + unsigned int newflag = 0; + + if (((db[8 + offset + i] & 0x0f) > 7) + && (i + 1 == hdmi_3d_len - 4)) + break; + + /* 2D_VIC_order_X */ + vic_index = db[8 + offset + i] >> 4; + + /* 3D_Structure_X */ + switch (db[8 + offset + i] & 0x0f) { + case 0: + newflag = DRM_MODE_FLAG_3D_FRAME_PACKING; + break; + case 6: + newflag = DRM_MODE_FLAG_3D_TOP_AND_BOTTOM; + break; + case 8: + if ((db[9 + offset + i] >> 4) == 1) + newflag = DRM_MODE_FLAG_3D_SIDE_BY_SIDE_HALF; + break; + } + + if (newflag != 0) { + newmode = drm_display_mode_from_vic_index(connector, + video_db, + video_len, + vic_index); + + if (newmode) { + newmode->flags |= newflag; + drm_mode_probed_add(connector, newmode); + modes++; + } + } + + if ((db[8 + offset + i] & 0x0f) > 7) { + /* Optional 3D_Detail_X and reserved */ + i++; + } + } + out: return modes; }