drm/amd/display: Recalculate pitch when buffers change
authorNicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Thu, 28 Mar 2019 13:46:23 +0000 (09:46 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 15 Apr 2019 05:20:59 +0000 (00:20 -0500)
commit320932bfd9e30222f427811079323b6c86edf4da
tree7e5de3539df4017e6395fca92e13275009e91985
parentf6ff2a08f49d565e38300f1a9d2f13359c7efc54
drm/amd/display: Recalculate pitch when buffers change

[Why]
Pitch was only calculated based on format whenever the plane state
was recreated. This could result in surface corruption due to the
incorrect pitch being programmed when the surface pitch changed during
commits where state->allow_modeset = false.

[How]
Recalculate pitch at the same time we update the buffer address and
other buffer attributes. This function was previously called
fill_plane_tiling_attributes but I've also renamed it to
fill_plane_buffer_attributes to clarify the actual intent of the
function now that it's handling most buffer related attributes.

Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Reviewed-by: David Francis <David.Francis@amd.com>
Acked-by: Bhawanpreet Lakha <Bhawanpreet Lakha@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c