drm/amd/display: Don't allocate DET for phantom pipes
authorAlvin Lee <Alvin.Lee2@amd.com>
Thu, 8 Sep 2022 15:08:25 +0000 (11:08 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 19 Sep 2022 19:15:02 +0000 (15:15 -0400)
[Why & How]
We should not allocate any DET for the phantom pipes.

Reviewed-by: Jun Lei <Jun.Lei@amd.com>
Acked-by: Wayne Lin <wayne.lin@amd.com>
Signed-off-by: Alvin Lee <Alvin.Lee2@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource_helpers.c

index 14787e0..5490b37 100644 (file)
@@ -271,10 +271,20 @@ void dcn32_determine_det_override(struct dc *dc,
        struct dc_plane_state *current_plane = NULL;
        struct pipe_ctx *next_odm_pipe = NULL;
        struct pipe_ctx *bottom_pipe = NULL;
+       uint8_t stream_count = 0;
+
+       for (i = 0; i < context->stream_count; i++) {
+               /* Don't count SubVP streams for DET allocation */
+               if (context->streams[i]->mall_stream_config.type != SUBVP_PHANTOM) {
+                       stream_count++;
+               }
+       }
 
        if (context->stream_count > 0) {
-               stream_segments = 18 / context->stream_count;
+               stream_segments = 18 / stream_count;
                for (i = 0; i < context->stream_count; i++) {
+                       if (context->streams[i]->mall_stream_config.type == SUBVP_PHANTOM)
+                               continue;
                        if (context->stream_status[i].plane_count > 0)
                                plane_segments = stream_segments / context->stream_status[i].plane_count;
                        else