drm/amd/display: Split out DC programming for CRC capture
authorNicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Tue, 20 Aug 2019 14:16:14 +0000 (10:16 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 22 Aug 2019 03:18:25 +0000 (22:18 -0500)
commit57638021b711de052df781001bd6fd35804c3646
tree2a3834fc70bd0cc95f5b9e102a6bea45bae964fc
parentdf61eae4b87ac4dfb9c4fceea2f223a29466507b
drm/amd/display: Split out DC programming for CRC capture

[Why]
Calling amdgpu_dm_crtc_set_crc_source in amdgpu_dm directly has the
consequence of adding additional vblank references or starting DPRX
CRC capture more than once without calling stop first.

Vblank references for CRC capture should be managed entirely by opening
and closing the CRC file from userspace.

Stream state also shouldn't be required on the CRC so we can close the
file after the CRTC has been disabled.

[How]
Do DC programming required for configuring CRC capture separately from
setting the source. Whenever we re-enable or reset a CRC this
programming should be reapplied.

CRC vblank reference handling in amdgpu_dm can be entirely dropped after
this.

Stream state also no longer needs to be required since we can just defer
the programming to when the stream is actually enabled.

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