Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp104157ybh; Tue, 10 Mar 2020 20:25:37 -0700 (PDT) X-Google-Smtp-Source: ADFU+vs84XkMP7vZng4Mb/0vnZIeZ/3A3Iz3yCkhY4x2XYlFCm6DOB60EXuQwK/0E/CJfAmYfa3B X-Received: by 2002:aca:f18:: with SMTP id 24mr544686oip.145.1583897137480; Tue, 10 Mar 2020 20:25:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1583897137; cv=none; d=google.com; s=arc-20160816; b=gMZLWiVGcuHQfpWkQW2U3n4SUWBDoa2R3vpnIPJUS1tbVY8kRT5Vc6nhyLV9gQW7fC gL+0UeTVV8YE7k3CUpeaIX5RMk2bqGhOhk99LcERlHk5mP3X61o4Wsqqo3QaKb2s5u58 6TMLM8JV+mpibGWOtmTylkg8XNGrh51khEX+BqwqeFp1Xq031XtQ9pAzX1wBNXtwtB6N kmWJnOqFWC8KQjnsKduK3JmV8kPrBnH4pygnseN8+aIV0fkpNeZsUt8dVYlZaxTmJq2/ 1BFixwmNly126tK4FYDpqNgqNZ8KOXu3M4KiGxAQAMBKZ45XBVq29ju7j20aEsOwfNvq FAJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version; bh=Y5ODwa/O5j8RHjFwdf9kxnabh3qD1ETGWNuNpN2Qelo=; b=oS1Rn0suPqqMICVvfKEf/8yc1UPpDEt5lCs5K+2bPsAe1JGohbhTE3QtGskUNzjPvg A1gFFcElf+xcvAqZ6SWfr0/3sdJBFTERD5iF9FEmVMAt/YPdfyOhQxmv6EIgLkOYQQLZ ZZI8DNdi8zayBv7LEIFECfWjvk8S7SkGxsAECoK99rG32+Ghi4Gs7lWxuBTO/GmwgT5j Mb6QQIUdHla0+MBVb4qAQbGcGkrnQghSN7ZAgueyiRkGsLKDRGwdbbInb9mazOpvtkjQ uM94EfUDzhsqrszoq1utBcYDG2rk3sT0d7vV5gqXnNd/X8GqKV1TFUAoPSnwmF9utM3B k7Xg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n190si502548oig.207.2020.03.10.20.25.25; Tue, 10 Mar 2020 20:25:37 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728057AbgCKDYw convert rfc822-to-8bit (ORCPT + 99 others); Tue, 10 Mar 2020 23:24:52 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:37014 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727648AbgCKDYv (ORCPT ); Tue, 10 Mar 2020 23:24:51 -0400 Received: from mail-pl1-f198.google.com ([209.85.214.198]) by youngberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1jBrzF-0007My-Ac for linux-kernel@vger.kernel.org; Wed, 11 Mar 2020 03:24:49 +0000 Received: by mail-pl1-f198.google.com with SMTP id t12so455555plo.4 for ; Tue, 10 Mar 2020 20:24:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=oRt0r5cQTWUQ10ZviHACsht2XJOWhlaJ3TIQeyqnNOc=; b=um3DeKnPNlGoubwL4i1LOqlLusYMjIVoPtM62m7X0h4KbfszP8iiIhrdib+wWJdycE PZorGmuzzrkfcXY4jJC7JJk7nx8Y2vFY5ON16HHAH7RjpXW44Xmla4f5BcaBK0DHDjyK F9fY4C4nCyhmoQjeSM6GuYPQvUD8KAoftP3NZc9Dar6dE6j//SHqB9OfXLyOBtQ9uzQq zx0eIdp+KVrwiEiOIOTkqvPip5i/BXCjio7GeUC4azDYobvCWuIl0LizVsAbamkVj+aH enXhpkeAkGenj10UMnEClTwTuFJLj/obWElr7QNxQBZN3C782FeafdrEBycsJwOOEAWF 8v1Q== X-Gm-Message-State: ANhLgQ1jsLf5JfaAiundoHak9i4ABXrUL4CsepuL6itp2Xxn9kPVMlCc b/kHwebEOQqq+xUX4O12E9ySfz+pTVZYefB4EXTQpB/9CsSxZTwrwriKpxKjppeWGyPK4LFlsd2 4nIvMoolagUHMumfe24+Nvf3o62B4Y3D4FoxBSeDgTg== X-Received: by 2002:a17:90a:32c1:: with SMTP id l59mr1218852pjb.36.1583897087296; Tue, 10 Mar 2020 20:24:47 -0700 (PDT) X-Received: by 2002:a17:90a:32c1:: with SMTP id l59mr1218820pjb.36.1583897086766; Tue, 10 Mar 2020 20:24:46 -0700 (PDT) Received: from [192.168.1.208] (220-133-187-190.HINET-IP.hinet.net. [220.133.187.190]) by smtp.gmail.com with ESMTPSA id h24sm7942000pfn.49.2020.03.10.20.24.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 10 Mar 2020 20:24:46 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 13.0 \(3608.60.0.2.5\)) Subject: Re: [PATCH v4] drm/i915: Init lspcon after HPD in intel_dp_detect() From: Kai-Heng Feng In-Reply-To: <20200214175646.25532-1-kai.heng.feng@canonical.com> Date: Wed, 11 Mar 2020 11:24:37 +0800 Cc: David Airlie , Daniel Vetter , =?utf-8?Q?Jos=C3=A9_Roberto_de_Souza?= , Lucas De Marchi , Imre Deak , Chris Wilson , Manasi Navare , Gwan-gyeong Mun , Matt Roper , Maarten Lankhorst , Ramalingam C , Uma Shankar , intel-gfx@lists.freedesktop.org, "open list:DRM DRIVERS" , open list Content-Transfer-Encoding: 8BIT Message-Id: <6AA2A997-76BB-4BF9-B292-67A5F0C4770B@canonical.com> References: <20200214175646.25532-1-kai.heng.feng@canonical.com> To: Jani Nikula , ville.syrjala@linux.intel.com, joonas.lahtinen@linux.intel.com, rodrigo.vivi@intel.com X-Mailer: Apple Mail (2.3608.60.0.2.5) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > On Feb 15, 2020, at 01:56, Kai-Heng Feng wrote: > > On HP 800 G4 DM, if HDMI cable isn't plugged before boot, the HDMI port > becomes useless and never responds to cable hotplugging: > [ 3.031904] [drm:lspcon_init [i915]] *ERROR* Failed to probe lspcon > [ 3.031945] [drm:intel_ddi_init [i915]] *ERROR* LSPCON init failed on port D > > Seems like the lspcon chip on the system in question only gets powered > after the cable is plugged. > > So let's call lspcon_init() dynamically to properly initialize the > lspcon chip and make HDMI port work. > > Signed-off-by: Kai-Heng Feng A gentle ping. > --- > v4: > - Trust VBT in intel_infoframe_init(). > - Init lspcon in intel_dp_detect(). > > v3: > - Make sure it's handled under long HPD case. > > v2: > - Move lspcon_init() inside of intel_dp_hpd_pulse(). > > drivers/gpu/drm/i915/display/intel_ddi.c | 17 +---------------- > drivers/gpu/drm/i915/display/intel_dp.c | 13 ++++++++++++- > drivers/gpu/drm/i915/display/intel_hdmi.c | 2 +- > 3 files changed, 14 insertions(+), 18 deletions(-) > > diff --git a/drivers/gpu/drm/i915/display/intel_ddi.c b/drivers/gpu/drm/i915/display/intel_ddi.c > index 33f1dc3d7c1a..ca717434b406 100644 > --- a/drivers/gpu/drm/i915/display/intel_ddi.c > +++ b/drivers/gpu/drm/i915/display/intel_ddi.c > @@ -4741,7 +4741,7 @@ void intel_ddi_init(struct drm_i915_private *dev_priv, enum port port) > &dev_priv->vbt.ddi_port_info[port]; > struct intel_digital_port *intel_dig_port; > struct intel_encoder *encoder; > - bool init_hdmi, init_dp, init_lspcon = false; > + bool init_hdmi, init_dp; > enum phy phy = intel_port_to_phy(dev_priv, port); > > init_hdmi = port_info->supports_dvi || port_info->supports_hdmi; > @@ -4754,7 +4754,6 @@ void intel_ddi_init(struct drm_i915_private *dev_priv, enum port port) > * is initialized before lspcon. > */ > init_dp = true; > - init_lspcon = true; > init_hdmi = false; > DRM_DEBUG_KMS("VBT says port %c has lspcon\n", port_name(port)); > } > @@ -4833,20 +4832,6 @@ void intel_ddi_init(struct drm_i915_private *dev_priv, enum port port) > goto err; > } > > - if (init_lspcon) { > - if (lspcon_init(intel_dig_port)) > - /* TODO: handle hdmi info frame part */ > - DRM_DEBUG_KMS("LSPCON init success on port %c\n", > - port_name(port)); > - else > - /* > - * LSPCON init faied, but DP init was success, so > - * lets try to drive as DP++ port. > - */ > - DRM_ERROR("LSPCON init failed on port %c\n", > - port_name(port)); > - } > - > intel_infoframe_init(intel_dig_port); > > return; > diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c > index c7424e2a04a3..43117aa86292 100644 > --- a/drivers/gpu/drm/i915/display/intel_dp.c > +++ b/drivers/gpu/drm/i915/display/intel_dp.c > @@ -5663,8 +5663,19 @@ intel_dp_detect(struct drm_connector *connector, > /* Can't disconnect eDP */ > if (intel_dp_is_edp(intel_dp)) > status = edp_detect(intel_dp); > - else if (intel_digital_port_connected(encoder)) > + else if (intel_digital_port_connected(encoder)) { > + if (intel_bios_is_lspcon_present(dev_priv, dig_port->base.port) && > + !dig_port->lspcon.active) { > + if (lspcon_init(dig_port)) > + DRM_DEBUG_KMS("LSPCON init success on port %c\n", > + port_name(dig_port->base.port)); > + else > + DRM_DEBUG_KMS("LSPCON init failed on port %c\n", > + port_name(dig_port->base.port)); > + } > + > status = intel_dp_detect_dpcd(intel_dp); > + } > else > status = connector_status_disconnected; > > diff --git a/drivers/gpu/drm/i915/display/intel_hdmi.c b/drivers/gpu/drm/i915/display/intel_hdmi.c > index 93ac0f296852..27a5aa8cefc9 100644 > --- a/drivers/gpu/drm/i915/display/intel_hdmi.c > +++ b/drivers/gpu/drm/i915/display/intel_hdmi.c > @@ -3100,7 +3100,7 @@ void intel_infoframe_init(struct intel_digital_port *intel_dig_port) > intel_dig_port->set_infoframes = g4x_set_infoframes; > intel_dig_port->infoframes_enabled = g4x_infoframes_enabled; > } else if (HAS_DDI(dev_priv)) { > - if (intel_dig_port->lspcon.active) { > + if (intel_bios_is_lspcon_present(dev_priv, intel_dig_port->base.port)) { > intel_dig_port->write_infoframe = lspcon_write_infoframe; > intel_dig_port->read_infoframe = lspcon_read_infoframe; > intel_dig_port->set_infoframes = lspcon_set_infoframes; > -- > 2.17.1 >