aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
diff options
context:
space:
mode:
authorAndrey Grodzovsky <Andrey.Grodzovsky@amd.com>2016-03-30 17:34:27 -0400
committerAlex Deucher <alexander.deucher@amd.com>2016-05-04 20:19:07 -0400
commitbd4c72d1e9dd7efdb9a990225f32e0130c0884af (patch)
tree01fafadd828a1d5f3b982970ac9d1f1c656362f2 /drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
parentc63dd758589b1f7e8398841d1f443f06ebfbcefc (diff)
drm/amdgpu: Set PFLIP_SUBMITTED for crtc after address update
Also add some pflip debug prints. This change allows us to wait on pflip status until the new surface address is actually submitted to the register. This reverts ed3020e923240829dcdfd3343f6e91dc02c63775 drm/amdgpu: Move MMIO flip out of spinlocked region The original change assumed DAL will aquire locks inside DAL implemetion of page_flip callback which eventaully didn't happen. This moves the flip before status update which makes sense for the non-DAL code pathes as well. Signed-off-by: Andrey Grodzovsky <Andrey.Grodzovsky@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_display.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_display.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
index 3fb405b3a614..0535095c4d14 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
@@ -131,12 +131,17 @@ static void amdgpu_flip_work_func(struct work_struct *__work)
131 vblank->framedur_ns / 1000, 131 vblank->framedur_ns / 1000,
132 vblank->linedur_ns / 1000, stat, vpos, hpos); 132 vblank->linedur_ns / 1000, stat, vpos, hpos);
133 133
134 /* set the flip status */ 134 /* Do the flip (mmio) */
135 adev->mode_info.funcs->page_flip(adev, work->crtc_id, work->base);
136
137 /* Set the flip status */
135 amdgpuCrtc->pflip_status = AMDGPU_FLIP_SUBMITTED; 138 amdgpuCrtc->pflip_status = AMDGPU_FLIP_SUBMITTED;
136 spin_unlock_irqrestore(&crtc->dev->event_lock, flags); 139 spin_unlock_irqrestore(&crtc->dev->event_lock, flags);
137 140
138 /* Do the flip (mmio) */ 141
139 adev->mode_info.funcs->page_flip(adev, work->crtc_id, work->base); 142 DRM_DEBUG_DRIVER("crtc:%d[%p], pflip_stat:AMDGPU_FLIP_SUBMITTED, work: %p,\n",
143 amdgpuCrtc->crtc_id, amdgpuCrtc, work);
144
140} 145}
141 146
142/* 147/*
@@ -252,6 +257,9 @@ int amdgpu_crtc_page_flip(struct drm_crtc *crtc,
252 amdgpu_crtc->pflip_status = AMDGPU_FLIP_PENDING; 257 amdgpu_crtc->pflip_status = AMDGPU_FLIP_PENDING;
253 amdgpu_crtc->pflip_works = work; 258 amdgpu_crtc->pflip_works = work;
254 259
260
261 DRM_DEBUG_DRIVER("crtc:%d[%p], pflip_stat:AMDGPU_FLIP_PENDING, work: %p,\n",
262 amdgpu_crtc->crtc_id, amdgpu_crtc, work);
255 /* update crtc fb */ 263 /* update crtc fb */
256 crtc->primary->fb = fb; 264 crtc->primary->fb = fb;
257 spin_unlock_irqrestore(&crtc->dev->event_lock, flags); 265 spin_unlock_irqrestore(&crtc->dev->event_lock, flags);