Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp39257imm; Thu, 4 Oct 2018 17:31:35 -0700 (PDT) X-Google-Smtp-Source: ACcGV60r4l63RS5RxwDfSahcm35Y80Wnk4mYqZulIpI+Pb+4/pR2xsDStBukb3YDcfQC/ygn613l X-Received: by 2002:a17:902:585:: with SMTP id f5-v6mr8990139plf.7.1538699495311; Thu, 04 Oct 2018 17:31:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538699495; cv=none; d=google.com; s=arc-20160816; b=ule+8DU7LsCQuxQJhkPqUxLeZRvYzlbBFhFPjLnhEF4RhOogoRt7/XtATpTtsTv5Dh u7SUTctP/Pak71HrCZktaNq/kXPcs/1qssMcjPKdz9nwaS6Gfyy3Jr2Zg6jmCPdGIaNc FabGHADu5u6QASgFL5x3CTbWilQeVLFu0hCY0z99xkClJYwH1NUZff+wljDEm1ePYca4 gFI3uxub1rLUbf75cEXf3/AxQ5NHLpf3ZEWdgcSKpkw7HZbDZCBovwZObM7p0cDE7vNA FQ2P27it70jb+BwWrJjCU3RvltiG7EBtQeae849DGYQbQuCGBJgMWI5zn3HM/z2wuXbj JG0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=oztECzLBGDTdpXHXm88DFR0K4JgqemHIoaUFvQ1IGX0=; b=l+0dzOYgdyI5AqSSexyPHSjVfP+9bSf6DevMiiS+x84YxkDSGEtWqGnYaopTVqmpTR eQMUknr4r2+4rvFcAmFM7bXPyjLgBhBU7AtyKf/xbZuDLDLXqfoGSCZV8yLU+2GVLNb7 bx3oM0F/SSVvL760xcHDbvYEkomG5yOFLI0XZ7ZVdhB/mQfHY6c6TgyfBHNAOF3nUjXg kdFZNz7ckbOz21w4YylP4JBS4CzF2MEX83ex1MKOsHNkTgYEgesBmYdfosydMyzhljCw GtUEDYX8LggjLQ2Q0UldFf3C6PHAbNlmOKiHQ8B+RGC8Q/BYALC7MC5UTa5oVfqJOUsX XFyw== 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 bi5-v6si6690061plb.62.2018.10.04.17.31.17; Thu, 04 Oct 2018 17:31:35 -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 S1727576AbeJEH0W (ORCPT + 99 others); Fri, 5 Oct 2018 03:26:22 -0400 Received: from mx1.redhat.com ([209.132.183.28]:37398 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726073AbeJEH0V (ORCPT ); Fri, 5 Oct 2018 03:26:21 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id AA209300270E; Fri, 5 Oct 2018 00:30:17 +0000 (UTC) Received: from malachite.bss.redhat.com (dhcp-10-20-1-11.bss.redhat.com [10.20.1.11]) by smtp.corp.redhat.com (Postfix) with ESMTP id 68121675DC; Fri, 5 Oct 2018 00:30:16 +0000 (UTC) From: Lyude Paul To: nouveau@lists.freedesktop.org, dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org Cc: Daniel Vetter , Jani Nikula , stable@vger.kernel.org, Ben Skeggs , David Airlie , =?UTF-8?q?Ville=20Syrj=C3=A4l=C3=A4?= , Thierry Reding , linux-kernel@vger.kernel.org Subject: [PATCH v4 2/5] drm/nouveau: Fix nv50_mstc->best_encoder() Date: Thu, 4 Oct 2018 20:29:51 -0400 Message-Id: <20181005002956.7317-3-lyude@redhat.com> In-Reply-To: <20181005002956.7317-1-lyude@redhat.com> References: <20181005002956.7317-1-lyude@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.46]); Fri, 05 Oct 2018 00:30:17 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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