drm/amd/display: Disable cursors before disabling planes
authorNicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Mon, 8 Apr 2019 14:37:44 +0000 (10:37 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 29 Apr 2019 19:58:16 +0000 (14:58 -0500)
commit8ad278062de4eae53f68ec835c20147efcec81a8
tree8cc37da67b0c0cfd1ac532c4ed1b215f47c4c075
parentd6ef9b4175e870b52468fed4fd77b0d3d54e20fc
drm/amd/display: Disable cursors before disabling planes

[Why]
We can't do cursor programming after the planes have been disabled
since there won't be any pipes - leading to lock warnings and the wrong
cursor state being left in the registers.

When we re-enable the planes after the previous cursor state will also
remain if we don't have a cursor plane.

[How]
If we're disabling the planes then do the cursor programming first.
If we're not disabling the planes then do the cursor programming after.

Introduce the amdgpu_dm_commit_cursors helper to avoid code duplication
for both of these cases.

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