mirror of
https://github.com/torvalds/linux.git
synced 2026-05-24 15:12:13 +02:00
drm/amd/display: Query DC for gfx handling when setting linear tiling
[Why] Post-driver cases always use linear tiling yet gfx handling for this case is improper, allowing for incorrect gfx structs to be populated and used. [How] Query DC for the apporpriate linear tiling mode and populate the DCN specific gfx version structs. Reviewed-by: Dillon Varone <dillon.varone@amd.com> Signed-off-by: Nicholas Carbones <Nicholas.Carbones@amd.com> Signed-off-by: Chuanyu Tseng <chuanyu.tseng@amd.com> Tested-by: Dan Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
b034c5b0d8
commit
8333f22e44
|
|
@ -2617,6 +2617,16 @@ void dc_post_update_surfaces_to_stream(struct dc *dc)
|
|||
dc->optimized_required = false;
|
||||
}
|
||||
|
||||
void dc_get_default_tiling_info(const struct dc *dc, struct dc_tiling_info *tiling_info)
|
||||
{
|
||||
if (!dc || !tiling_info)
|
||||
return;
|
||||
if (dc->res_pool && dc->res_pool->funcs && dc->res_pool->funcs->get_default_tiling_info) {
|
||||
dc->res_pool->funcs->get_default_tiling_info(tiling_info);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
bool dc_set_generic_gpio_for_stereo(bool enable,
|
||||
struct gpio_service *gpio_service)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1970,6 +1970,15 @@ void dc_plane_cm_retain(struct dc_plane_cm *cm);
|
|||
void dc_post_update_surfaces_to_stream(
|
||||
struct dc *dc);
|
||||
|
||||
/*
|
||||
* dc_get_default_tiling_info() - Retrieve an ASIC-appropriate default tiling
|
||||
* description for (typically) linear surfaces.
|
||||
*
|
||||
* This is used by OS/DM paths that need a valid, fully-initialized tiling
|
||||
* description without hardcoding gfx-version specifics in the caller.
|
||||
*/
|
||||
void dc_get_default_tiling_info(const struct dc *dc, struct dc_tiling_info *tiling_info);
|
||||
|
||||
/**
|
||||
* struct dc_validation_set - Struct to store surface/stream associations for validation
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -214,6 +214,7 @@ struct resource_funcs {
|
|||
unsigned int index);
|
||||
|
||||
void (*get_panel_config_defaults)(struct dc_panel_config *panel_config);
|
||||
void (*get_default_tiling_info)(struct dc_tiling_info *tiling_info);
|
||||
void (*build_pipe_pix_clk_params)(struct pipe_ctx *pipe_ctx);
|
||||
/*
|
||||
* Get indicator of power from a context that went through full validation
|
||||
|
|
|
|||
|
|
@ -1273,6 +1273,12 @@ static const struct dc_cap_funcs cap_funcs = {
|
|||
.get_dcc_compression_cap = dcn10_get_dcc_compression_cap
|
||||
};
|
||||
|
||||
void dcn10_get_default_tiling_info(struct dc_tiling_info *tiling_info)
|
||||
{
|
||||
tiling_info->gfxversion = DcGfxVersion9;
|
||||
tiling_info->gfx9.swizzle = DC_SW_LINEAR;
|
||||
}
|
||||
|
||||
static const struct resource_funcs dcn10_res_pool_funcs = {
|
||||
.destroy = dcn10_destroy_resource_pool,
|
||||
.link_enc_create = dcn10_link_encoder_create,
|
||||
|
|
@ -1284,7 +1290,8 @@ static const struct resource_funcs dcn10_res_pool_funcs = {
|
|||
.add_stream_to_ctx = dcn10_add_stream_to_ctx,
|
||||
.patch_unknown_plane_state = dcn10_patch_unknown_plane_state,
|
||||
.find_first_free_match_stream_enc_for_link = dcn10_find_first_free_match_stream_enc_for_link,
|
||||
.get_vstartup_for_pipe = dcn10_get_vstartup_for_pipe
|
||||
.get_vstartup_for_pipe = dcn10_get_vstartup_for_pipe,
|
||||
.get_default_tiling_info = dcn10_get_default_tiling_info
|
||||
};
|
||||
|
||||
static uint32_t read_pipe_fuses(struct dc_context *ctx)
|
||||
|
|
|
|||
|
|
@ -53,5 +53,7 @@ struct stream_encoder *dcn10_find_first_free_match_stream_enc_for_link(
|
|||
|
||||
unsigned int dcn10_get_vstartup_for_pipe(struct pipe_ctx *pipe_ctx);
|
||||
|
||||
void dcn10_get_default_tiling_info(struct dc_tiling_info *tiling_info);
|
||||
|
||||
#endif /* __DC_RESOURCE_DCN10_H__ */
|
||||
|
||||
|
|
|
|||
|
|
@ -2232,7 +2232,8 @@ static const struct resource_funcs dcn20_res_pool_funcs = {
|
|||
.set_mcif_arb_params = dcn20_set_mcif_arb_params,
|
||||
.populate_dml_pipes = dcn20_populate_dml_pipes_from_context,
|
||||
.find_first_free_match_stream_enc_for_link = dcn10_find_first_free_match_stream_enc_for_link,
|
||||
.get_vstartup_for_pipe = dcn10_get_vstartup_for_pipe
|
||||
.get_vstartup_for_pipe = dcn10_get_vstartup_for_pipe,
|
||||
.get_default_tiling_info = dcn10_get_default_tiling_info
|
||||
};
|
||||
|
||||
bool dcn20_dwbc_create(struct dc_context *ctx, struct resource_pool *pool)
|
||||
|
|
|
|||
|
|
@ -1081,7 +1081,8 @@ static struct resource_funcs dcn201_res_pool_funcs = {
|
|||
.patch_unknown_plane_state = dcn20_patch_unknown_plane_state,
|
||||
.set_mcif_arb_params = dcn20_set_mcif_arb_params,
|
||||
.find_first_free_match_stream_enc_for_link = dcn10_find_first_free_match_stream_enc_for_link,
|
||||
.get_vstartup_for_pipe = dcn10_get_vstartup_for_pipe
|
||||
.get_vstartup_for_pipe = dcn10_get_vstartup_for_pipe,
|
||||
.get_default_tiling_info = dcn10_get_default_tiling_info
|
||||
};
|
||||
|
||||
static bool dcn201_resource_construct(
|
||||
|
|
|
|||
|
|
@ -1378,7 +1378,8 @@ static const struct resource_funcs dcn21_res_pool_funcs = {
|
|||
.find_first_free_match_stream_enc_for_link = dcn10_find_first_free_match_stream_enc_for_link,
|
||||
.update_bw_bounding_box = dcn21_update_bw_bounding_box,
|
||||
.get_panel_config_defaults = dcn21_get_panel_config_defaults,
|
||||
.get_vstartup_for_pipe = dcn10_get_vstartup_for_pipe
|
||||
.get_vstartup_for_pipe = dcn10_get_vstartup_for_pipe,
|
||||
.get_default_tiling_info = dcn10_get_default_tiling_info
|
||||
};
|
||||
|
||||
static bool dcn21_resource_construct(
|
||||
|
|
|
|||
|
|
@ -2248,7 +2248,8 @@ static const struct resource_funcs dcn30_res_pool_funcs = {
|
|||
.update_bw_bounding_box = dcn30_update_bw_bounding_box,
|
||||
.patch_unknown_plane_state = dcn20_patch_unknown_plane_state,
|
||||
.get_panel_config_defaults = dcn30_get_panel_config_defaults,
|
||||
.get_vstartup_for_pipe = dcn10_get_vstartup_for_pipe
|
||||
.get_vstartup_for_pipe = dcn10_get_vstartup_for_pipe,
|
||||
.get_default_tiling_info = dcn10_get_default_tiling_info
|
||||
};
|
||||
|
||||
#define CTX ctx
|
||||
|
|
|
|||
|
|
@ -1400,7 +1400,8 @@ static struct resource_funcs dcn301_res_pool_funcs = {
|
|||
.release_post_bldn_3dlut = dcn30_release_post_bldn_3dlut,
|
||||
.update_bw_bounding_box = dcn301_update_bw_bounding_box,
|
||||
.patch_unknown_plane_state = dcn20_patch_unknown_plane_state,
|
||||
.get_vstartup_for_pipe = dcn10_get_vstartup_for_pipe
|
||||
.get_vstartup_for_pipe = dcn10_get_vstartup_for_pipe,
|
||||
.get_default_tiling_info = dcn10_get_default_tiling_info,
|
||||
};
|
||||
|
||||
static bool dcn301_resource_construct(
|
||||
|
|
|
|||
|
|
@ -1155,7 +1155,8 @@ static struct resource_funcs dcn302_res_pool_funcs = {
|
|||
.update_bw_bounding_box = dcn302_update_bw_bounding_box,
|
||||
.patch_unknown_plane_state = dcn20_patch_unknown_plane_state,
|
||||
.get_panel_config_defaults = dcn302_get_panel_config_defaults,
|
||||
.get_vstartup_for_pipe = dcn10_get_vstartup_for_pipe
|
||||
.get_vstartup_for_pipe = dcn10_get_vstartup_for_pipe,
|
||||
.get_default_tiling_info = dcn10_get_default_tiling_info
|
||||
};
|
||||
|
||||
static struct dc_cap_funcs cap_funcs = {
|
||||
|
|
|
|||
|
|
@ -1099,7 +1099,8 @@ static struct resource_funcs dcn303_res_pool_funcs = {
|
|||
.update_bw_bounding_box = dcn303_update_bw_bounding_box,
|
||||
.patch_unknown_plane_state = dcn20_patch_unknown_plane_state,
|
||||
.get_panel_config_defaults = dcn303_get_panel_config_defaults,
|
||||
.get_vstartup_for_pipe = dcn10_get_vstartup_for_pipe
|
||||
.get_vstartup_for_pipe = dcn10_get_vstartup_for_pipe,
|
||||
.get_default_tiling_info = dcn10_get_default_tiling_info
|
||||
};
|
||||
|
||||
static struct dc_cap_funcs cap_funcs = {
|
||||
|
|
|
|||
|
|
@ -1851,6 +1851,7 @@ static struct resource_funcs dcn31_res_pool_funcs = {
|
|||
.get_det_buffer_size = dcn31_get_det_buffer_size,
|
||||
.get_vstartup_for_pipe = dcn10_get_vstartup_for_pipe,
|
||||
.update_dc_state_for_encoder_switch = dcn31_update_dc_state_for_encoder_switch,
|
||||
.get_default_tiling_info = dcn10_get_default_tiling_info,
|
||||
.build_pipe_pix_clk_params = dcn20_build_pipe_pix_clk_params
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -1782,7 +1782,8 @@ static struct resource_funcs dcn314_res_pool_funcs = {
|
|||
.get_det_buffer_size = dcn31_get_det_buffer_size,
|
||||
.get_vstartup_for_pipe = dcn10_get_vstartup_for_pipe,
|
||||
.update_dc_state_for_encoder_switch = dcn31_update_dc_state_for_encoder_switch,
|
||||
.build_pipe_pix_clk_params = dcn20_build_pipe_pix_clk_params
|
||||
.build_pipe_pix_clk_params = dcn20_build_pipe_pix_clk_params,
|
||||
.get_default_tiling_info = dcn10_get_default_tiling_info
|
||||
};
|
||||
|
||||
static struct clock_source *dcn30_clock_source_create(
|
||||
|
|
|
|||
|
|
@ -1846,7 +1846,8 @@ static struct resource_funcs dcn315_res_pool_funcs = {
|
|||
.get_det_buffer_size = dcn31_get_det_buffer_size,
|
||||
.get_vstartup_for_pipe = dcn10_get_vstartup_for_pipe,
|
||||
.update_dc_state_for_encoder_switch = dcn31_update_dc_state_for_encoder_switch,
|
||||
.build_pipe_pix_clk_params = dcn20_build_pipe_pix_clk_params
|
||||
.build_pipe_pix_clk_params = dcn20_build_pipe_pix_clk_params,
|
||||
.get_default_tiling_info = dcn10_get_default_tiling_info
|
||||
};
|
||||
|
||||
static bool dcn315_resource_construct(
|
||||
|
|
|
|||
|
|
@ -1721,7 +1721,8 @@ static struct resource_funcs dcn316_res_pool_funcs = {
|
|||
.get_det_buffer_size = dcn31_get_det_buffer_size,
|
||||
.get_vstartup_for_pipe = dcn10_get_vstartup_for_pipe,
|
||||
.update_dc_state_for_encoder_switch = dcn31_update_dc_state_for_encoder_switch,
|
||||
.build_pipe_pix_clk_params = dcn20_build_pipe_pix_clk_params
|
||||
.build_pipe_pix_clk_params = dcn20_build_pipe_pix_clk_params,
|
||||
.get_default_tiling_info = dcn10_get_default_tiling_info
|
||||
};
|
||||
|
||||
static bool dcn316_resource_construct(
|
||||
|
|
|
|||
|
|
@ -2112,6 +2112,7 @@ static struct resource_funcs dcn32_res_pool_funcs = {
|
|||
.patch_unknown_plane_state = dcn20_patch_unknown_plane_state,
|
||||
.update_soc_for_wm_a = dcn30_update_soc_for_wm_a,
|
||||
.add_phantom_pipes = dcn32_add_phantom_pipes,
|
||||
.get_default_tiling_info = dcn10_get_default_tiling_info,
|
||||
.build_pipe_pix_clk_params = dcn20_build_pipe_pix_clk_params,
|
||||
.calculate_mall_ways_from_bytes = dcn32_calculate_mall_ways_from_bytes,
|
||||
.get_vstartup_for_pipe = dcn10_get_vstartup_for_pipe,
|
||||
|
|
|
|||
|
|
@ -1619,6 +1619,7 @@ static struct resource_funcs dcn321_res_pool_funcs = {
|
|||
.calculate_mall_ways_from_bytes = dcn32_calculate_mall_ways_from_bytes,
|
||||
.get_vstartup_for_pipe = dcn10_get_vstartup_for_pipe,
|
||||
.get_max_hw_cursor_size = dcn32_get_max_hw_cursor_size,
|
||||
.get_default_tiling_info = dcn10_get_default_tiling_info,
|
||||
};
|
||||
|
||||
static uint32_t read_pipe_fuses(struct dc_context *ctx)
|
||||
|
|
|
|||
|
|
@ -1802,7 +1802,8 @@ static struct resource_funcs dcn35_res_pool_funcs = {
|
|||
.get_det_buffer_size = dcn31_get_det_buffer_size,
|
||||
.get_vstartup_for_pipe = dcn10_get_vstartup_for_pipe,
|
||||
.update_dc_state_for_encoder_switch = dcn31_update_dc_state_for_encoder_switch,
|
||||
.build_pipe_pix_clk_params = dcn20_build_pipe_pix_clk_params
|
||||
.build_pipe_pix_clk_params = dcn20_build_pipe_pix_clk_params,
|
||||
.get_default_tiling_info = dcn10_get_default_tiling_info
|
||||
};
|
||||
|
||||
static bool dcn35_resource_construct(
|
||||
|
|
|
|||
|
|
@ -1775,7 +1775,8 @@ static struct resource_funcs dcn351_res_pool_funcs = {
|
|||
.get_det_buffer_size = dcn31_get_det_buffer_size,
|
||||
.get_vstartup_for_pipe = dcn10_get_vstartup_for_pipe,
|
||||
.update_dc_state_for_encoder_switch = dcn31_update_dc_state_for_encoder_switch,
|
||||
.build_pipe_pix_clk_params = dcn20_build_pipe_pix_clk_params
|
||||
.build_pipe_pix_clk_params = dcn20_build_pipe_pix_clk_params,
|
||||
.get_default_tiling_info = dcn10_get_default_tiling_info
|
||||
};
|
||||
|
||||
static bool dcn351_resource_construct(
|
||||
|
|
|
|||
|
|
@ -1781,7 +1781,8 @@ static struct resource_funcs dcn36_res_pool_funcs = {
|
|||
.get_preferred_eng_id_dpia = dcn36_get_preferred_eng_id_dpia,
|
||||
.get_vstartup_for_pipe = dcn10_get_vstartup_for_pipe,
|
||||
.update_dc_state_for_encoder_switch = dcn31_update_dc_state_for_encoder_switch,
|
||||
.build_pipe_pix_clk_params = dcn20_build_pipe_pix_clk_params
|
||||
.build_pipe_pix_clk_params = dcn20_build_pipe_pix_clk_params,
|
||||
.get_default_tiling_info = dcn10_get_default_tiling_info,
|
||||
};
|
||||
|
||||
static bool dcn36_resource_construct(
|
||||
|
|
|
|||
|
|
@ -1839,9 +1839,16 @@ static struct resource_funcs dcn401_res_pool_funcs = {
|
|||
.calculate_mall_ways_from_bytes = dcn32_calculate_mall_ways_from_bytes,
|
||||
.get_power_profile = dcn401_get_power_profile,
|
||||
.get_vstartup_for_pipe = dcn401_get_vstartup_for_pipe,
|
||||
.get_max_hw_cursor_size = dcn32_get_max_hw_cursor_size
|
||||
.get_max_hw_cursor_size = dcn32_get_max_hw_cursor_size,
|
||||
.get_default_tiling_info = dcn401_get_default_tiling_info
|
||||
};
|
||||
|
||||
void dcn401_get_default_tiling_info(struct dc_tiling_info *tiling_info)
|
||||
{
|
||||
tiling_info->gfxversion = DcGfxAddr3;
|
||||
tiling_info->gfx_addr3.swizzle = DC_ADDR3_SW_LINEAR;
|
||||
}
|
||||
|
||||
static uint32_t read_pipe_fuses(struct dc_context *ctx)
|
||||
{
|
||||
uint32_t value = REG_READ(CC_DC_PIPE_DIS);
|
||||
|
|
|
|||
|
|
@ -28,6 +28,8 @@ enum dc_status dcn401_validate_bandwidth(struct dc *dc,
|
|||
|
||||
void dcn401_prepare_mcache_programming(struct dc *dc, struct dc_state *context);
|
||||
|
||||
void dcn401_get_default_tiling_info(struct dc_tiling_info *tiling_info);
|
||||
|
||||
unsigned int dcn401_get_vstartup_for_pipe(struct pipe_ctx *pipe_ctx);
|
||||
|
||||
/* Following are definitions for run time init of reg offsets */
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user