]> git.proxmox.com Git - mirror_ubuntu-disco-kernel.git/commitdiff
drm/amd/display: fix releasing planes when exiting odm
authorDmytro Laktyushkin <Dmytro.Laktyushkin@amd.com>
Thu, 7 Mar 2019 18:26:13 +0000 (13:26 -0500)
committerStefan Bader <stefan.bader@canonical.com>
Tue, 13 Aug 2019 12:11:36 +0000 (14:11 +0200)
BugLink: https://bugs.launchpad.net/bugs/1837517
[ Upstream commit bc2193992b00488f5734613ac95b78ef2d2803ab ]

Releasing planes should not release the 2nd odm pipe right away,
this change leaves us with 2 pipes with null planes and same stream
when planes are released during odm.

Signed-off-by: Dmytro Laktyushkin <Dmytro.Laktyushkin@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Acked-by: Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
drivers/gpu/drm/amd/display/dc/core/dc_resource.c

index 76137df74a535b6d8c1609e2bb265787538ee87d..c6aa80d7e639b064550a8c0691f410932d40e1a2 100644 (file)
@@ -1266,10 +1266,12 @@ bool dc_remove_plane_from_context(
                         * For head pipe detach surfaces from pipe for tail
                         * pipe just zero it out
                         */
-                       if (!pipe_ctx->top_pipe) {
+                       if (!pipe_ctx->top_pipe ||
+                               (!pipe_ctx->top_pipe->top_pipe &&
+                                       pipe_ctx->top_pipe->stream_res.opp != pipe_ctx->stream_res.opp)) {
                                pipe_ctx->plane_state = NULL;
                                pipe_ctx->bottom_pipe = NULL;
-                       } else  {
+                       } else {
                                memset(pipe_ctx, 0, sizeof(*pipe_ctx));
                        }
                }