From patchwork Wed Apr 20 11:34:38 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 8888941 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 5DBEB9F1C1 for ; Wed, 20 Apr 2016 11:34:52 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 53862201C8 for ; Wed, 20 Apr 2016 11:34:51 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 0FC1B2024C for ; Wed, 20 Apr 2016 11:34:50 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C0AFF6E97C; Wed, 20 Apr 2016 11:34:45 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-wm0-x229.google.com (mail-wm0-x229.google.com [IPv6:2a00:1450:400c:c09::229]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0ECB46E97C for ; Wed, 20 Apr 2016 11:34:43 +0000 (UTC) Received: by mail-wm0-x229.google.com with SMTP id u206so76370297wme.1 for ; Wed, 20 Apr 2016 04:34:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=uGWF00n3LgFZB/afv8J4r/C/Prf8SYPsZ8RHErkJZ8Y=; b=BwHRwhINtzIG6UiOVGB+Zr9CB/RqyBBoRrvmOvKg9vVdQ/fyq6/vd/39gwirwMbkS7 +hl9vkifojYtvqXzZ53lQ04td9NOrVxHg//GxQT9cO6NFF2TvfAeKpL+g6dKf49NgX/6 jLAOJPOKxcImN7yWniVx9dBC3tg/a1S0HFt1I= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=uGWF00n3LgFZB/afv8J4r/C/Prf8SYPsZ8RHErkJZ8Y=; b=bKBRv9xeRXBzjuxjOtfYzCGmEg4bnNAIWPqpKdAycfgsqSMfAZdLitU+US7TsgHeii wptiaawBLG7Byreh01uR2fD/HTP/rXPUluXFosME2Neqsxsc6VX+L6Om63+07mGeWtL/ aiLu3kVeWaz6aSJBERIn6xxMOFdSNtsQ9XQvdgzBcM9Lyzju6nCDaMRZtbiCj2ObbHL/ NEDmacbYFWiSMZs8zYVlL/73Q/6ypSUgedhYah36au+R5G1zQNYyel64l3xLBZOX5Iu+ giHsE8o8MV5vWL7x+JlzTLtlyYlsMwN+nDynzcB8oWO4CihTLsAn3xTk0UB2BoG4E5BG rlaA== X-Gm-Message-State: AOPr4FXmHbgh5qT45teR5sCwDXQhUamnS7HyQJkvAdYEV0lY6tk597RzCJr2t4UcAugRqg== X-Received: by 10.194.92.45 with SMTP id cj13mr9486231wjb.178.1461152081376; Wed, 20 Apr 2016 04:34:41 -0700 (PDT) Received: from phenom.ffwll.local ([2a02:168:56b5:0:ac27:b86c:7764:9429]) by smtp.gmail.com with ESMTPSA id q127sm9185505wmd.13.2016.04.20.04.34.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 20 Apr 2016 04:34:40 -0700 (PDT) Date: Wed, 20 Apr 2016 13:34:38 +0200 From: Daniel Vetter To: Ezequiel Garcia Message-ID: <20160420113438.GQ2510@phenom.ffwll.local> References: <1461087073-14903-1-git-send-email-ezequiel@vanguardiasur.com.ar> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1461087073-14903-1-git-send-email-ezequiel@vanguardiasur.com.ar> X-Operating-System: Linux phenom 4.4.0-1-amd64 User-Agent: Mutt/1.5.24 (2015-08-30) Cc: Daniel Vetter , intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org Subject: Re: [Intel-gfx] [PATCH] drm: i915: Improve behavior in case of broken HDMI EDID X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" 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 On Tue, Apr 19, 2016 at 02:31:13PM -0300, Ezequiel Garcia wrote: > 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 in turn prevents > from falling back to modes provided by builtin or user-provided > EDIDs. Imo, this should be fixed in the probe helpers. Something like the below might make sense: It should do what you want it to do, still allow us to override force state manually and also fix things up for every, not just i915-hdmi. Also, much smaller patch. Only downside is that we need acks from other driver maintainers, since essentially it's a behaviour change. Thus far you had to both inject the edid and override status if your sink was totally busted. Now just injecting edid will be enough. Cheers, Daniel > > Let's fix this by 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. > > This patch allows i915 to take advantage of the DRM_LOAD_EDID_FIRMWARE > infrastructure. > > Without this patch, any device that fails to provide a valid > EDID will be reported as disconnected (unless the state is forced) > and thus the kernel won't allow to use such device with any mode, > either builtin, user-provided, or the 1024x768 noedid fallback. > > Signed-off-by: Ezequiel Garcia > --- > This patch supersedes: "drm/i915/hdmi: Fix weak connector detection", > https://patchwork.freedesktop.org/patch/79098/. > > drivers/gpu/drm/i915/intel_hdmi.c | 59 ++++++++++++++++++++++++--------------- > 1 file changed, 36 insertions(+), 23 deletions(-) > > diff --git a/drivers/gpu/drm/i915/intel_hdmi.c b/drivers/gpu/drm/i915/intel_hdmi.c > index 616108c4bc3e..aa2f2271394a 100644 > --- a/drivers/gpu/drm/i915/intel_hdmi.c > +++ b/drivers/gpu/drm/i915/intel_hdmi.c > @@ -1392,36 +1392,17 @@ intel_hdmi_detect(struct drm_connector *connector, bool force) > enum drm_connector_status status; > struct intel_hdmi *intel_hdmi = intel_attached_hdmi(connector); > struct drm_i915_private *dev_priv = to_i915(connector->dev); > - bool live_status = false; > - unsigned int try; > - > - DRM_DEBUG_KMS("[CONNECTOR:%d:%s]\n", > - connector->base.id, connector->name); > + struct i2c_adapter *adap; > > intel_display_power_get(dev_priv, POWER_DOMAIN_GMBUS); > > - for (try = 0; !live_status && try < 9; try++) { > - if (try) > - msleep(10); > - live_status = intel_digital_port_connected(dev_priv, > - hdmi_to_dig_port(intel_hdmi)); > - } > - > - if (!live_status) > - DRM_DEBUG_KMS("Live status not up!"); > - > - intel_hdmi_unset_edid(connector); > - > - if (intel_hdmi_set_edid(connector, live_status)) { > - struct intel_hdmi *intel_hdmi = intel_attached_hdmi(connector); > - > - hdmi_to_dig_port(intel_hdmi)->base.type = INTEL_OUTPUT_HDMI; > + adap = intel_gmbus_get_adapter(dev_priv, intel_hdmi->ddc_bus); > + if (drm_probe_ddc(adap)) > status = connector_status_connected; > - } else > + else > status = connector_status_disconnected; > > intel_display_power_put(dev_priv, POWER_DOMAIN_GMBUS); > - > return status; > } > > @@ -1442,10 +1423,42 @@ intel_hdmi_force(struct drm_connector *connector) > hdmi_to_dig_port(intel_hdmi)->base.type = INTEL_OUTPUT_HDMI; > } > > +static void intel_hdmi_detect_edid(struct drm_connector *connector) > +{ > + struct intel_hdmi *intel_hdmi = intel_attached_hdmi(connector); > + struct drm_i915_private *dev_priv = to_i915(connector->dev); > + bool live_status = false; > + unsigned int try; > + > + DRM_DEBUG_KMS("[CONNECTOR:%d:%s]\n", > + connector->base.id, connector->name); > + > + intel_display_power_get(dev_priv, POWER_DOMAIN_GMBUS); > + > + for (try = 0; !live_status && try < 9; try++) { > + if (try) > + msleep(10); > + live_status = intel_digital_port_connected(dev_priv, > + hdmi_to_dig_port(intel_hdmi)); > + } > + > + if (!live_status) > + DRM_DEBUG_KMS("Live status not up!"); > + > + intel_hdmi_unset_edid(connector); > + if (intel_hdmi_set_edid(connector, live_status)) > + hdmi_to_dig_port(intel_hdmi)->base.type = INTEL_OUTPUT_HDMI; > + > + intel_display_power_put(dev_priv, POWER_DOMAIN_GMBUS); > +} > + > static int intel_hdmi_get_modes(struct drm_connector *connector) > { > struct edid *edid; > > + if (!to_intel_connector(connector)->detect_edid) > + intel_hdmi_detect_edid(connector); > + > edid = to_intel_connector(connector)->detect_edid; > if (edid == NULL) > return 0; > -- > 2.7.0 > > _______________________________________________ > Intel-gfx mailing list > Intel-gfx@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/intel-gfx diff --git a/drivers/gpu/drm/drm_probe_helper.c b/drivers/gpu/drm/drm_probe_helper.c index e714b5a7955f..d3b9dc7535da 100644 --- a/drivers/gpu/drm/drm_probe_helper.c +++ b/drivers/gpu/drm/drm_probe_helper.c @@ -214,7 +214,10 @@ int drm_helper_probe_single_connector_modes(struct drm_connector *connector, else connector->status = connector_status_disconnected; if (connector->funcs->force) - connector->funcs->force(connector); + connector->funcs->force(connector); + } else if (connector->override_edid){ + connector->status = connector_status_connected; + connector->funcs->force(connector); } else { connector->status = connector->funcs->detect(connector, true); }