From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ed1-f68.google.com ([209.85.208.68]:34988 "EHLO mail-ed1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727012AbeJEOMH (ORCPT ); Fri, 5 Oct 2018 10:12:07 -0400 Received: by mail-ed1-f68.google.com with SMTP id y19-v6so10768242edd.2 for ; Fri, 05 Oct 2018 00:14:43 -0700 (PDT) Date: Fri, 5 Oct 2018 09:14:40 +0200 From: Daniel Vetter To: Lyude Paul Cc: nouveau@lists.freedesktop.org, dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, Daniel Vetter , Jani Nikula , stable@vger.kernel.org, Ben Skeggs , David Airlie , Ville =?iso-8859-1?Q?Syrj=E4l=E4?= , Thierry Reding , linux-kernel@vger.kernel.org Subject: Re: [PATCH v4 2/5] drm/nouveau: Fix nv50_mstc->best_encoder() Message-ID: <20181005071440.GU31561@phenom.ffwll.local> References: <20181005002956.7317-1-lyude@redhat.com> <20181005002956.7317-3-lyude@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181005002956.7317-3-lyude@redhat.com> Sender: stable-owner@vger.kernel.org List-ID: On Thu, Oct 04, 2018 at 08:29:51PM -0400, Lyude Paul wrote: > As mentioned in the previous commit, we currently prevent new modesets > on recently-removed MST connectors by returning no encoder from our > ->best_encoder() callback once the MST port has disappeared. This is > wrong however, because it prevents legacy modesetting users from being > able to disable CRTCs on MST connectors after the connector's respective > topology has disappeared. > > So, fix this by instead by just always returning a valid encoder. > > Signed-off-by: Lyude Paul > Cc: stable@vger.kernel.org > > Changes since v2: > - Remove usage of atomic MST helper for now, since that got replaced > with a much simpler solution > > Signed-off-by: Lyude Paul Reviewed-by: Daniel Vetter > --- > drivers/gpu/drm/nouveau/dispnv50/disp.c | 14 ++++---------- > 1 file changed, 4 insertions(+), 10 deletions(-) > > diff --git a/drivers/gpu/drm/nouveau/dispnv50/disp.c b/drivers/gpu/drm/nouveau/dispnv50/disp.c > index 5691dfa1db6f..63a23a80f279 100644 > --- a/drivers/gpu/drm/nouveau/dispnv50/disp.c > +++ b/drivers/gpu/drm/nouveau/dispnv50/disp.c > @@ -843,22 +843,16 @@ nv50_mstc_atomic_best_encoder(struct drm_connector *connector, > { > struct nv50_head *head = nv50_head(connector_state->crtc); > struct nv50_mstc *mstc = nv50_mstc(connector); > - if (mstc->port) { > - struct nv50_mstm *mstm = mstc->mstm; > - return &mstm->msto[head->base.index]->encoder; > - } > - return NULL; > + > + return &mstc->mstm->msto[head->base.index]->encoder; > } > > static struct drm_encoder * > nv50_mstc_best_encoder(struct drm_connector *connector) > { > struct nv50_mstc *mstc = nv50_mstc(connector); > - if (mstc->port) { > - struct nv50_mstm *mstm = mstc->mstm; > - return &mstm->msto[0]->encoder; > - } > - return NULL; > + > + return &mstc->mstm->msto[0]->encoder; > } > > static enum drm_mode_status > -- > 2.17.1 > -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch