drm/amd/display: add pipe resource management callbacks to DML2
authorWenjing Liu <wenjing.liu@amd.com>
Wed, 4 Oct 2023 16:12:57 +0000 (12:12 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 26 Oct 2023 22:57:43 +0000 (18:57 -0400)
[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>
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource.c
drivers/gpu/drm/amd/display/dc/dcn321/dcn321_resource.c
drivers/gpu/drm/amd/display/dc/dcn35/dcn35_resource.c
drivers/gpu/drm/amd/display/dc/dml2/dml2_wrapper.h

index 81b0588..02d3168 100644 (file)
@@ -2445,6 +2445,11 @@ static bool dcn32_resource_construct(
        dc->dml2_options.callbacks.build_scaling_params = &resource_build_scaling_params;
        dc->dml2_options.callbacks.can_support_mclk_switch_using_fw_based_vblank_stretch = &dcn30_can_support_mclk_switch_using_fw_based_vblank_stretch;
        dc->dml2_options.callbacks.acquire_secondary_pipe_for_mpc_odm = &dc_resource_acquire_secondary_pipe_for_mpc_odm_legacy;
+       dc->dml2_options.callbacks.update_pipes_for_stream_with_slice_count = &resource_update_pipes_for_stream_with_slice_count;
+       dc->dml2_options.callbacks.update_pipes_for_plane_with_slice_count = &resource_update_pipes_for_plane_with_slice_count;
+       dc->dml2_options.callbacks.get_mpc_slice_index = &resource_get_mpc_slice_index;
+       dc->dml2_options.callbacks.get_odm_slice_index = &resource_get_odm_slice_index;
+       dc->dml2_options.callbacks.get_opp_head = &resource_get_opp_head;
 
        dc->dml2_options.svp_pstate.callbacks.dc = dc;
        dc->dml2_options.svp_pstate.callbacks.add_plane_to_context = &dc_add_plane_to_context;
index 0b1ce6e..7d0e5e9 100644 (file)
@@ -1999,6 +1999,11 @@ static bool dcn321_resource_construct(
        dc->dml2_options.callbacks.build_scaling_params = &resource_build_scaling_params;
        dc->dml2_options.callbacks.can_support_mclk_switch_using_fw_based_vblank_stretch = &dcn30_can_support_mclk_switch_using_fw_based_vblank_stretch;
        dc->dml2_options.callbacks.acquire_secondary_pipe_for_mpc_odm = &dc_resource_acquire_secondary_pipe_for_mpc_odm_legacy;
+       dc->dml2_options.callbacks.update_pipes_for_stream_with_slice_count = &resource_update_pipes_for_stream_with_slice_count;
+       dc->dml2_options.callbacks.update_pipes_for_plane_with_slice_count = &resource_update_pipes_for_plane_with_slice_count;
+       dc->dml2_options.callbacks.get_mpc_slice_index = &resource_get_mpc_slice_index;
+       dc->dml2_options.callbacks.get_odm_slice_index = &resource_get_odm_slice_index;
+       dc->dml2_options.callbacks.get_opp_head = &resource_get_opp_head;
 
        dc->dml2_options.svp_pstate.callbacks.dc = dc;
        dc->dml2_options.svp_pstate.callbacks.add_plane_to_context = &dc_add_plane_to_context;
index f9166c1..4e333e2 100644 (file)
@@ -2084,6 +2084,11 @@ static bool dcn35_resource_construct(
        dc->dml2_options.callbacks.build_scaling_params = &resource_build_scaling_params;
        dc->dml2_options.callbacks.can_support_mclk_switch_using_fw_based_vblank_stretch = &dcn30_can_support_mclk_switch_using_fw_based_vblank_stretch;
        dc->dml2_options.callbacks.acquire_secondary_pipe_for_mpc_odm = &dc_resource_acquire_secondary_pipe_for_mpc_odm_legacy;
+       dc->dml2_options.callbacks.update_pipes_for_stream_with_slice_count = &resource_update_pipes_for_stream_with_slice_count;
+       dc->dml2_options.callbacks.update_pipes_for_plane_with_slice_count = &resource_update_pipes_for_plane_with_slice_count;
+       dc->dml2_options.callbacks.get_mpc_slice_index = &resource_get_mpc_slice_index;
+       dc->dml2_options.callbacks.get_odm_slice_index = &resource_get_odm_slice_index;
+       dc->dml2_options.callbacks.get_opp_head = &resource_get_opp_head;
        dc->dml2_options.max_segments_per_hubp = 24;
 
        dc->dml2_options.det_segment_size = DCN3_2_DET_SEG_SIZE;/*todo*/
index 252442e..20e7c74 100644 (file)
@@ -73,6 +73,21 @@ struct dml2_dc_callbacks {
        bool (*build_scaling_params)(struct pipe_ctx *pipe_ctx);
        bool (*can_support_mclk_switch_using_fw_based_vblank_stretch)(struct dc *dc, struct dc_state *context);
        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);
+       bool (*update_pipes_for_stream_with_slice_count)(
+                       struct dc_state *new_ctx,
+                       const struct dc_state *cur_ctx,
+                       const struct resource_pool *pool,
+                       const struct dc_stream_state *stream,
+                       int new_slice_count);
+       bool (*update_pipes_for_plane_with_slice_count)(
+                       struct dc_state *new_ctx,
+                       const struct dc_state *cur_ctx,
+                       const struct resource_pool *pool,
+                       const struct dc_plane_state *plane,
+                       int slice_count);
+       int (*get_odm_slice_index)(const struct pipe_ctx *opp_head);
+       int (*get_mpc_slice_index)(const struct pipe_ctx *dpp_pipe);
+       struct pipe_ctx *(*get_opp_head)(const struct pipe_ctx *pipe_ctx);
 };
 
 struct dml2_dc_svp_callbacks {