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 B63F3C7EE23 for ; Mon, 1 May 2023 03:02:57 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 15AC510E295; Mon, 1 May 2023 03:02:57 +0000 (UTC) Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0CFEE10E294; Mon, 1 May 2023 03:02:55 +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 7D24361029; Mon, 1 May 2023 03:02:54 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B5A55C433EF; Mon, 1 May 2023 03:02:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1682910173; bh=ewJKqzaKcI/hIougznpydBKePY70WXZNT/Q2MoPqZGM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sUAvT+1c9DzpBBVwG8nYC6KO2r71M+ZEpmAc8WjqwpwiTpx18uXoYGdx3W20MaQQD IUMWgyRqKqjxOkPmUhH5Evc78sH29qSscJZbuE0lfwlVE4MxXmpdj8/w4zXWB/SI6f pqVsvmx0RHvLpdQRz1BT/SBuTqRZMsKoMFl/IuO62o2lQgW5eOdes7qFGIH+jw/1Cp 5gKoe3fLIOLToBBBvvYV4LJ4+8dfZfWJrDtJUwNZL857ICmvHAsd41KeeCdHSyWqGZ peHNPuqiRWhQW/jJ2d72lgi/nCyEHy+e6LmjAf8n00Aw7ZwsRMk7tN8ExxbMQ8SU70 m2RWl19hgD3oA== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: [PATCH AUTOSEL 6.1 05/33] drm/amd/display: Enable HostVM based on rIOMMU active Date: Sun, 30 Apr 2023 23:01:59 -0400 Message-Id: <20230501030227.3254266-5-sashal@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230501030227.3254266-1-sashal@kernel.org> References: <20230501030227.3254266-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 34b6c763a4554..a9ff071447c2e 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 @@ -310,6 +310,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