Commit ebd084cd authored by Lewis Huang's avatar Lewis Huang Committed by Alex Deucher

drm/amd/display: add plane size change check condition

[Why]
Driver didn't check plane size and surface size is mismatch.
It will cause pitch data incorrect.

[How]
Add condition to check is plane change and update surface
Signed-off-by: default avatarLewis Huang <Lewis.Huang@amd.com>
Reviewed-by: default avatarTony Cheng <Tony.Cheng@amd.com>
Acked-by: default avatarLeo Li <sunpeng.li@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent d5cf79ee
...@@ -1220,6 +1220,12 @@ static enum surface_update_type get_plane_info_update_type(const struct dc_surfa ...@@ -1220,6 +1220,12 @@ static enum surface_update_type get_plane_info_update_type(const struct dc_surfa
*/ */
update_flags->bits.bpp_change = 1; update_flags->bits.bpp_change = 1;
if (u->plane_info->plane_size.grph.surface_pitch != u->surface->plane_size.grph.surface_pitch
|| u->plane_info->plane_size.video.luma_pitch != u->surface->plane_size.video.luma_pitch
|| u->plane_info->plane_size.video.chroma_pitch != u->surface->plane_size.video.chroma_pitch)
update_flags->bits.plane_size_change = 1;
if (memcmp(&u->plane_info->tiling_info, &u->surface->tiling_info, if (memcmp(&u->plane_info->tiling_info, &u->surface->tiling_info,
sizeof(union dc_tiling_info)) != 0) { sizeof(union dc_tiling_info)) != 0) {
update_flags->bits.swizzle_change = 1; update_flags->bits.swizzle_change = 1;
......
...@@ -445,6 +445,7 @@ union surface_update_flags { ...@@ -445,6 +445,7 @@ union surface_update_flags {
uint32_t coeff_reduction_change:1; uint32_t coeff_reduction_change:1;
uint32_t output_tf_change:1; uint32_t output_tf_change:1;
uint32_t pixel_format_change:1; uint32_t pixel_format_change:1;
uint32_t plane_size_change:1;
/* Full updates */ /* Full updates */
uint32_t new_plane:1; uint32_t new_plane:1;
......
...@@ -2125,7 +2125,8 @@ void update_dchubp_dpp( ...@@ -2125,7 +2125,8 @@ void update_dchubp_dpp(
plane_state->update_flags.bits.swizzle_change || plane_state->update_flags.bits.swizzle_change ||
plane_state->update_flags.bits.dcc_change || plane_state->update_flags.bits.dcc_change ||
plane_state->update_flags.bits.bpp_change || plane_state->update_flags.bits.bpp_change ||
plane_state->update_flags.bits.scaling_change) { plane_state->update_flags.bits.scaling_change ||
plane_state->update_flags.bits.plane_size_change) {
hubp->funcs->hubp_program_surface_config( hubp->funcs->hubp_program_surface_config(
hubp, hubp,
plane_state->format, plane_state->format,
......
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