aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLyude Paul <lyude@redhat.com>2018-10-08 19:24:31 -0400
committerJoonas Lahtinen <joonas.lahtinen@linux.intel.com>2018-10-19 04:46:46 -0400
commit7b0f61e91b6056c71649efa3204112a4b6cf5fc8 (patch)
tree01131ff6c8323e696b2dcd002baab664462ea395
parentde9f8eea5a44b0b756d3d6345af7f8e630a3c8c0 (diff)
drm/nouveau: Fix nv50_mstc->best_encoder()
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>
-rw-r--r--drivers/gpu/drm/nouveau/dispnv50/disp.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/drivers/gpu/drm/nouveau/dispnv50/disp.c b/drivers/gpu/drm/nouveau/dispnv50/disp.c
index 5f163a025e89..9d9a18ab95ec 100644
--- a/drivers/gpu/drm/nouveau/dispnv50/disp.c
+++ b/drivers/gpu/drm/nouveau/dispnv50/disp.c
@@ -881,22 +881,16 @@ nv50_mstc_atomic_best_encoder(struct drm_connector *connector,
881{ 881{
882 struct nv50_head *head = nv50_head(connector_state->crtc); 882 struct nv50_head *head = nv50_head(connector_state->crtc);
883 struct nv50_mstc *mstc = nv50_mstc(connector); 883 struct nv50_mstc *mstc = nv50_mstc(connector);
884 if (mstc->port) { 884
885 struct nv50_mstm *mstm = mstc->mstm; 885 return &mstc->mstm->msto[head->base.index]->encoder;
886 return &mstm->msto[head->base.index]->encoder;
887 }
888 return NULL;
889} 886}
890 887
891static struct drm_encoder * 888static struct drm_encoder *
892nv50_mstc_best_encoder(struct drm_connector *connector) 889nv50_mstc_best_encoder(struct drm_connector *connector)
893{ 890{
894 struct nv50_mstc *mstc = nv50_mstc(connector); 891 struct nv50_mstc *mstc = nv50_mstc(connector);
895 if (mstc->port) { 892
896 struct nv50_mstm *mstm = mstc->mstm; 893 return &mstc->mstm->msto[0]->encoder;
897 return &mstm->msto[0]->encoder;
898 }
899 return NULL;
900} 894}
901 895
902static enum drm_mode_status 896static enum drm_mode_status