diff options
author | Wenjing Liu <wenjing.liu@amd.com> | 2023-09-11 17:28:26 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2023-09-26 17:00:22 -0400 |
commit | 173db0c8b7664892fee343e5a605197962fc3ca8 (patch) | |
tree | 59aa42bd1bed9638065d484098d5c142bad8a167 /drivers/gpu/drm/amd/display/dc/core/dc_resource.c | |
parent | cd1baa1f6aa307e5829b3e6c7512ec61d2b8bfb3 (diff) |
drm/amd/display: add get primary dpp pipe resource interface
[why]
Need to have a helper function to find the primary dp pipe of the plane
associated with a dpp pipe
Reviewed-by: Dillon Varone <dillon.varone@amd.com>
Acked-by: Wayne Lin <wayne.lin@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>
Diffstat (limited to 'drivers/gpu/drm/amd/display/dc/core/dc_resource.c')
-rw-r--r-- | drivers/gpu/drm/amd/display/dc/core/dc_resource.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_resource.c b/drivers/gpu/drm/amd/display/dc/core/dc_resource.c index 8a8f8560605a..5a6f458b2942 100644 --- a/drivers/gpu/drm/amd/display/dc/core/dc_resource.c +++ b/drivers/gpu/drm/amd/display/dc/core/dc_resource.c @@ -1807,6 +1807,20 @@ struct pipe_ctx *resource_get_opp_head(const struct pipe_ctx *pipe_ctx) return opp_head; } +struct pipe_ctx *resource_get_primary_dpp_pipe(const struct pipe_ctx *dpp_pipe) +{ + struct pipe_ctx *pri_dpp_pipe = (struct pipe_ctx *) dpp_pipe; + + ASSERT(resource_is_pipe_type(dpp_pipe, DPP_PIPE)); + while (pri_dpp_pipe->prev_odm_pipe) + pri_dpp_pipe = pri_dpp_pipe->prev_odm_pipe; + while (pri_dpp_pipe->top_pipe && + pri_dpp_pipe->top_pipe->plane_state == pri_dpp_pipe->plane_state) + pri_dpp_pipe = pri_dpp_pipe->top_pipe; + return pri_dpp_pipe; +} + + int resource_get_mpc_slice_index(const struct pipe_ctx *pipe_ctx) { struct pipe_ctx *split_pipe = pipe_ctx->top_pipe; |