mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git/
synced 2026-04-18 06:33:43 -04:00
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>
This commit is contained in:
committed by
Alex Deucher
parent
58de0ef214
commit
09a5df6c44
@@ -60,6 +60,7 @@ enum aux_return_code_type;
|
||||
|
||||
/* Forward declarations */
|
||||
struct amdgpu_device;
|
||||
struct amdgpu_crtc;
|
||||
struct drm_device;
|
||||
struct dc;
|
||||
struct amdgpu_bo;
|
||||
@@ -86,16 +87,16 @@ struct dm_compressor_info {
|
||||
};
|
||||
|
||||
/**
|
||||
* struct vblank_workqueue - Works to be executed in a separate thread during vblank
|
||||
* @mall_work: work for mall stutter
|
||||
* struct vblank_control_work - Work data for vblank control
|
||||
* @work: Kernel work data for the work event
|
||||
* @dm: amdgpu display manager device
|
||||
* @otg_inst: otg instance of which vblank is being set
|
||||
* @enable: true if enable vblank
|
||||
* @acrtc: amdgpu CRTC instance for which the event has occurred
|
||||
* @enable: true if enabling vblank
|
||||
*/
|
||||
struct vblank_workqueue {
|
||||
struct work_struct mall_work;
|
||||
struct vblank_control_work {
|
||||
struct work_struct work;
|
||||
struct amdgpu_display_manager *dm;
|
||||
int otg_inst;
|
||||
struct amdgpu_crtc *acrtc;
|
||||
bool enable;
|
||||
};
|
||||
|
||||
@@ -380,11 +381,11 @@ struct amdgpu_display_manager {
|
||||
|
||||
#if defined(CONFIG_DRM_AMD_DC_DCN)
|
||||
/**
|
||||
* @vblank_workqueue:
|
||||
* @vblank_control_workqueue:
|
||||
*
|
||||
* amdgpu workqueue during vblank
|
||||
* Deferred work for vblank control events.
|
||||
*/
|
||||
struct vblank_workqueue *vblank_workqueue;
|
||||
struct workqueue_struct *vblank_control_workqueue;
|
||||
#endif
|
||||
|
||||
struct drm_atomic_state *cached_state;
|
||||
|
||||
Reference in New Issue
Block a user