Skip to content

Commit 2c071ca

Browse files
Wenjing Liualexdeucher
authored andcommitted
drm/amd/display: add pipe resource management callbacks to DML2
[why] Need DML2 to support new pipe resource management APIs. Reviewed-by: Chaitanya Dhere <chaitanya.dhere@amd.com> Acked-by: Roman Li <roman.li@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>
1 parent 5edb7cd commit 2c071ca

4 files changed

Lines changed: 30 additions & 0 deletions

File tree

drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2445,6 +2445,11 @@ static bool dcn32_resource_construct(
24452445
dc->dml2_options.callbacks.build_scaling_params = &resource_build_scaling_params;
24462446
dc->dml2_options.callbacks.can_support_mclk_switch_using_fw_based_vblank_stretch = &dcn30_can_support_mclk_switch_using_fw_based_vblank_stretch;
24472447
dc->dml2_options.callbacks.acquire_secondary_pipe_for_mpc_odm = &dc_resource_acquire_secondary_pipe_for_mpc_odm_legacy;
2448+
dc->dml2_options.callbacks.update_pipes_for_stream_with_slice_count = &resource_update_pipes_for_stream_with_slice_count;
2449+
dc->dml2_options.callbacks.update_pipes_for_plane_with_slice_count = &resource_update_pipes_for_plane_with_slice_count;
2450+
dc->dml2_options.callbacks.get_mpc_slice_index = &resource_get_mpc_slice_index;
2451+
dc->dml2_options.callbacks.get_odm_slice_index = &resource_get_odm_slice_index;
2452+
dc->dml2_options.callbacks.get_opp_head = &resource_get_opp_head;
24482453

24492454
dc->dml2_options.svp_pstate.callbacks.dc = dc;
24502455
dc->dml2_options.svp_pstate.callbacks.add_plane_to_context = &dc_add_plane_to_context;

drivers/gpu/drm/amd/display/dc/dcn321/dcn321_resource.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1999,6 +1999,11 @@ static bool dcn321_resource_construct(
19991999
dc->dml2_options.callbacks.build_scaling_params = &resource_build_scaling_params;
20002000
dc->dml2_options.callbacks.can_support_mclk_switch_using_fw_based_vblank_stretch = &dcn30_can_support_mclk_switch_using_fw_based_vblank_stretch;
20012001
dc->dml2_options.callbacks.acquire_secondary_pipe_for_mpc_odm = &dc_resource_acquire_secondary_pipe_for_mpc_odm_legacy;
2002+
dc->dml2_options.callbacks.update_pipes_for_stream_with_slice_count = &resource_update_pipes_for_stream_with_slice_count;
2003+
dc->dml2_options.callbacks.update_pipes_for_plane_with_slice_count = &resource_update_pipes_for_plane_with_slice_count;
2004+
dc->dml2_options.callbacks.get_mpc_slice_index = &resource_get_mpc_slice_index;
2005+
dc->dml2_options.callbacks.get_odm_slice_index = &resource_get_odm_slice_index;
2006+
dc->dml2_options.callbacks.get_opp_head = &resource_get_opp_head;
20022007

20032008
dc->dml2_options.svp_pstate.callbacks.dc = dc;
20042009
dc->dml2_options.svp_pstate.callbacks.add_plane_to_context = &dc_add_plane_to_context;

drivers/gpu/drm/amd/display/dc/dcn35/dcn35_resource.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2084,6 +2084,11 @@ static bool dcn35_resource_construct(
20842084
dc->dml2_options.callbacks.build_scaling_params = &resource_build_scaling_params;
20852085
dc->dml2_options.callbacks.can_support_mclk_switch_using_fw_based_vblank_stretch = &dcn30_can_support_mclk_switch_using_fw_based_vblank_stretch;
20862086
dc->dml2_options.callbacks.acquire_secondary_pipe_for_mpc_odm = &dc_resource_acquire_secondary_pipe_for_mpc_odm_legacy;
2087+
dc->dml2_options.callbacks.update_pipes_for_stream_with_slice_count = &resource_update_pipes_for_stream_with_slice_count;
2088+
dc->dml2_options.callbacks.update_pipes_for_plane_with_slice_count = &resource_update_pipes_for_plane_with_slice_count;
2089+
dc->dml2_options.callbacks.get_mpc_slice_index = &resource_get_mpc_slice_index;
2090+
dc->dml2_options.callbacks.get_odm_slice_index = &resource_get_odm_slice_index;
2091+
dc->dml2_options.callbacks.get_opp_head = &resource_get_opp_head;
20872092
dc->dml2_options.max_segments_per_hubp = 24;
20882093

20892094
dc->dml2_options.det_segment_size = DCN3_2_DET_SEG_SIZE;/*todo*/

drivers/gpu/drm/amd/display/dc/dml2/dml2_wrapper.h

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,21 @@ struct dml2_dc_callbacks {
7373
bool (*build_scaling_params)(struct pipe_ctx *pipe_ctx);
7474
bool (*can_support_mclk_switch_using_fw_based_vblank_stretch)(struct dc *dc, struct dc_state *context);
7575
bool (*acquire_secondary_pipe_for_mpc_odm)(const struct dc *dc, struct dc_state *state, struct pipe_ctx *pri_pipe, struct pipe_ctx *sec_pipe, bool odm);
76+
bool (*update_pipes_for_stream_with_slice_count)(
77+
struct dc_state *new_ctx,
78+
const struct dc_state *cur_ctx,
79+
const struct resource_pool *pool,
80+
const struct dc_stream_state *stream,
81+
int new_slice_count);
82+
bool (*update_pipes_for_plane_with_slice_count)(
83+
struct dc_state *new_ctx,
84+
const struct dc_state *cur_ctx,
85+
const struct resource_pool *pool,
86+
const struct dc_plane_state *plane,
87+
int slice_count);
88+
int (*get_odm_slice_index)(const struct pipe_ctx *opp_head);
89+
int (*get_mpc_slice_index)(const struct pipe_ctx *dpp_pipe);
90+
struct pipe_ctx *(*get_opp_head)(const struct pipe_ctx *pipe_ctx);
7691
};
7792

7893
struct dml2_dc_svp_callbacks {

0 commit comments

Comments
 (0)