Received: by 10.213.65.68 with SMTP id h4csp1013076imn; Fri, 6 Apr 2018 12:54:38 -0700 (PDT) X-Google-Smtp-Source: AIpwx49dtNeHPa3AWHUGrszZBF4Uu3xDIULZ5DhH3MB8aZ/iy5mqn1KwkRZtBn63+YJH2s1YZDc6 X-Received: by 2002:a17:902:c6:: with SMTP id a64-v6mr28492964pla.408.1523044478255; Fri, 06 Apr 2018 12:54:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523044478; cv=none; d=google.com; s=arc-20160816; b=C5VpAkqY5cywuTZ8AsS1GkrzVOD7qNTZFz0xv9IW/kU82FZj5WRL+3+T11fjw49/aQ h2+2qkHx5ojZHN6XQdkrny6x+e1JWogDqMzfThQjNyUyDrvFNRr5dvuA2wcGAXyEzOD0 9z+7MGIPLfoT3x1Mru3Yip0WPw5M5UUbBjjgGhZo1D7kakiM5PC2F3yeIJeuh5T6Jc/I PY42+xvBdSRNn63QCJj69PMbgfbbQq+2kOXISX3z2LWnTJRx0bqCWrO49jlR9J8hWlnm gawOLSlFyPWdqWB7sdOKSwKEroRtgq2GJ6aXHDcrSeY1J3+stIuKUqTBfJtg94EzO6Tw URCg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :organization:references:in-reply-to:date:cc:to:from:subject :message-id:arc-authentication-results; bh=DqKUPaGPFfsaymtWynbMLhRs0aCiQkIwL1ZO5ScoOxk=; b=YJ1nMk6C5O9H3Pt9Qtwyk5fzdZDfvNDZXmaFJi76dq4KE7rPs0wsqQ8AMl0njEiVnl p75Z4FwNVk4MFa6I0clwyGnKZiwmPU1JLKIpbq8zbkQnFDzeObqM1DaQEB+hfJEjfZFV cdSqByJRl2g0ZMgZ2NYq8xWBGXnbx2PhWkfFkTWsUF2FfUz+9HQnmqEtCcAEVJCgpuWi r+AkK/OvXmNnoyqPqcM11qANl5k0q0CezuXSkTNWrWgoY/jvYT3tcYVolgOAr0j8jSQ8 LXULDqLzaxXeeSUT2NHDr8B5ddBF07lyXZ6T4BovIF5uWmFs68m8mZ3BHy1LNPV1Uz4s foFg== 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x3-v6si9322307plo.479.2018.04.06.12.54.00; Fri, 06 Apr 2018 12:54:38 -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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751643AbeDFTtw (ORCPT + 99 others); Fri, 6 Apr 2018 15:49:52 -0400 Received: from mail-qt0-f193.google.com ([209.85.216.193]:44598 "EHLO mail-qt0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751488AbeDFTtu (ORCPT ); Fri, 6 Apr 2018 15:49:50 -0400 Received: by mail-qt0-f193.google.com with SMTP id j26so2375010qtl.11 for ; Fri, 06 Apr 2018 12:49:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:organization:mime-version:content-transfer-encoding; bh=DqKUPaGPFfsaymtWynbMLhRs0aCiQkIwL1ZO5ScoOxk=; b=aU3K0MOJyLkzsnloZ7C31iJe41sJZG7Nl3PwNrUDnUGWO1ftrnxEHLrFCR6L+AYApb WBgYpHRXVItIunj/bCCk12x30rpQLc2LEFuO7nGSCXN6m/Tai7jj83phEfJgOtpqgoeL +KelrVrDSWWeyTQ/8WqrUaPBnmhLVegmEBj8GRQYtg9fTMGmzU8+n310gA81HbBc/d1M SXkgJIZXu9wB2PoI5408oED8WXpzl+VuQ83ISB9LBdkD7x9tY2jnD4ZktTLXVU+VkW0u JqkhWwG2FOmW+hYnU81pkGHtWFssBxsnJZbdhoxkffkgreCwLP74Rju30TJU1ru4wvWY /4dw== X-Gm-Message-State: ALQs6tBD7PBMZMZJTt+HeYu/QUFPKlertamj7ydI37upBzg4zUffi1b3 23ACSxgSRnd36nwBEa105ClJfw== X-Received: by 10.237.35.137 with SMTP id j9mr40840588qtc.181.1523044189855; Fri, 06 Apr 2018 12:49:49 -0700 (PDT) Received: from dhcp-10-20-1-55.bss.redhat.com ([144.121.20.162]) by smtp.gmail.com with ESMTPSA id o4sm8420360qkl.69.2018.04.06.12.49.48 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 06 Apr 2018 12:49:49 -0700 (PDT) Message-ID: <1523044187.12587.14.camel@redhat.com> Subject: Re: [PATCH v4] drm/i915/dp: Send DPCD ON for MST before phy_up From: Lyude Paul To: Laura Abbott , intel-gfx@lists.freedesktop.org Cc: Dhinakaran Pandiyan , Ville =?ISO-8859-1?Q?Syrj=E4l=E4?= , stable@vger.kernel.org, Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , David Airlie , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Date: Fri, 06 Apr 2018 15:49:47 -0400 In-Reply-To: <9705da91-6db6-a18b-993a-5676913eaeb8@redhat.com> References: <20180406185249.22952-1-lyude@redhat.com> <9705da91-6db6-a18b-993a-5676913eaeb8@redhat.com> Organization: Red Hat Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.26.6 (3.26.6-1.fc27) Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 2018-04-06 at 12:48 -0700, Laura Abbott wrote: > On 04/06/2018 11:52 AM, Lyude Paul wrote: > > When doing a modeset where the sink is transitioning from D3 to D0 , it > > would sometimes be possible for the initial power_up_phy() to start > > timing out. This would only be observed in the last action before the > > sink went into D3 mode was intel_dp_sink_dpms(DRM_MODE_DPMS_OFF). We > > originally thought this might be an issue with us accidentally shutting > > off the aux block when putting the sink into D3, but since the DP spec > > mandates that sinks must wake up within 1ms while we have 100ms to > > respond to an ESI irq, this didn't really add up. Turns out that the > > problem is more subtle then that: > > > > It turns out that the timeout is from us not enabling DPMS on the MST > > hub before actually trying to initiate sideband communications. This > > would cause the first sideband communication (power_up_phy()), to start > > timing out because the sink wasn't ready to respond. Afterwards, we > > would call intel_dp_sink_dpms(DRM_MODE_DPMS_ON) in > > intel_ddi_pre_enable_dp(), which would actually result in waking up the > > sink so that sideband requests would work again. > > > > Since DPMS is what lets us actually bring the hub up into a state where > > sideband communications become functional again, we just need to make > > sure to enable DPMS on the display before attempting to perform sideband > > communications. > > > > Changes since v1: > > - Remove comment above if (!intel_dp->is_mst) - vsryjala > > - Move intel_dp_sink_dpms() for MST into intel_dp_post_disable_mst() to > > keep enable/disable paths symmetrical > > - Improve commit message - dhnkrn > > Changes since v2: > > - Only send DPMS off when we're disabling the last sink, and only send > > DPMS on when we're enabling the first sink - dhnkrn > > Changes since v3: > > - Check against is_mst, not intel_dp->is_mst - dhnkrn/vsyrjala > > > > For the booting docked with lid down case: > > Tested-by: Laura Abbott Awesome, will push once the CI run finishes. Thanks for the help! > > > Signed-off-by: Lyude Paul > > Cc: Dhinakaran Pandiyan > > Cc: Ville Syrjälä > > Cc: Laura Abbott > > Cc: stable@vger.kernel.org > > Fixes: ad260ab32a4d9 ("drm/i915/dp: Write to SET_POWER dpcd to enable MST > > hub.") > > --- > > drivers/gpu/drm/i915/intel_ddi.c | 8 ++++++-- > > drivers/gpu/drm/i915/intel_dp_mst.c | 8 +++++++- > > 2 files changed, 13 insertions(+), 3 deletions(-) > > > > diff --git a/drivers/gpu/drm/i915/intel_ddi.c > > b/drivers/gpu/drm/i915/intel_ddi.c > > index a6672a9abd85..92cb26b18a9b 100644 > > --- a/drivers/gpu/drm/i915/intel_ddi.c > > +++ b/drivers/gpu/drm/i915/intel_ddi.c > > @@ -2324,7 +2324,8 @@ static void intel_ddi_pre_enable_dp(struct > > intel_encoder *encoder, > > intel_prepare_dp_ddi_buffers(encoder, crtc_state); > > > > intel_ddi_init_dp_buf_reg(encoder); > > - intel_dp_sink_dpms(intel_dp, DRM_MODE_DPMS_ON); > > + if (!is_mst) > > + intel_dp_sink_dpms(intel_dp, DRM_MODE_DPMS_ON); > > intel_dp_start_link_train(intel_dp); > > if (port != PORT_A || INTEL_GEN(dev_priv) >= 9) > > intel_dp_stop_link_train(intel_dp); > > @@ -2422,12 +2423,15 @@ static void intel_ddi_post_disable_dp(struct > > intel_encoder *encoder, > > struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); > > struct intel_digital_port *dig_port = enc_to_dig_port(&encoder- > > >base); > > struct intel_dp *intel_dp = &dig_port->dp; > > + bool is_mst = intel_crtc_has_type(old_crtc_state, > > + INTEL_OUTPUT_DP_MST); > > > > /* > > * Power down sink before disabling the port, otherwise we end > > * up getting interrupts from the sink on detecting link loss. > > */ > > - intel_dp_sink_dpms(intel_dp, DRM_MODE_DPMS_OFF); > > + if (!is_mst) > > + intel_dp_sink_dpms(intel_dp, DRM_MODE_DPMS_OFF); > > > > intel_disable_ddi_buf(encoder); > > > > diff --git a/drivers/gpu/drm/i915/intel_dp_mst.c > > b/drivers/gpu/drm/i915/intel_dp_mst.c > > index c3de0918ee13..9e6956c08688 100644 > > --- a/drivers/gpu/drm/i915/intel_dp_mst.c > > +++ b/drivers/gpu/drm/i915/intel_dp_mst.c > > @@ -180,9 +180,11 @@ static void intel_mst_post_disable_dp(struct > > intel_encoder *encoder, > > intel_dp->active_mst_links--; > > > > intel_mst->connector = NULL; > > - if (intel_dp->active_mst_links == 0) > > + if (intel_dp->active_mst_links == 0) { > > + intel_dp_sink_dpms(intel_dp, DRM_MODE_DPMS_OFF); > > intel_dig_port->base.post_disable(&intel_dig_port->base, > > old_crtc_state, NULL); > > + } > > > > DRM_DEBUG_KMS("active links %d\n", intel_dp->active_mst_links); > > } > > @@ -223,7 +225,11 @@ static void intel_mst_pre_enable_dp(struct > > intel_encoder *encoder, > > > > DRM_DEBUG_KMS("active links %d\n", intel_dp->active_mst_links); > > > > + if (intel_dp->active_mst_links == 0) > > + intel_dp_sink_dpms(intel_dp, DRM_MODE_DPMS_ON); > > + > > drm_dp_send_power_updown_phy(&intel_dp->mst_mgr, connector- > > >port, true); > > + > > if (intel_dp->active_mst_links == 0) > > intel_dig_port->base.pre_enable(&intel_dig_port->base, > > pipe_config, NULL); > > > > -- Cheers, Lyude Paul