Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp5646496img; Wed, 27 Mar 2019 12:21:58 -0700 (PDT) X-Google-Smtp-Source: APXvYqxTQnVCk/QE9BJbsTaLm1oWAUoy5mKzNk92ks3f3oW1hBNLDatchLmkf5TVuyuUhhSJaqvz X-Received: by 2002:a63:6bc6:: with SMTP id g189mr36403075pgc.427.1553714518124; Wed, 27 Mar 2019 12:21:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553714518; cv=none; d=google.com; s=arc-20160816; b=zWuPsdit0CSk1YXSGhvrBUrdM/WClamLjUo9Zt8eyd/uwwAPmnsf36jZy+p9skQ6SK MrbD004ulg1MKMXfYQy0udTIUSacAeNwe5m6uTYlPD+KVU+VEiWEuTdMMVx/8gUO/ouV IMY+p0FcDDpzL4dp4q+l/SOKFGbbBiwZ278HTaqHuq2TSuAuCt7zkA+uLv3P6D59klqJ 4AeO6mkUa28BrIcSYC9Ey3ocXznokAuEwJXbHdJGMwKI1ywmFWiX1cpw6UEuwpu884yJ HjcPfWUEGiJ6/APRfq0aIzyvMpSVpOa1pU7edOM+nUSGpChUZ2jo6z42v1UsAnqCRxiW gkCA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=IdkwZ/BwcpOEXHIrGnHlArlw/MlZI6g0YAYw7/I9noE=; b=EiZVVTV9iaUkWzKsuv5yZc0cKEZK/eEGyxX98eHnUAoIPJD5Gxb6PXMcPHa5RQcvjS oE3Ubb9aLRLpVpiE9LACNHkmYU2MC/ijLLY66PhI3FoLs0350jaYoKHdBQ877bHIld8h 6upNnUsnAgEOCASS5RqpUS6JeP1sYjw2BwsDLMyuxCzDbajoTos3++p0VPuTzGixeUi9 Pq2VrStbEw0fl0u8nbCqwaBTK54XtuerG6PQoKJzrJ9SNNi0mb7BKvhLHtCe2RpZNj/A F79znnUAayfxbTdGQ2h3CSf31Gdk5YJYgvKWpd7NSejQXeUdOsN62IqqAh5kHg5a00ou MaAg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=I6LOScpi; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v12si5561545pfe.11.2019.03.27.12.21.42; Wed, 27 Mar 2019 12:21:58 -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; dkim=pass header.i=@kernel.org header.s=default header.b=I6LOScpi; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388525AbfC0TT4 (ORCPT + 99 others); Wed, 27 Mar 2019 15:19:56 -0400 Received: from mail.kernel.org ([198.145.29.99]:49418 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388208AbfC0SHd (ORCPT ); Wed, 27 Mar 2019 14:07:33 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E1710217D9; Wed, 27 Mar 2019 18:07:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1553710052; bh=bX4pBVz/3iw4BZm1qrpNl4QIZCV1Uj/5LGwYhZDu13s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=I6LOScpivMLjUz2gchQAjZQ2UbWPIEHoJROOjnXpVxnylVBFBooB15JLkARkcwyrD tfSG8FAkyknhjqq6+VS1f0/CxAs5TejqSWpZQIBm2KbBMdoD3w6sCFkR28HMFYx8o2 Nqn4tPTzznYiXRt7FA5WMA6gGAcKHH18KVOGBsWg= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Nicholas Kazlauskas , Alex Deucher , Sasha Levin , amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org Subject: [PATCH AUTOSEL 5.0 175/262] drm/amd/display: Disconnect mpcc when changing tg Date: Wed, 27 Mar 2019 14:00:30 -0400 Message-Id: <20190327180158.10245-175-sashal@kernel.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190327180158.10245-1-sashal@kernel.org> References: <20190327180158.10245-1-sashal@kernel.org> MIME-Version: 1.0 X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Nicholas Kazlauskas [ Upstream commit 77476360f173c127c191bfe8ca8113130ef283b8 ] [Why] This fixes an mpc programming error for the following sequence of atomic commits when pipe split is enabled: Commit 1: CRTC0 (plane 4, plane 3) Pipe 0: old_plane_state = A0, new_plane_state = A1, new_tg = T0 Pipe 1: old_plane_state = B0, new_plane_state = B1, new_tg = T0 Pipe 2: old_plane_state = A0, new_plane_state = A1, new_tg = T0 Pipe 3: old_plane_state = B0, new_plane_state = B1, new_tg = T0 Commit 2: CRTC0 (plane 3), CRTC1 (plane 2) Pipe 0: old_plane_state = A1, new_plane_state = A2, new_tg = T0 Pipe 1: old_plane_state = B1, new_plane_state = B2, new_tg = T1 Pipe 2: old_plane_state = A1, new_plane_state = NULL, new_tg = NULL Pipe 3: old_plane_state = B1, new_plane_state = NULL, new_tg = NULL In the second commit the assertion for mpcc in use is hit because mpcc disconnect never occurs for pipe 1. This is because the stream changes for pipe 1 and the opp_list is empty. This sequence occurs when running the "igt@kms_plane_multiple@atomic-pipe-A-tiling-none" test with two displays connected. [How] Expand the reset condition to include: "old_pipe_ctx->stream_res.tg != new_pipe_ctx->stream_res.tg" ...but only when the plane state is non-NULL for both old and new. Signed-off-by: Nicholas Kazlauskas Reviewed-by: Dmytro Laktyushkin Reviewed-by: Tony Cheng Acked-by: Bhawanpreet Lakha Signed-off-by: Alex Deucher Signed-off-by: Sasha Levin --- drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c index 41883c981789..a684b38332ac 100644 --- a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c +++ b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c @@ -2334,9 +2334,10 @@ static void dcn10_apply_ctx_for_surface( } } - if (!pipe_ctx->plane_state && - old_pipe_ctx->plane_state && - old_pipe_ctx->stream_res.tg == tg) { + if ((!pipe_ctx->plane_state || + pipe_ctx->stream_res.tg != old_pipe_ctx->stream_res.tg) && + old_pipe_ctx->plane_state && + old_pipe_ctx->stream_res.tg == tg) { dc->hwss.plane_atomic_disconnect(dc, old_pipe_ctx); removed_pipe[i] = true; -- 2.19.1