Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C96B8C77B73 for ; Mon, 1 May 2023 02:57:09 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4CEA610E1AF; Mon, 1 May 2023 02:57:09 +0000 (UTC) Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by gabe.freedesktop.org (Postfix) with ESMTPS id 33B7B10E1AF; Mon, 1 May 2023 02:57:08 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id A098A6156B; Mon, 1 May 2023 02:57:07 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4E7DBC433D2; Mon, 1 May 2023 02:57:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1682909827; bh=Q5V3XkPnOp0weVuJjXO5IuH8sadfGn1IJWa1qHDB3Po=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kYyad7BIBlIe2llN/L5uP2zPL9VT7cHnkbbAR3Cz9UM79a9wNqWGgh4WBSLZl1SB+ nAOGUUYf+9wsXQDgQOa3212X2BvndTJzzABVaUQfZ0GtWJf9dRZH4RXcNihHa22UAh AmydePtWNm4gYJq4XO7O2rPHyKOK3QPBrH1IsLs7IpmOv2laiOkf1ql31xOIgeKbMk IcZviUi34n0doFSUe2/6GNmbnPhHXwCnvCTYduFsva2u5upF3dOnXsrgeRXr40Hec5 fD0fovDz+5ceGGjmQEBpJwbou0cbund2x7G3fYXnX+SqIyK5uD6c+xR+CHrFBiqH+K 7rnmQg/0O9rLg== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: [PATCH AUTOSEL 6.3 06/44] drm/amd/display: Enable HostVM based on rIOMMU active Date: Sun, 30 Apr 2023 22:55:54 -0400 Message-Id: <20230501025632.3253067-6-sashal@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230501025632.3253067-1-sashal@kernel.org> References: <20230501025632.3253067-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit X-BeenThere: amd-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion list for AMD gfx List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Sasha Levin , Charlene.Liu@amd.com, chiahsuan.chung@amd.com, christian.koenig@amd.com, sunpeng.li@amd.com, airlied@gmail.com, Qingqing Zhuo , Xinhui.Pan@amd.com, Rodrigo.Siqueira@amd.com, duncan.ma@amd.com, amd-gfx@lists.freedesktop.org, Gabe Teeger , Daniel Wheeler , dri-devel@lists.freedesktop.org, daniel@ffwll.ch, Alex Deucher , Jun.Lei@amd.com, harry.wentland@amd.com, nicholas.kazlauskas@amd.com, muansari@amd.com, Pavle.Kotarac@amd.com Errors-To: amd-gfx-bounces@lists.freedesktop.org Sender: "amd-gfx" From: Gabe Teeger [ Upstream commit 97fa4dfa66fdd52ad3d0c9fadeaaa1e87605bac7 ] [Why] There is underflow and flickering occuring. The underflow stops when hostvm is forced to active. According to policy, hostvm should be enabled if riommu is active, but this is not taken into account when deciding whether to enable hostvm. [What] For DCN314, set hostvm to true if riommu is active. Reviewed-by: Nicholas Kazlauskas Acked-by: Qingqing Zhuo Signed-off-by: Gabe Teeger Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher Signed-off-by: Sasha Levin --- drivers/gpu/drm/amd/display/dc/dml/dcn314/dcn314_fpu.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/gpu/drm/amd/display/dc/dml/dcn314/dcn314_fpu.c b/drivers/gpu/drm/amd/display/dc/dml/dcn314/dcn314_fpu.c index acda3e1babd4a..c52b76610bd29 100644 --- a/drivers/gpu/drm/amd/display/dc/dml/dcn314/dcn314_fpu.c +++ b/drivers/gpu/drm/amd/display/dc/dml/dcn314/dcn314_fpu.c @@ -308,6 +308,10 @@ int dcn314_populate_dml_pipes_from_context_fpu(struct dc *dc, struct dc_state *c pipe->plane_state->src_rect.width < pipe->plane_state->dst_rect.width)) upscaled = true; + /* Apply HostVM policy - either based on hypervisor globally enabled, or rIOMMU active */ + if (dc->debug.dml_hostvm_override == DML_HOSTVM_NO_OVERRIDE) + pipes[i].pipe.src.hostvm = dc->vm_pa_config.is_hvm_enabled || dc->res_pool->hubbub->riommu_active; + /* * Immediate flip can be set dynamically after enabling the plane. * We need to require support for immediate flip or underflow can be -- 2.39.2