From: Tony Cheng <[email protected]> Add an inst member to struct clock_source and struct dio. The DCE110 and DCE112 clock sources derive it from their clock_source_id; the DCN10 DIO is a singleton and uses 0.
Also move the (void)encoding cast in dcn401_program_pix_clk() below the local declarations, where it belongs. No functional change; the inst field has no readers yet. Reviewed-by: Jun Lei <[email protected]> Reviewed-by: Alex Hung <[email protected]> Signed-off-by: Tony Cheng <[email protected]> Signed-off-by: George Zhang <[email protected]> --- drivers/gpu/drm/amd/display/dc/dce/dce_clock_source.c | 4 +++- drivers/gpu/drm/amd/display/dc/dio/dcn10/dcn10_dio.c | 1 + drivers/gpu/drm/amd/display/dc/inc/clock_source.h | 1 + drivers/gpu/drm/amd/display/dc/inc/hw/dio.h | 1 + 4 files changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/display/dc/dce/dce_clock_source.c b/drivers/gpu/drm/amd/display/dc/dce/dce_clock_source.c index 54ef1808ca35..145c993342bd 100644 --- a/drivers/gpu/drm/amd/display/dc/dce/dce_clock_source.c +++ b/drivers/gpu/drm/amd/display/dc/dce/dce_clock_source.c @@ -1074,7 +1074,6 @@ static bool dcn401_program_pix_clk( enum dp_link_encoding encoding, struct pll_settings *pll_settings) { - (void)encoding; struct dce110_clk_src *clk_src = TO_DCE110_CLK_SRC(clock_source); unsigned int inst = pix_clk_params->controller_id - CONTROLLER_ID_D0; const struct pixel_rate_range_table_entry *e = @@ -1082,6 +1081,7 @@ static bool dcn401_program_pix_clk( struct bp_pixel_clock_parameters bp_pc_params = {0}; enum transmitter_color_depth bp_pc_colour_depth = TRANSMITTER_COLOR_DEPTH_24; struct dp_dto_params dto_params = { 0 }; + (void)encoding; dto_params.otg_inst = inst; dto_params.signal = pix_clk_params->signal_type; @@ -1757,6 +1757,7 @@ bool dce110_clk_src_construct( clk_src->base.ctx = ctx; clk_src->bios = bios; clk_src->base.id = id; + clk_src->base.inst = (unsigned int)id; clk_src->base.funcs = &dce110_clk_src_funcs; clk_src->regs = regs; @@ -1855,6 +1856,7 @@ bool dce112_clk_src_construct( clk_src->base.ctx = ctx; clk_src->bios = bios; clk_src->base.id = id; + clk_src->base.inst = (unsigned int)id; clk_src->base.funcs = &dce112_clk_src_funcs; clk_src->regs = regs; diff --git a/drivers/gpu/drm/amd/display/dc/dio/dcn10/dcn10_dio.c b/drivers/gpu/drm/amd/display/dc/dio/dcn10/dcn10_dio.c index edcf4e67483b..458ce1053c96 100644 --- a/drivers/gpu/drm/amd/display/dc/dio/dcn10/dcn10_dio.c +++ b/drivers/gpu/drm/amd/display/dc/dio/dcn10/dcn10_dio.c @@ -40,6 +40,7 @@ void dcn10_dio_construct( { dio10->base.ctx = ctx; dio10->base.funcs = &dcn10_dio_funcs; + dio10->base.inst = 0; dio10->regs = regs; dio10->shifts = shifts; diff --git a/drivers/gpu/drm/amd/display/dc/inc/clock_source.h b/drivers/gpu/drm/amd/display/dc/inc/clock_source.h index dad429298d77..caa8dd8737bb 100644 --- a/drivers/gpu/drm/amd/display/dc/inc/clock_source.h +++ b/drivers/gpu/drm/amd/display/dc/inc/clock_source.h @@ -186,6 +186,7 @@ struct clock_source { const struct clock_source_funcs *funcs; struct dc_context *ctx; enum clock_source_id id; + unsigned int inst; bool dp_clk_src; }; diff --git a/drivers/gpu/drm/amd/display/dc/inc/hw/dio.h b/drivers/gpu/drm/amd/display/dc/inc/hw/dio.h index 532bf54cf2c4..916ac15b6b58 100644 --- a/drivers/gpu/drm/amd/display/dc/inc/hw/dio.h +++ b/drivers/gpu/drm/amd/display/dc/inc/hw/dio.h @@ -17,6 +17,7 @@ struct dio_funcs { struct dio { const struct dio_funcs *funcs; struct dc_context *ctx; + unsigned int inst; }; #endif /* __DC_DIO_H__ */ -- 2.55.0
