aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2015-11-23 03:04:05 -0500
committerDaniel Vetter <daniel.vetter@ffwll.ch>2015-11-23 03:04:05 -0500
commit92907cbbef8625bb3998d1eb385fc88f23c97a3f (patch)
tree15626ff9287e37c3cb81c7286d6db5a7fd77c854 /drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
parent15fbfccfe92c62ae8d1ecc647c44157ed01ac02e (diff)
parent1ec218373b8ebda821aec00bb156a9c94fad9cd4 (diff)
Merge tag 'v4.4-rc2' into drm-intel-next-queued
Linux 4.4-rc2 Backmerge to get at commit 1b0e3a049efe471c399674fd954500ce97438d30 Author: Imre Deak <imre.deak@intel.com> Date: Thu Nov 5 23:04:11 2015 +0200 drm/i915/skl: disable display side power well support for now so that we can proplery re-eanble skl power wells in -next. Conflicts are just adjacent lines changed, except for intel_fbdev.c where we need to interleave the changs. Nothing nefarious. Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_display.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_display.c22
1 files changed, 6 insertions, 16 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
index 9b34a3410c32..e173a5a02f0d 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
@@ -47,11 +47,8 @@ static void amdgpu_flip_wait_fence(struct amdgpu_device *adev,
47 fence = to_amdgpu_fence(*f); 47 fence = to_amdgpu_fence(*f);
48 if (fence) { 48 if (fence) {
49 r = fence_wait(&fence->base, false); 49 r = fence_wait(&fence->base, false);
50 if (r == -EDEADLK) { 50 if (r == -EDEADLK)
51 up_read(&adev->exclusive_lock);
52 r = amdgpu_gpu_reset(adev); 51 r = amdgpu_gpu_reset(adev);
53 down_read(&adev->exclusive_lock);
54 }
55 } else 52 } else
56 r = fence_wait(*f, false); 53 r = fence_wait(*f, false);
57 54
@@ -77,7 +74,6 @@ static void amdgpu_flip_work_func(struct work_struct *__work)
77 unsigned long flags; 74 unsigned long flags;
78 unsigned i; 75 unsigned i;
79 76
80 down_read(&adev->exclusive_lock);
81 amdgpu_flip_wait_fence(adev, &work->excl); 77 amdgpu_flip_wait_fence(adev, &work->excl);
82 for (i = 0; i < work->shared_count; ++i) 78 for (i = 0; i < work->shared_count; ++i)
83 amdgpu_flip_wait_fence(adev, &work->shared[i]); 79 amdgpu_flip_wait_fence(adev, &work->shared[i]);
@@ -85,15 +81,12 @@ static void amdgpu_flip_work_func(struct work_struct *__work)
85 /* We borrow the event spin lock for protecting flip_status */ 81 /* We borrow the event spin lock for protecting flip_status */
86 spin_lock_irqsave(&crtc->dev->event_lock, flags); 82 spin_lock_irqsave(&crtc->dev->event_lock, flags);
87 83
88 /* set the proper interrupt */
89 amdgpu_irq_get(adev, &adev->pageflip_irq, work->crtc_id);
90 /* do the flip (mmio) */ 84 /* do the flip (mmio) */
91 adev->mode_info.funcs->page_flip(adev, work->crtc_id, work->base); 85 adev->mode_info.funcs->page_flip(adev, work->crtc_id, work->base);
92 /* set the flip status */ 86 /* set the flip status */
93 amdgpuCrtc->pflip_status = AMDGPU_FLIP_SUBMITTED; 87 amdgpuCrtc->pflip_status = AMDGPU_FLIP_SUBMITTED;
94 88
95 spin_unlock_irqrestore(&crtc->dev->event_lock, flags); 89 spin_unlock_irqrestore(&crtc->dev->event_lock, flags);
96 up_read(&adev->exclusive_lock);
97} 90}
98 91
99/* 92/*
@@ -186,10 +179,6 @@ int amdgpu_crtc_page_flip(struct drm_crtc *crtc,
186 goto cleanup; 179 goto cleanup;
187 } 180 }
188 181
189 fence_get(work->excl);
190 for (i = 0; i < work->shared_count; ++i)
191 fence_get(work->shared[i]);
192
193 amdgpu_bo_get_tiling_flags(new_rbo, &tiling_flags); 182 amdgpu_bo_get_tiling_flags(new_rbo, &tiling_flags);
194 amdgpu_bo_unreserve(new_rbo); 183 amdgpu_bo_unreserve(new_rbo);
195 184
@@ -721,7 +710,7 @@ bool amdgpu_crtc_scaling_mode_fixup(struct drm_crtc *crtc,
721 * an optional accurate timestamp of when query happened. 710 * an optional accurate timestamp of when query happened.
722 * 711 *
723 * \param dev Device to query. 712 * \param dev Device to query.
724 * \param crtc Crtc to query. 713 * \param pipe Crtc to query.
725 * \param flags Flags from caller (DRM_CALLED_FROM_VBLIRQ or 0). 714 * \param flags Flags from caller (DRM_CALLED_FROM_VBLIRQ or 0).
726 * \param *vpos Location where vertical scanout position should be stored. 715 * \param *vpos Location where vertical scanout position should be stored.
727 * \param *hpos Location where horizontal scanout position should go. 716 * \param *hpos Location where horizontal scanout position should go.
@@ -744,8 +733,9 @@ bool amdgpu_crtc_scaling_mode_fixup(struct drm_crtc *crtc,
744 * unknown small number of scanlines wrt. real scanout position. 733 * unknown small number of scanlines wrt. real scanout position.
745 * 734 *
746 */ 735 */
747int amdgpu_get_crtc_scanoutpos(struct drm_device *dev, int crtc, unsigned int flags, 736int amdgpu_get_crtc_scanoutpos(struct drm_device *dev, unsigned int pipe,
748 int *vpos, int *hpos, ktime_t *stime, ktime_t *etime, 737 unsigned int flags, int *vpos, int *hpos,
738 ktime_t *stime, ktime_t *etime,
749 const struct drm_display_mode *mode) 739 const struct drm_display_mode *mode)
750{ 740{
751 u32 vbl = 0, position = 0; 741 u32 vbl = 0, position = 0;
@@ -760,7 +750,7 @@ int amdgpu_get_crtc_scanoutpos(struct drm_device *dev, int crtc, unsigned int fl
760 if (stime) 750 if (stime)
761 *stime = ktime_get(); 751 *stime = ktime_get();
762 752
763 if (amdgpu_display_page_flip_get_scanoutpos(adev, crtc, &vbl, &position) == 0) 753 if (amdgpu_display_page_flip_get_scanoutpos(adev, pipe, &vbl, &position) == 0)
764 ret |= DRM_SCANOUTPOS_VALID; 754 ret |= DRM_SCANOUTPOS_VALID;
765 755
766 /* Get optional system timestamp after query. */ 756 /* Get optional system timestamp after query. */