]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
drm/amd/display: Correct updating logic of dcn21's pipe VM flags
authorDale Zhao <dale.zhao@amd.com>
Fri, 27 Mar 2020 12:11:55 +0000 (20:11 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 22 Jun 2020 07:32:31 +0000 (09:32 +0200)
[ Upstream commit 2a28fe92220a116735ef45939b7edcfee83cc6b0 ]

[Why]:
Renoir's pipe VM flags are not correctly updated if pipe strategy has
changed during some scenarios. It will result in watermarks mistakenly
calculation, thus underflow and garbage appear.

[How]:
Correctly update pipe VM flags to pipes which have been populated.

Signed-off-by: Dale Zhao <dale.zhao@amd.com>
Signed-off-by: Sung Lee <sung.lee@amd.com>
Reviewed-by: Yongqiang Sun <yongqiang.sun@amd.com>
Acked-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/amd/display/dc/dcn21/dcn21_resource.c

index a721bb401ef0822cfdedbe384e4c08745bc7f3e1..6d1736cf5c12e33a4488a27e3caf6381afb67f10 100644 (file)
@@ -1694,12 +1694,8 @@ static int dcn21_populate_dml_pipes_from_context(
 {
        uint32_t pipe_cnt = dcn20_populate_dml_pipes_from_context(dc, context, pipes);
        int i;
-       struct resource_context *res_ctx = &context->res_ctx;
 
-       for (i = 0; i < dc->res_pool->pipe_count; i++) {
-
-               if (!res_ctx->pipe_ctx[i].stream)
-                       continue;
+       for (i = 0; i < pipe_cnt; i++) {
 
                pipes[i].pipe.src.hostvm = 1;
                pipes[i].pipe.src.gpuvm = 1;