drm/amd/display: Avoid get/put vblank when stream disabled
authorWayne Lin <Wayne.Lin@amd.com>
Wed, 28 Apr 2021 10:04:44 +0000 (18:04 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 20 May 2021 02:39:28 +0000 (22:39 -0400)
commitbbc49fc0326be4f1518fa9d81e527ebf989e6d4e
tree489292d3190e2e36c7148012957bd593d604b416
parent67c268a50a119ed92f1d0b742a8df6a559fbc93b
drm/amd/display: Avoid get/put vblank when stream disabled

[Why]
amdgpu_dm_crtc_set_crc_source() will call
amdgpu_dm_crtc_configure_crc_source() to enable/disable CRC
generation. However, configuration will be deferred to stream enabled.
If stream is not enabled, current flow will still try to get/put vblank
refcount.

[How]
Return EINVAL to skip actions on vblank refcount when stream is not
enabled.

Signed-off-by: Wayne Lin <Wayne.Lin@amd.com>
Reviewed-by: Chao-kai Wang <Stylon.Wang@amd.com>
Acked-by: Stylon Wang <stylon.wang@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@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