drm/amd/display: Avoid using unvalidated tiling_flags and tmz_surface in prepare_planes
authorNicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Tue, 28 Jul 2020 14:03:10 +0000 (10:03 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 6 Aug 2020 19:46:25 +0000 (15:46 -0400)
commitcf322b49c9e8fe41e5c9d0b5e57eee84085da553
treeb47e0d5bb74d635ab29dbca65993cfb6c0af83b1
parent9a81cc60796b9f86cf19245e68562750541bb575
drm/amd/display: Avoid using unvalidated tiling_flags and tmz_surface in prepare_planes

[Why]
We're racing with userspace as the flags could potentially change
from when we acquired and validated them in commit_check.

[How]
We unfortunately can't drop this function in its entirety from
prepare_planes since we don't know the afb->address at commit_check
time yet.

So instead of querying new tiling_flags and tmz_surface use the ones
from the plane_state directly.

While we're at it, also update the force_disable_dcc option based
on the state from atomic check.

Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Reviewed-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c