drm/amd/display: Make new dc interface for adding dsc resource
authorAurabindo Pillai <aurabindo.pillai@amd.com>
Mon, 6 Jul 2020 18:53:57 +0000 (14:53 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 21 Jul 2020 19:37:39 +0000 (15:37 -0400)
[Why]
dcn20_add_dsc_to_stream_resource is accessed in amdgpu_dm directly.
This creates build error for configuration with DCN disabled.

[How]
Make the function available through a resource pool function so
that dcn20 function need not be called directly.

Signed-off-by: Aurabindo Pillai <aurabindo.pillai@amd.com>
Reviewed-by: Nicholas Kazlauskas <Nicholas.Kazlauskas@amd.com>
Acked-by: Qingqing Zhuo <qingqing.zhuo@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/core/dc_stream.c
drivers/gpu/drm/amd/display/dc/dc_stream.h
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_resource.c
drivers/gpu/drm/amd/display/dc/dcn21/dcn21_resource.c
drivers/gpu/drm/amd/display/dc/inc/core_types.h

index 41c2785..10d69ad 100644 (file)
@@ -674,6 +674,17 @@ bool dc_stream_set_dynamic_metadata(struct dc *dc,
        return true;
 }
 
+enum dc_status dc_stream_add_dsc_to_resource(struct dc *dc,
+               struct dc_state *state,
+               struct dc_stream_state *stream)
+{
+       if (dc->res_pool->funcs->add_dsc_to_stream_resource) {
+               return dc->res_pool->funcs->add_dsc_to_stream_resource(dc, state, stream);
+       } else {
+               return DC_NO_DSC_RESOURCE;
+       }
+}
+
 void dc_stream_log(const struct dc *dc, const struct dc_stream_state *stream)
 {
        DC_LOG_DC(
index f599a72..e4e85a1 100644 (file)
@@ -363,6 +363,10 @@ bool dc_stream_remove_writeback(struct dc *dc,
                struct dc_stream_state *stream,
                uint32_t dwb_pipe_inst);
 
+enum dc_status dc_stream_add_dsc_to_resource(struct dc *dc,
+               struct dc_state *state,
+               struct dc_stream_state *stream);
+
 bool dc_stream_warmup_writeback(struct dc *dc,
                int num_dwb,
                struct dc_writeback_info *wb_info);
index e226647..c8c6225 100644 (file)
@@ -3364,6 +3364,7 @@ static struct resource_funcs dcn20_res_pool_funcs = {
        .validate_bandwidth = dcn20_validate_bandwidth,
        .acquire_idle_pipe_for_layer = dcn20_acquire_idle_pipe_for_layer,
        .add_stream_to_ctx = dcn20_add_stream_to_ctx,
+       .add_dsc_to_stream_resource = dcn20_add_dsc_to_stream_resource,
        .remove_stream_from_ctx = dcn20_remove_stream_from_ctx,
        .populate_dml_writeback_from_context = dcn20_populate_dml_writeback_from_context,
        .patch_unknown_plane_state = dcn20_patch_unknown_plane_state,
index 61b3372..7d82648 100644 (file)
@@ -1759,6 +1759,7 @@ static struct resource_funcs dcn21_res_pool_funcs = {
        .validate_bandwidth = dcn21_validate_bandwidth,
        .populate_dml_pipes = dcn21_populate_dml_pipes_from_context,
        .add_stream_to_ctx = dcn20_add_stream_to_ctx,
+       .add_dsc_to_stream_resource = dcn20_add_dsc_to_stream_resource,
        .remove_stream_from_ctx = dcn20_remove_stream_from_ctx,
        .acquire_idle_pipe_for_layer = dcn20_acquire_idle_pipe_for_layer,
        .populate_dml_writeback_from_context = dcn20_populate_dml_writeback_from_context,
index 5f985fc..329395e 100644 (file)
@@ -165,7 +165,9 @@ struct resource_funcs {
                        struct dc_3dlut **lut,
                        struct dc_transfer_func **shaper);
 #endif
-
+       enum dc_status (*add_dsc_to_stream_resource)(
+                       struct dc *dc, struct dc_state *state,
+                       struct dc_stream_state *stream);
 };
 
 struct audio_support{