Commit 05b78277 authored by Wenjing Liu's avatar Wenjing Liu Committed by Alex Deucher

drm/amd/display: use full update for clip size increase of large plane source

[why]
Clip size increase will increase viewport, which could cause us to
switch  to MPC combine.
If we skip full update, we are not able to change to MPC combine in
fast update. This will cause corruption showing on the video plane.

[how]
treat clip size increase of a surface larger than 5k as a full update.
Reviewed-by: default avatarJun Lei <jun.lei@amd.com>
Acked-by: default avatarAurabindo Pillai <aurabindo.pillai@amd.com>
Signed-off-by: default avatarWenjing Liu <wenjing.liu@amd.com>
Tested-by: default avatarDaniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 889d5515
...@@ -1003,7 +1003,8 @@ static bool dc_construct(struct dc *dc, ...@@ -1003,7 +1003,8 @@ static bool dc_construct(struct dc *dc,
/* set i2c speed if not done by the respective dcnxxx__resource.c */ /* set i2c speed if not done by the respective dcnxxx__resource.c */
if (dc->caps.i2c_speed_in_khz_hdcp == 0) if (dc->caps.i2c_speed_in_khz_hdcp == 0)
dc->caps.i2c_speed_in_khz_hdcp = dc->caps.i2c_speed_in_khz; dc->caps.i2c_speed_in_khz_hdcp = dc->caps.i2c_speed_in_khz;
if (dc->caps.max_optimizable_video_width == 0)
dc->caps.max_optimizable_video_width = 5120;
dc->clk_mgr = dc_clk_mgr_create(dc->ctx, dc->res_pool->pp_smu, dc->res_pool->dccg); dc->clk_mgr = dc_clk_mgr_create(dc->ctx, dc->res_pool->pp_smu, dc->res_pool->dccg);
if (!dc->clk_mgr) if (!dc->clk_mgr)
goto fail; goto fail;
...@@ -2394,6 +2395,7 @@ static enum surface_update_type get_plane_info_update_type(const struct dc_surfa ...@@ -2394,6 +2395,7 @@ static enum surface_update_type get_plane_info_update_type(const struct dc_surfa
} }
static enum surface_update_type get_scaling_info_update_type( static enum surface_update_type get_scaling_info_update_type(
const struct dc *dc,
const struct dc_surface_update *u) const struct dc_surface_update *u)
{ {
union surface_update_flags *update_flags = &u->surface->update_flags; union surface_update_flags *update_flags = &u->surface->update_flags;
...@@ -2426,6 +2428,12 @@ static enum surface_update_type get_scaling_info_update_type( ...@@ -2426,6 +2428,12 @@ static enum surface_update_type get_scaling_info_update_type(
update_flags->bits.clock_change = 1; update_flags->bits.clock_change = 1;
} }
if (u->scaling_info->src_rect.width > dc->caps.max_optimizable_video_width &&
(u->scaling_info->clip_rect.width > u->surface->clip_rect.width ||
u->scaling_info->clip_rect.height > u->surface->clip_rect.height))
/* Changing clip size of a large surface may result in MPC slice count change */
update_flags->bits.bandwidth_change = 1;
if (u->scaling_info->src_rect.x != u->surface->src_rect.x if (u->scaling_info->src_rect.x != u->surface->src_rect.x
|| u->scaling_info->src_rect.y != u->surface->src_rect.y || u->scaling_info->src_rect.y != u->surface->src_rect.y
|| u->scaling_info->clip_rect.x != u->surface->clip_rect.x || u->scaling_info->clip_rect.x != u->surface->clip_rect.x
...@@ -2463,7 +2471,7 @@ static enum surface_update_type det_surface_update(const struct dc *dc, ...@@ -2463,7 +2471,7 @@ static enum surface_update_type det_surface_update(const struct dc *dc,
type = get_plane_info_update_type(u); type = get_plane_info_update_type(u);
elevate_update_type(&overall_type, type); elevate_update_type(&overall_type, type);
type = get_scaling_info_update_type(u); type = get_scaling_info_update_type(dc, u);
elevate_update_type(&overall_type, type); elevate_update_type(&overall_type, type);
if (u->flip_addr) { if (u->flip_addr) {
......
...@@ -231,6 +231,11 @@ struct dc_caps { ...@@ -231,6 +231,11 @@ struct dc_caps {
uint32_t dmdata_alloc_size; uint32_t dmdata_alloc_size;
unsigned int max_cursor_size; unsigned int max_cursor_size;
unsigned int max_video_width; unsigned int max_video_width;
/*
* max video plane width that can be safely assumed to be always
* supported by single DPP pipe.
*/
unsigned int max_optimizable_video_width;
unsigned int min_horizontal_blanking_period; unsigned int min_horizontal_blanking_period;
int linear_pitch_alignment; int linear_pitch_alignment;
bool dcc_const_color; bool dcc_const_color;
......
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