drm/amd/display: add plane size change check condition
authorLewis Huang <Lewis.Huang@amd.com>
Fri, 16 Nov 2018 11:12:46 +0000 (19:12 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 14 Jan 2019 20:04:34 +0000 (15:04 -0500)
[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: Lewis Huang <Lewis.Huang@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Acked-by: Leo Li <sunpeng.li@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/core/dc.c
drivers/gpu/drm/amd/display/dc/dc.h
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c

index e12612be118dd458fd7154169adb7e08a4e2ef99..ce34e3e0c31fde76581343dc03c9c685a639169c 100644 (file)
@@ -1220,6 +1220,12 @@ static enum surface_update_type get_plane_info_update_type(const struct dc_surfa
                 */
                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,
                        sizeof(union dc_tiling_info)) != 0) {
                update_flags->bits.swizzle_change = 1;
index 580f752920d18f579ef5c0d981c35e344e73e9dc..b4ad48b0bff311ca0c45b6d3e2240d69bcf02315 100644 (file)
@@ -445,6 +445,7 @@ union surface_update_flags {
                uint32_t coeff_reduction_change:1;
                uint32_t output_tf_change:1;
                uint32_t pixel_format_change:1;
+               uint32_t plane_size_change:1;
 
                /* Full updates */
                uint32_t new_plane:1;
index edb382e1eaebd82a3f55762233fe5dfb5fcd0c96..03835dcd28a2816eb0b74b2fa8b3bccf8623f57a 100644 (file)
@@ -2125,7 +2125,8 @@ void update_dchubp_dpp(
                plane_state->update_flags.bits.swizzle_change ||
                plane_state->update_flags.bits.dcc_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,
                        plane_state->format,