drm/amdgpu: Move MMIO flip out of spinlocked region
authorVitaly Prosyak <[email protected]>
Tue, 20 Oct 2015 19:02:03 +0000 (15:02 -0400)
committerAlex Deucher <[email protected]>
Wed, 10 Feb 2016 21:08:55 +0000 (16:08 -0500)
Prior actual  MMIO flip we need to acquire DAL mutex to guard
our target state which get modified on reset mode.
Assign page flip status before actual flip to handle
the possible race condition with interrupt.

Signed-off-by: Vitaly Prosyak <[email protected]>
Reviewed-by: Alex Deucher <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
drivers/gpu/drm/amd/amdgpu/amdgpu_display.c

index acd066d0a8051d0ad17f7311d8db1acd37348060..531627b0a900d077e48c5250b0af69f334ab91f3 100644 (file)
@@ -118,12 +118,12 @@ static void amdgpu_flip_work_func(struct work_struct *__work)
                spin_lock_irqsave(&crtc->dev->event_lock, flags);
        };
 
-       /* do the flip (mmio) */
-       adev->mode_info.funcs->page_flip(adev, work->crtc_id, work->base);
        /* set the flip status */
        amdgpuCrtc->pflip_status = AMDGPU_FLIP_SUBMITTED;
-
        spin_unlock_irqrestore(&crtc->dev->event_lock, flags);
+
+       /* Do the flip (mmio) */
+       adev->mode_info.funcs->page_flip(adev, work->crtc_id, work->base);
 }
 
 /*