Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2960257imu; Mon, 19 Nov 2018 08:39:10 -0800 (PST) X-Google-Smtp-Source: AJdET5daJ9DBhIE+59kMTZYwqil0pzQklgsiz9AJ7yxd7HI5s4gihSE1DZWImCjduLzAFD0W9xow X-Received: by 2002:a17:902:d206:: with SMTP id t6mr23365221ply.193.1542645550626; Mon, 19 Nov 2018 08:39:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542645550; cv=none; d=google.com; s=arc-20160816; b=dg86DE0eg8eApQyACxJ2PiwvT/c8ps7K1++RZs6lI3s3ub1JKer/MHGYyI0liGuFX+ a4D199yTY2KutiDiJVLGp4XHLJYhqv8RjUT0U5+9t1yL/olBm4s4K/Kgx47lRoyh6ED1 RuPzEgqexohcrrGa04DDXOagE3OzoLWaCZndUgFOcC/GkJ58eBDcBDxpulFr9Wcr1hVO 3AU2Z1uD+DJpPTVoDNdlIbnsYCSUS8OOIC2kQqFSOBtdvNP+Ky/JXGt70eRrFr2/uBGN H6QLYA5kJbLykLRlXrAXzzraprJdxeqwIQIv4p7w/Q5Asnaes9TOKFLLZhk/vFXuHMhV 733Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=LE275Ux29O6qEcqWVV+BXHFgT9x4hy6E8491GjC4JCM=; b=vlVA9eQpVU8QBwogpXg1Kid2cSLBKo8Nh/dE5x+ng4AF6JKEhhJaq+w2b8QQkYZDgs gwfQgRiRt7/g7HZLikDo95Xe8n3213rlabCKN+6TDCu/TP1cRlIRa1iayUZWLlqGup4Z /rWk0quBzJCH1naNAKgy9Fbq4LdzosBEL9ymdAOSI7R2pC62DROZNNccaP9IDmSoNZta u+4fte58VduUx6XiR+FWbitxkrYzaUXdTAFS5Ij7UluNkXD3YMKsBgwZHei3vk+e5+TX JiyL5d4lQAEVXw1njREBXEssSt5o5J3svbb0CFi2JCagY2D1ZRH03+ItU00eDhLx8wVj Bx+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=jFiFo6Fe; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 66-v6si16497007plc.224.2018.11.19.08.38.54; Mon, 19 Nov 2018 08:39:10 -0800 (PST) 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; dkim=pass header.i=@kernel.org header.s=default header.b=jFiFo6Fe; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732387AbeKTDCO (ORCPT + 99 others); Mon, 19 Nov 2018 22:02:14 -0500 Received: from mail.kernel.org ([198.145.29.99]:34398 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732373AbeKTDCL (ORCPT ); Mon, 19 Nov 2018 22:02:11 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 33252206BA; Mon, 19 Nov 2018 16:38:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1542645482; bh=2xtWJ3b6nfKnlpEVHhj1GMQTE3eLbVILL+TAVJyTp2U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jFiFo6FeKrN/+au5yZQSAEoK6ZvQuYEGBKm/ifMvJ5aQR5IySxSGol+8XKW/BsB+Q gYIieHP72fuZ9q9dQHBhMs6zMPvhxssH+VM66SpUwOqOXYknJIo1fdQfi9jT6KoI/2 UXIKt7870EdFzmycQ5SIS6LVndZoq5WExOfOKa3k= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Lyude Paul , Daniel Vetter , Ben Skeggs , Joonas Lahtinen Subject: [PATCH 4.19 178/205] drm/nouveau: Fix nv50_mstc->best_encoder() Date: Mon, 19 Nov 2018 17:28:05 +0100 Message-Id: <20181119162641.024010256@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181119162616.586062722@linuxfoundation.org> References: <20181119162616.586062722@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.19-stable review patch. If anyone has any objections, please let me know. ------------------ From: Lyude Paul commit 7b0f61e91b6056c71649efa3204112a4b6cf5fc8 upstream. 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 Reviewed-by: Daniel Vetter Reviewed-by: Ben Skeggs 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 Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/nouveau/dispnv50/disp.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) --- 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 { 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