Commit b4f71c8c authored by Aurabindo Pillai's avatar Aurabindo Pillai Committed by Alex Deucher

drm/amd/display: Make new dc interface for adding dsc resource

[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: default avatarAurabindo Pillai <aurabindo.pillai@amd.com>
Reviewed-by: default avatarNicholas Kazlauskas <Nicholas.Kazlauskas@amd.com>
Acked-by: default avatarQingqing Zhuo <qingqing.zhuo@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 6d824ed5
...@@ -674,6 +674,17 @@ bool dc_stream_set_dynamic_metadata(struct dc *dc, ...@@ -674,6 +674,17 @@ bool dc_stream_set_dynamic_metadata(struct dc *dc,
return true; 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) void dc_stream_log(const struct dc *dc, const struct dc_stream_state *stream)
{ {
DC_LOG_DC( DC_LOG_DC(
......
...@@ -363,6 +363,10 @@ bool dc_stream_remove_writeback(struct dc *dc, ...@@ -363,6 +363,10 @@ bool dc_stream_remove_writeback(struct dc *dc,
struct dc_stream_state *stream, struct dc_stream_state *stream,
uint32_t dwb_pipe_inst); 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, bool dc_stream_warmup_writeback(struct dc *dc,
int num_dwb, int num_dwb,
struct dc_writeback_info *wb_info); struct dc_writeback_info *wb_info);
......
...@@ -3364,6 +3364,7 @@ static struct resource_funcs dcn20_res_pool_funcs = { ...@@ -3364,6 +3364,7 @@ static struct resource_funcs dcn20_res_pool_funcs = {
.validate_bandwidth = dcn20_validate_bandwidth, .validate_bandwidth = dcn20_validate_bandwidth,
.acquire_idle_pipe_for_layer = dcn20_acquire_idle_pipe_for_layer, .acquire_idle_pipe_for_layer = dcn20_acquire_idle_pipe_for_layer,
.add_stream_to_ctx = dcn20_add_stream_to_ctx, .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, .remove_stream_from_ctx = dcn20_remove_stream_from_ctx,
.populate_dml_writeback_from_context = dcn20_populate_dml_writeback_from_context, .populate_dml_writeback_from_context = dcn20_populate_dml_writeback_from_context,
.patch_unknown_plane_state = dcn20_patch_unknown_plane_state, .patch_unknown_plane_state = dcn20_patch_unknown_plane_state,
......
...@@ -1759,6 +1759,7 @@ static struct resource_funcs dcn21_res_pool_funcs = { ...@@ -1759,6 +1759,7 @@ static struct resource_funcs dcn21_res_pool_funcs = {
.validate_bandwidth = dcn21_validate_bandwidth, .validate_bandwidth = dcn21_validate_bandwidth,
.populate_dml_pipes = dcn21_populate_dml_pipes_from_context, .populate_dml_pipes = dcn21_populate_dml_pipes_from_context,
.add_stream_to_ctx = dcn20_add_stream_to_ctx, .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, .remove_stream_from_ctx = dcn20_remove_stream_from_ctx,
.acquire_idle_pipe_for_layer = dcn20_acquire_idle_pipe_for_layer, .acquire_idle_pipe_for_layer = dcn20_acquire_idle_pipe_for_layer,
.populate_dml_writeback_from_context = dcn20_populate_dml_writeback_from_context, .populate_dml_writeback_from_context = dcn20_populate_dml_writeback_from_context,
......
...@@ -165,7 +165,9 @@ struct resource_funcs { ...@@ -165,7 +165,9 @@ struct resource_funcs {
struct dc_3dlut **lut, struct dc_3dlut **lut,
struct dc_transfer_func **shaper); struct dc_transfer_func **shaper);
#endif #endif
enum dc_status (*add_dsc_to_stream_resource)(
struct dc *dc, struct dc_state *state,
struct dc_stream_state *stream);
}; };
struct audio_support{ struct audio_support{
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment