From: Tony Cheng <[email protected]>

[Why]
core2_surfaces_supported compares the number of DPP pipes of the
stream with the number of surfaces. With ODM, one plane has one DPP
pipe for each ODM slice. Thus the check rejects each plane update on
an ODM stream, and DC does not program the plane.

[How]
Compare the plane count of the stream status in the new state with
the number of surfaces. Each surface must still be the plane of a DPP
pipe of the stream. The vsync flip change to the DC2 seamless update
added the pipe count check.

Cc: Jun Lei <[email protected]>
Signed-off-by: Tony Cheng <[email protected]>
Signed-off-by: Chenyu Chen <[email protected]>
---
 drivers/gpu/drm/amd/display/dc/core2/dc_core2.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/core2/dc_core2.c 
b/drivers/gpu/drm/amd/display/dc/core2/dc_core2.c
index ce2d4f0c89d6..1ab1f0ec2e41 100644
--- a/drivers/gpu/drm/amd/display/dc/core2/dc_core2.c
+++ b/drivers/gpu/drm/amd/display/dc/core2/dc_core2.c
@@ -337,14 +337,17 @@ static bool core2_surfaces_supported(
                const struct dc_update_scratch_space *scratch)
 {
        struct pipe_ctx *dpp_pipes[MAX_PIPES];
+       struct dc_stream_status *status;
        int i, j, n;
 
        if (!scratch->surface_updates)
                return false;
+       status = dc_state_get_stream_status(scratch->new_context,
+                       scratch->stream);
+       if (!status || status->plane_count != scratch->surface_count)
+               return false;
        n = resource_get_dpp_pipes_for_stream(scratch->stream,
                        &scratch->new_context->res_ctx, dpp_pipes);
-       if (n != scratch->surface_count)
-               return false;
        for (i = 0; i < scratch->surface_count; i++) {
                for (j = 0; j < n; j++)
                        if (dpp_pipes[j]->plane_state ==
-- 
2.43.0

Reply via email to