Skip to content

Commit b4f71c8

Browse files
Aurabindo Pillaialexdeucher
authored andcommitted
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: Aurabindo Pillai <[email protected]> Reviewed-by: Nicholas Kazlauskas <[email protected]> Acked-by: Qingqing Zhuo <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent 6d824ed commit b4f71c8

File tree

5 files changed

+20
-1
lines changed

5 files changed

+20
-1
lines changed

drivers/gpu/drm/amd/display/dc/core/dc_stream.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -674,6 +674,17 @@ bool dc_stream_set_dynamic_metadata(struct dc *dc,
674674
return true;
675675
}
676676

677+
enum dc_status dc_stream_add_dsc_to_resource(struct dc *dc,
678+
struct dc_state *state,
679+
struct dc_stream_state *stream)
680+
{
681+
if (dc->res_pool->funcs->add_dsc_to_stream_resource) {
682+
return dc->res_pool->funcs->add_dsc_to_stream_resource(dc, state, stream);
683+
} else {
684+
return DC_NO_DSC_RESOURCE;
685+
}
686+
}
687+
677688
void dc_stream_log(const struct dc *dc, const struct dc_stream_state *stream)
678689
{
679690
DC_LOG_DC(

drivers/gpu/drm/amd/display/dc/dc_stream.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,10 @@ bool dc_stream_remove_writeback(struct dc *dc,
363363
struct dc_stream_state *stream,
364364
uint32_t dwb_pipe_inst);
365365

366+
enum dc_status dc_stream_add_dsc_to_resource(struct dc *dc,
367+
struct dc_state *state,
368+
struct dc_stream_state *stream);
369+
366370
bool dc_stream_warmup_writeback(struct dc *dc,
367371
int num_dwb,
368372
struct dc_writeback_info *wb_info);

drivers/gpu/drm/amd/display/dc/dcn20/dcn20_resource.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3364,6 +3364,7 @@ static struct resource_funcs dcn20_res_pool_funcs = {
33643364
.validate_bandwidth = dcn20_validate_bandwidth,
33653365
.acquire_idle_pipe_for_layer = dcn20_acquire_idle_pipe_for_layer,
33663366
.add_stream_to_ctx = dcn20_add_stream_to_ctx,
3367+
.add_dsc_to_stream_resource = dcn20_add_dsc_to_stream_resource,
33673368
.remove_stream_from_ctx = dcn20_remove_stream_from_ctx,
33683369
.populate_dml_writeback_from_context = dcn20_populate_dml_writeback_from_context,
33693370
.patch_unknown_plane_state = dcn20_patch_unknown_plane_state,

drivers/gpu/drm/amd/display/dc/dcn21/dcn21_resource.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1759,6 +1759,7 @@ static struct resource_funcs dcn21_res_pool_funcs = {
17591759
.validate_bandwidth = dcn21_validate_bandwidth,
17601760
.populate_dml_pipes = dcn21_populate_dml_pipes_from_context,
17611761
.add_stream_to_ctx = dcn20_add_stream_to_ctx,
1762+
.add_dsc_to_stream_resource = dcn20_add_dsc_to_stream_resource,
17621763
.remove_stream_from_ctx = dcn20_remove_stream_from_ctx,
17631764
.acquire_idle_pipe_for_layer = dcn20_acquire_idle_pipe_for_layer,
17641765
.populate_dml_writeback_from_context = dcn20_populate_dml_writeback_from_context,

drivers/gpu/drm/amd/display/dc/inc/core_types.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,9 @@ struct resource_funcs {
165165
struct dc_3dlut **lut,
166166
struct dc_transfer_func **shaper);
167167
#endif
168-
168+
enum dc_status (*add_dsc_to_stream_resource)(
169+
struct dc *dc, struct dc_state *state,
170+
struct dc_stream_state *stream);
169171
};
170172

171173
struct audio_support{

0 commit comments

Comments
 (0)