From patchwork Thu Mar 31 20:55:03 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ezequiel Garcia X-Patchwork-Id: 8717481 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.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id D7450C0553 for ; Thu, 31 Mar 2016 20:55:35 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 13E70202F0 for ; Thu, 31 Mar 2016 20:55:35 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 3F08D202FE for ; Thu, 31 Mar 2016 20:55:34 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 220336EAF1; Thu, 31 Mar 2016 20:55:26 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-qg0-x22d.google.com (mail-qg0-x22d.google.com [IPv6:2607:f8b0:400d:c04::22d]) by gabe.freedesktop.org (Postfix) with ESMTPS id 1437C6EAF1 for ; Thu, 31 Mar 2016 20:55:23 +0000 (UTC) Received: by mail-qg0-x22d.google.com with SMTP id j35so77774990qge.0 for ; Thu, 31 Mar 2016 13:55:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vanguardiasur-com-ar.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=89psfGgWiNVrCHFNBbl58dXGGaPPGDKQWzfz+E8/Ul0=; b=EaH3mSuZ2RpqXtKIkbgWpb1uqT/AkPSd0qXITsDlhBXWAcOX2rJ66HCmCFaZmpdEjD xbdDypGckiD0lzq69WeX8Jqx2qH65/bq1ADQ1AnRWp1hjxnbQ3BmUg92ViOJXnuvK/GD A6DXu+DUKgXOOHB1tD2io9O5Nd5zEFQ9e0cbx3sDqO+zJ/YeLWFV3w80oaOWHk8Mgq5e Yav4L+GIZXDrTZ6s0iPSiV8fbLwZlUhM+OsPdb5wwQ0pbuqnJ0xbA+Yu3fivZfJ1pQWb IIw8dlDV4W0UqB3vVv3wRv4t1f3rocY0v9KxJ18XMod6OTTNp/V2+UhChlIVf+zkLOT2 SY/g== 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=89psfGgWiNVrCHFNBbl58dXGGaPPGDKQWzfz+E8/Ul0=; b=YB3p8IMKeEm8YEwahOnbIaY52HZU6T8PAw6f9WzDQm51FLCbduw8Czc0L4zoum+PHv /aNFVqyD3NANDcbytaJAmGv7igOFfGvnFgvReZxL8+UMS5ez3MbAW/l7lWFC+Ls8P7HV KsvctLfKMeeOJA0MWEEZp1qIlOhvKKh5gwgMirpQKwrr2Vnhd5Qrg3uzRTV8Iy04pBPu s6jpRh4X6SseA/pAlK6c/7hl8f95vyM4NYDfpZJrgjrteCbzJ3ZDRxnERaOWp/WvXBLl c0sgOuvocuuefhHcZAQlngYHF/FYzaktHARdsE5AxLqkWPYFciStVkWkn9c3EdMqQ5ZW GiJw== X-Gm-Message-State: AD7BkJIHBup6cs0XEwDg8/DD51NK1dp5m2oQGYAsUsVAODDnHtJcYg33AfikP0+XCbXZCA== X-Received: by 10.140.102.111 with SMTP id v102mr3432702qge.48.1459457721383; Thu, 31 Mar 2016 13:55:21 -0700 (PDT) Received: from localhost.localdomain ([190.2.108.156]) by smtp.gmail.com with ESMTPSA id w16sm4698428qka.35.2016.03.31.13.55.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 31 Mar 2016 13:55:20 -0700 (PDT) From: Ezequiel Garcia To: intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org Subject: [PATCH] drm/i915/hdmi: Fix weak connector detection Date: Thu, 31 Mar 2016 17:55:03 -0300 Message-Id: <1459457703-687-1-git-send-email-ezequiel@vanguardiasur.com.ar> X-Mailer: git-send-email 2.7.0 Cc: Daniel Vetter , Ezequiel Garcia X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-5.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, 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 Currently, our implementation of drm_connector_funcs.detect is based on getting a valid EDID. This requirement makes the driver fail to detect connected connectors in case of EDID corruption, which prevents from falling back to modes provided by builtin or user-provided EDIDs. Let's fix this by improving the detection, with a DDC probe, if the current EDID-based detection failed. Note that a better way of dealing with this could calling drm_probe_ddc in drm_connector_funcs.detect, and do the EDID full reading and parsing in drm_connector_helper_funcs.get_modes, when it's actually needed. However, this would be more invasive and thus more error-prone. The current commit is an attempt to get some uninvasive fix, and allow for easier backporting. Signed-off-by: Ezequiel Garcia --- drivers/gpu/drm/i915/intel_hdmi.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/drivers/gpu/drm/i915/intel_hdmi.c b/drivers/gpu/drm/i915/intel_hdmi.c index a0d8daed2470..c079206e6681 100644 --- a/drivers/gpu/drm/i915/intel_hdmi.c +++ b/drivers/gpu/drm/i915/intel_hdmi.c @@ -1428,6 +1428,20 @@ intel_hdmi_detect(struct drm_connector *connector, bool force) } else status = connector_status_disconnected; + /* + * The above call to intel_hdmi_set_edid() checked for a valid EDID. + * However, the EDID can get corrupted for several reasons, resulting + * in a disconnected status despite the connector being connected. + * Hence, let's try one more time, by only probing the DDC. + * + * This allows the DRM core to fallback to builtin or user-provided + * EDID firmware, e.g. in drm_helper_probe_single_connector_modes. + */ + if (status == connector_status_disconnected) + if (drm_probe_ddc(intel_gmbus_get_adapter(dev_priv, + intel_hdmi->ddc_bus))) + status = connector_status_connected; + intel_display_power_put(dev_priv, POWER_DOMAIN_GMBUS); return status;