drm/amd/display: use correct phantom pipe when populating subvp pipe info
authorWenjing Liu <wenjing.liu@amd.com>
Thu, 18 Jan 2024 20:30:01 +0000 (15:30 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 29 Jan 2024 20:45:53 +0000 (15:45 -0500)
[why]
In current code, we recognize a pipe as a phantom pipe if it references
the same phantom stream. However it can also a phantom split pipe.
If the phantom split pipe has a smaller pipe index than the phantom pipe
we will mistakenly use the phantom split pipe as the phantom pipe. This
causes an incorrect subvp configuration where the first half of the
screen is flashing solid white image.

[how]
Add additional check that the pipe needs to be an OTG master pipe.

Reviewed-by: Alvin Lee <alvin.lee2@amd.com>
Acked-by: Tom Chung <chiahsuan.chung@amd.com>
Signed-off-by: Wenjing Liu <wenjing.liu@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/dc_dmub_srv.c

index c365cca0571835c97ee91b9739c3ba4732de9631..3d7252218ea9f1aeaa939f53b4ae4bb22ab8f8cd 100644 (file)
@@ -787,7 +787,8 @@ static void populate_subvp_cmd_pipe_info(struct dc *dc,
        for (j = 0; j < dc->res_pool->pipe_count; j++) {
                struct pipe_ctx *phantom_pipe = &context->res_ctx.pipe_ctx[j];
 
-               if (phantom_pipe->stream == dc_state_get_paired_subvp_stream(context, subvp_pipe->stream)) {
+               if (resource_is_pipe_type(phantom_pipe, OTG_MASTER) &&
+                               phantom_pipe->stream == dc_state_get_paired_subvp_stream(context, subvp_pipe->stream)) {
                        pipe_data->pipe_config.subvp_data.phantom_pipe_index = phantom_pipe->stream_res.tg->inst;
                        if (phantom_pipe->bottom_pipe) {
                                pipe_data->pipe_config.subvp_data.phantom_split_pipe_index = phantom_pipe->bottom_pipe->plane_res.hubp->inst;