From patchwork Thu Aug 6 13:37:08 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maarten Lankhorst X-Patchwork-Id: 6958841 Return-Path: X-Original-To: patchwork-intel-gfx@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 8856CC05AC for ; Thu, 6 Aug 2015 13:37:13 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9E6A1206F8 for ; Thu, 6 Aug 2015 13:37:12 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 995C8206F6 for ; Thu, 6 Aug 2015 13:37:11 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id EC2137A0FF; Thu, 6 Aug 2015 06:37:10 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by gabe.freedesktop.org (Postfix) with ESMTP id 118D07A0FF for ; Thu, 6 Aug 2015 06:37:10 -0700 (PDT) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga103.fm.intel.com with ESMTP; 06 Aug 2015 06:37:10 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.15,622,1432623600"; d="scan'208";a="763271244" Received: from spmyler-mobl.ger.corp.intel.com (HELO patser.lan) ([10.252.20.94]) by fmsmga001.fm.intel.com with ESMTP; 06 Aug 2015 06:37:08 -0700 To: Daniel Vetter References: <1438771031-23227-4-git-send-email-maarten.lankhorst@linux.intel.com> <1438861657-14109-1-git-send-email-maarten.lankhorst@linux.intel.com> <20150806125924.GL17734@phenom.ffwll.local> From: Maarten Lankhorst Message-ID: <55C36304.6060305@linux.intel.com> Date: Thu, 6 Aug 2015 15:37:08 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 MIME-Version: 1.0 In-Reply-To: <20150806125924.GL17734@phenom.ffwll.local> Cc: intel-gfx@lists.freedesktop.org Subject: Re: [Intel-gfx] [PATCH v3.1 1/3] drm/i915: Fix broken mst get_hw_state. 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=-4.3 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, 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 Op 06-08-15 om 14:59 schreef Daniel Vetter: > On Thu, Aug 06, 2015 at 01:47:35PM +0200, Maarten Lankhorst wrote: >> This function always returned false because intel_connector->encoder >> is always NULL. Instead use the attached encoder from atomic. > Note that you've broken this since you removed the updating of > intel_connector->encoder somewhere in the 4.3 atomic series. So this is a > regression fix. Can you please digg out the right commit? Looks like 'Use full atomic modeset' broke it. intel_connector->encoder was updated in its set_config function.. Would below amend for this commit be good? >> Signed-off-by: Maarten Lankhorst >> --- >> drivers/gpu/drm/i915/intel_dp_mst.c | 7 +++++-- >> 1 file changed, 5 insertions(+), 2 deletions(-) >> >> diff --git a/drivers/gpu/drm/i915/intel_dp_mst.c b/drivers/gpu/drm/i915/intel_dp_mst.c >> index e3a5864160fa..ff01569158ea 100644 >> --- a/drivers/gpu/drm/i915/intel_dp_mst.c >> +++ b/drivers/gpu/drm/i915/intel_dp_mst.c >> @@ -395,9 +395,12 @@ static const struct drm_encoder_funcs intel_dp_mst_enc_funcs = { >> >> static bool intel_dp_mst_get_hw_state(struct intel_connector *connector) >> { >> - if (connector->encoder) { >> + struct intel_encoder *encoder; >> + >> + encoder = to_intel_encoder(connector->base.state->best_encoder); > Strictly speaking this won't work for hw state readout since what we > really need to do is ask the mst connector which mst stream it accepts and > then compare that with all the mst encoders ... It's good enough to make sure the encoder callbacks did run. > But that's been broken since forever. Only side-effect here is that > fastboot won't work with mst and that's imo totally ok. Please also add > this to your commit message. HW readout runs before mst probing, so you wouldn't get the mst connectors anyway with fastboot. Not sure it needs a fixme. :-) diff --git a/drivers/gpu/drm/i915/intel_dp_mst.c b/drivers/gpu/drm/i915/intel_dp_mst.c index ee2a77144373..671715ba8538 100644 --- a/drivers/gpu/drm/i915/intel_dp_mst.c +++ b/drivers/gpu/drm/i915/intel_dp_mst.c @@ -173,6 +173,11 @@ static void intel_mst_pre_enable_dp(struct intel_encoder *encoder) return; } + /* MST encoders are bound to a crtc, not to a connector, + * force the mapping here for get_hw_state. + */ + found->encoder = encoder; + DRM_DEBUG_KMS("%d\n", intel_dp->active_mst_links); intel_mst->port = found->port; And corresponding amendment to the convert connector to atomic.. diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index a6617283b1bd..90caa62cf2c3 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c @@ -6313,7 +6313,7 @@ static void intel_connector_check_state(struct intel_connector *connector) I915_STATE_WARN(!crtc->state->active, "connector is active, but attached crtc isn't\n"); - if (!encoder) + if (!encoder || encoder->type == INTEL_OUTPUT_DP_MST) return; I915_STATE_WARN(conn_state->best_encoder != encoder,