drm/nouveau: Fix nv50_mstc->best_encoder()
authorLyude Paul <lyude@redhat.com>
Mon, 8 Oct 2018 23:24:31 +0000 (19:24 -0400)
committerJoonas Lahtinen <joonas.lahtinen@linux.intel.com>
Fri, 19 Oct 2018 08:46:46 +0000 (11:46 +0300)
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.

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 <lyude@redhat.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Ben Skeggs <bskeggs@redhat.com>
Cc: stable@vger.kernel.org
Link: https://patchwork.freedesktop.org/patch/msgid/20181008232437.5571-3-lyude@redhat.com
(cherry picked from commit e87b0bbc9f0380d403f8f2f6abba0d51c74d944f)
Signed-off-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
drivers/gpu/drm/nouveau/dispnv50/disp.c

index 5f163a025e8906b671f653df46c14b4387fe6b3f..9d9a18ab95ecec4eb1030d9da471d84923c39ac6 100644 (file)
@@ -881,22 +881,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