aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/radeon/radeon_ring.c
diff options
context:
space:
mode:
authorChristian König <deathsimple@vodafone.de>2012-07-13 07:06:00 -0400
committerChristian König <deathsimple@vodafone.de>2012-07-18 07:17:49 -0400
commit4ef72566f1035fef5abd0913100d13746e066ee3 (patch)
tree48aa82020454839b036e9fe48e969027d322dc87 /drivers/gpu/drm/radeon/radeon_ring.c
parentbfb38d35c1cacb182d8bbda23379397bffeafc8c (diff)
drm/radeon: fix const IB handling v2
Const IBs are executed on the CE not the CP, so we can't fence them in the normal way. So submit them directly before the IB instead, just as the documentation says. v2: keep the extra documentation Signed-off-by: Christian König <deathsimple@vodafone.de> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/radeon/radeon_ring.c')
-rw-r--r--drivers/gpu/drm/radeon/radeon_ring.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_ring.c b/drivers/gpu/drm/radeon/radeon_ring.c
index 75cbe4641138..c48c35403774 100644
--- a/drivers/gpu/drm/radeon/radeon_ring.c
+++ b/drivers/gpu/drm/radeon/radeon_ring.c
@@ -74,7 +74,8 @@ void radeon_ib_free(struct radeon_device *rdev, struct radeon_ib *ib)
74 radeon_fence_unref(&ib->fence); 74 radeon_fence_unref(&ib->fence);
75} 75}
76 76
77int radeon_ib_schedule(struct radeon_device *rdev, struct radeon_ib *ib) 77int radeon_ib_schedule(struct radeon_device *rdev, struct radeon_ib *ib,
78 struct radeon_ib *const_ib)
78{ 79{
79 struct radeon_ring *ring = &rdev->ring[ib->ring]; 80 struct radeon_ring *ring = &rdev->ring[ib->ring];
80 bool need_sync = false; 81 bool need_sync = false;
@@ -105,6 +106,10 @@ int radeon_ib_schedule(struct radeon_device *rdev, struct radeon_ib *ib)
105 if (!need_sync) { 106 if (!need_sync) {
106 radeon_semaphore_free(rdev, &ib->semaphore, NULL); 107 radeon_semaphore_free(rdev, &ib->semaphore, NULL);
107 } 108 }
109 if (const_ib) {
110 radeon_ring_ib_execute(rdev, const_ib->ring, const_ib);
111 radeon_semaphore_free(rdev, &const_ib->semaphore, NULL);
112 }
108 radeon_ring_ib_execute(rdev, ib->ring, ib); 113 radeon_ring_ib_execute(rdev, ib->ring, ib);
109 r = radeon_fence_emit(rdev, &ib->fence, ib->ring); 114 r = radeon_fence_emit(rdev, &ib->fence, ib->ring);
110 if (r) { 115 if (r) {
@@ -112,6 +117,9 @@ int radeon_ib_schedule(struct radeon_device *rdev, struct radeon_ib *ib)
112 radeon_ring_unlock_undo(rdev, ring); 117 radeon_ring_unlock_undo(rdev, ring);
113 return r; 118 return r;
114 } 119 }
120 if (const_ib) {
121 const_ib->fence = radeon_fence_ref(ib->fence);
122 }
115 radeon_ring_unlock_commit(rdev, ring); 123 radeon_ring_unlock_commit(rdev, ring);
116 return 0; 124 return 0;
117} 125}