From patchwork Wed Aug 28 15:48:38 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mikko Perttunen X-Patchwork-Id: 2850915 Return-Path: X-Original-To: patchwork-dri-devel@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 BB03EBF546 for ; Wed, 28 Aug 2013 16:39:57 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id EFCEC2054A for ; Wed, 28 Aug 2013 16:39:56 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 517152054C for ; Wed, 28 Aug 2013 16:39:52 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 51B61E649A for ; Wed, 28 Aug 2013 09:39:52 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from hqemgate14.nvidia.com (hqemgate14.nvidia.com [216.228.121.143]) by gabe.freedesktop.org (Postfix) with ESMTP id CAA2DE7A77 for ; Wed, 28 Aug 2013 08:48:52 -0700 (PDT) Received: from hqnvupgp07.nvidia.com (Not Verified[216.228.121.13]) by hqemgate14.nvidia.com id ; Wed, 28 Aug 2013 08:48:29 -0700 Received: from hqemhub02.nvidia.com ([172.20.12.94]) by hqnvupgp07.nvidia.com (PGP Universal service); Wed, 28 Aug 2013 08:48:52 -0700 X-PGP-Universal: processed; by hqnvupgp07.nvidia.com on Wed, 28 Aug 2013 08:48:52 -0700 Received: from deemhub01.nvidia.com (10.21.69.137) by hqemhub02.nvidia.com (172.20.150.31) with Microsoft SMTP Server (TLS) id 8.3.298.1; Wed, 28 Aug 2013 08:48:13 -0700 Received: from mperttunen-lnx.Nvidia.com (10.21.65.27) by deemhub01.nvidia.com (10.21.69.137) with Microsoft SMTP Server (TLS) id 8.3.298.1; Wed, 28 Aug 2013 17:48:11 +0200 From: Mikko Perttunen To: Subject: [PATCH v2 2/6] host1x: hdmi: Detect whether display is connected with HDMI or DVI Date: Wed, 28 Aug 2013 18:48:38 +0300 Message-ID: <1377704922-2824-3-git-send-email-mperttunen@nvidia.com> X-Mailer: git-send-email 1.8.1.5 In-Reply-To: <1377704922-2824-1-git-send-email-mperttunen@nvidia.com> References: <1377704922-2824-1-git-send-email-mperttunen@nvidia.com> X-NVConfidentiality: public MIME-Version: 1.0 X-Mailman-Approved-At: Wed, 28 Aug 2013 09:30:33 -0700 Cc: linux-tegra@vger.kernel.org, tbergstrom@nvidia.com, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Mikko Perttunen 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: , Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org X-Spam-Status: No, score=-6.7 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 Use EDID data to determine whether the display supports HDMI or just DVI. This used to be hardcoded to be HDMI, which broke support for DVI displays that couldn't understand the interspersed audio/other data. If the EDID data isn't available, default to DVI, which should be a safer choice. Signed-off-by: Mikko Perttunen --- drivers/gpu/host1x/drm/hdmi.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/gpu/host1x/drm/hdmi.c b/drivers/gpu/host1x/drm/hdmi.c index d81fac8..140339b 100644 --- a/drivers/gpu/host1x/drm/hdmi.c +++ b/drivers/gpu/host1x/drm/hdmi.c @@ -702,6 +702,14 @@ static int tegra_output_hdmi_enable(struct tegra_output *output) unsigned long value; int retries = 1000; int err; + struct drm_property_blob *edid_blob = output->connector.edid_blob_ptr; + + if (edid_blob && edid_blob->data && + drm_detect_hdmi_monitor((struct edid *)edid_blob->data)) { + hdmi->dvi = false; + } else { + hdmi->dvi = true; + } pclk = mode->clock * 1000; h_sync_width = mode->hsync_end - mode->hsync_start;