From patchwork Mon Oct 7 08:34:35 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thierry Reding X-Patchwork-Id: 2995121 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 90AC39F243 for ; Mon, 7 Oct 2013 08:59:20 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A5B86201C8 for ; Mon, 7 Oct 2013 08:59:19 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 99EDA201C7 for ; Mon, 7 Oct 2013 08:59:18 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 93B7DE608E for ; Mon, 7 Oct 2013 01:59:18 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-bk0-f44.google.com (mail-bk0-f44.google.com [209.85.214.44]) by gabe.freedesktop.org (Postfix) with ESMTP id 13865E61A5 for ; Mon, 7 Oct 2013 01:37:13 -0700 (PDT) Received: by mail-bk0-f44.google.com with SMTP id mz10so2530457bkb.31 for ; Mon, 07 Oct 2013 01:37:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=vx+yQmredzfqL78JnUkOu6lL3nkwla8bAxeX/0mX6ac=; b=GD2DcwzIg4s2trTdPBfH1c/obUl/WL0z21cK/ka4Rj/Py2ww7kbkBKd6er7dhwvxwZ LA6vmjg5m9p4dNeeNYySRlDj+ldF6fmJB0dCirUJi8B701g0DkShXkQY1MPsIcruwm88 A8UzFGviFGWmksEbKksrAhAWMjpNjjUQFpDpMLTlgSYvQBtc3CWtj66xe58n/y22qoqm Yg/4Sbso8BbzXLVAmCPNH6lrzrslTyJP4ejokVZcLIoqjWt8YVe6D8rnABZTkvjXzAOZ Yn2cF8NuLCGvhl+Ge6Y2+AHLD0ZlKazQp0RPJvbH8jE/4VkjC1yPHZik2e3O/BxM7QuK NpLA== X-Received: by 10.204.233.129 with SMTP id jy1mr1164085bkb.27.1381135033186; Mon, 07 Oct 2013 01:37:13 -0700 (PDT) Received: from localhost (port-46445.pppoe.wtnet.de. [46.59.230.36]) by mx.google.com with ESMTPSA id pn6sm16321707bkb.14.1969.12.31.16.00.00 (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 07 Oct 2013 01:37:12 -0700 (PDT) From: Thierry Reding To: dri-devel@lists.freedesktop.org Subject: [PATCH v2 18/27] drm/tegra: hdmi: Detect DVI-only displays Date: Mon, 7 Oct 2013 10:34:35 +0200 Message-Id: <1381134884-5816-19-git-send-email-treding@nvidia.com> X-Mailer: git-send-email 1.8.4 In-Reply-To: <1381134884-5816-1-git-send-email-treding@nvidia.com> References: <1381134884-5816-1-git-send-email-treding@nvidia.com> Cc: linux-tegra@vger.kernel.org, devicetree@vger.kernel.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: , MIME-Version: 1.0 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=-4.3 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, 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 From: Mikko Perttunen Use EDID data to determine whether the display supports HDMI or DVI only. The HDMI output used to assume to be connected to HDMI displays, but that broke support for DVI displays that don't understand the interspersed audio/other data. To be on the safe side, default to DVI if no EDID data is available. Signed-off-by: Mikko Perttunen [treding@nvidia.com: move detection to separate function] Signed-off-by: Thierry Reding --- drivers/gpu/drm/tegra/hdmi.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/drivers/gpu/drm/tegra/hdmi.c b/drivers/gpu/drm/tegra/hdmi.c index 130cb6d..3808226 100644 --- a/drivers/gpu/drm/tegra/hdmi.c +++ b/drivers/gpu/drm/tegra/hdmi.c @@ -666,6 +666,18 @@ static void tegra_hdmi_setup_tmds(struct tegra_hdmi *hdmi, } } +static bool tegra_output_is_hdmi(struct tegra_output *output) +{ + struct edid *edid; + + if (!output->connector.edid_blob_ptr) + return false; + + edid = (struct edid *)output->connector.edid_blob_ptr->data; + + return drm_detect_hdmi_monitor(edid); +} + static int tegra_output_hdmi_enable(struct tegra_output *output) { unsigned int h_sync_width, h_front_porch, h_back_porch, i, rekey; @@ -680,6 +692,8 @@ static int tegra_output_hdmi_enable(struct tegra_output *output) int retries = 1000; int err; + hdmi->dvi = !tegra_output_is_hdmi(output); + pclk = mode->clock * 1000; h_sync_width = mode->hsync_end - mode->hsync_start; h_back_porch = mode->htotal - mode->hsync_end;