drm/amd/display: Fix multi-display support for idle opt workqueue
authorNicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Tue, 3 Aug 2021 19:12:26 +0000 (15:12 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 16 Aug 2021 19:35:56 +0000 (15:35 -0400)
commit09a5df6c444cf092f87da0fa113b412138253f9b
treebae512a8feee1255756559b71ced9facbfaf70d4
parent58de0ef2149f762f90bd97cf0bcb425b158488ab
drm/amd/display: Fix multi-display support for idle opt workqueue

[Why]
The current implementation for idle optimization support only has a
single work item that gets reshuffled into the system workqueue
whenever we receive an enable or disable event.

We can have mismatched events if the work hasn't been processed or if
we're getting control events from multiple displays at once.

This fixes this issue and also makes the implementation usable for
PSR control - which will be addressed in another patch.

[How]
We need to be able to flush remaining work out on demand for driver stop
and psr disable so create a driver specific workqueue instead of using
the system one. The workqueue will be single threaded to guarantee the
ordering of enable/disable events.

Refactor the queue to allocate the control work and deallocate it
after processing it.

Pass the acrtc directly to make it easier to handle psr enable/disable
in a later patch.

Rename things to indicate that it's not just MALL specific.

Reviewed-by: Roman Li <Roman.Li@amd.com>
Acked-by: Wayne Lin <wayne.lin@amd.com>
Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas@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.h