aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/radeon/radeon.h
diff options
context:
space:
mode:
authorJerome Glisse <jglisse@redhat.com>2012-05-09 09:34:47 -0400
committerDave Airlie <airlied@redhat.com>2012-05-09 12:22:19 -0400
commit3b7a2b24ea2b703b3af595d0d4ee233ab0b36377 (patch)
tree0f8ccea66571d7ffa556dd55cf8717e429ed59cf /drivers/gpu/drm/radeon/radeon.h
parentbb635567291482a87e4cc46e6683419c1f365ddf (diff)
drm/radeon: rework fence handling, drop fence list v7
Using 64bits fence sequence we can directly compare sequence number to know if a fence is signaled or not. Thus the fence list became useless, so does the fence lock that mainly protected the fence list. Things like ring.ready are no longer behind a lock, this should be ok as ring.ready is initialized once and will only change when facing lockup. Worst case is that we return an -EBUSY just after a successfull GPU reset, or we go into wait state instead of returning -EBUSY (thus delaying reporting -EBUSY to fence wait caller). v2: Remove left over comment, force using writeback on cayman and newer, thus not having to suffer from possibly scratch reg exhaustion v3: Rebase on top of change to uint64 fence patch v4: Change DCE5 test to force write back on cayman and newer but also any APU such as PALM or SUMO family v5: Rebase on top of new uint64 fence patch v6: Just break if seq doesn't change any more. Use radeon_fence prefix for all function names. Even if it's now highly optimized, try avoiding polling to often. v7: We should never poll the last_seq from the hardware without waking the sleeping threads, otherwise we might lose events. Signed-off-by: Jerome Glisse <jglisse@redhat.com> Signed-off-by: Christian König <deathsimple@vodafone.de> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/radeon/radeon.h')
-rw-r--r--drivers/gpu/drm/radeon/radeon.h6
1 files changed, 1 insertions, 5 deletions
diff --git a/drivers/gpu/drm/radeon/radeon.h b/drivers/gpu/drm/radeon/radeon.h
index cdf46bc6dcc4..7c8711793421 100644
--- a/drivers/gpu/drm/radeon/radeon.h
+++ b/drivers/gpu/drm/radeon/radeon.h
@@ -263,15 +263,12 @@ struct radeon_fence_driver {
263 atomic64_t last_seq; 263 atomic64_t last_seq;
264 unsigned long last_activity; 264 unsigned long last_activity;
265 wait_queue_head_t queue; 265 wait_queue_head_t queue;
266 struct list_head emitted;
267 struct list_head signaled;
268 bool initialized; 266 bool initialized;
269}; 267};
270 268
271struct radeon_fence { 269struct radeon_fence {
272 struct radeon_device *rdev; 270 struct radeon_device *rdev;
273 struct kref kref; 271 struct kref kref;
274 struct list_head list;
275 /* protected by radeon_fence.lock */ 272 /* protected by radeon_fence.lock */
276 uint64_t seq; 273 uint64_t seq;
277 /* RB, DMA, etc. */ 274 /* RB, DMA, etc. */
@@ -291,7 +288,7 @@ int radeon_fence_wait_next(struct radeon_device *rdev, int ring);
291int radeon_fence_wait_empty(struct radeon_device *rdev, int ring); 288int radeon_fence_wait_empty(struct radeon_device *rdev, int ring);
292struct radeon_fence *radeon_fence_ref(struct radeon_fence *fence); 289struct radeon_fence *radeon_fence_ref(struct radeon_fence *fence);
293void radeon_fence_unref(struct radeon_fence **fence); 290void radeon_fence_unref(struct radeon_fence **fence);
294int radeon_fence_count_emitted(struct radeon_device *rdev, int ring); 291unsigned radeon_fence_count_emitted(struct radeon_device *rdev, int ring);
295 292
296/* 293/*
297 * Tiling registers 294 * Tiling registers
@@ -1534,7 +1531,6 @@ struct radeon_device {
1534 struct radeon_mode_info mode_info; 1531 struct radeon_mode_info mode_info;
1535 struct radeon_scratch scratch; 1532 struct radeon_scratch scratch;
1536 struct radeon_mman mman; 1533 struct radeon_mman mman;
1537 rwlock_t fence_lock;
1538 struct radeon_fence_driver fence_drv[RADEON_NUM_RINGS]; 1534 struct radeon_fence_driver fence_drv[RADEON_NUM_RINGS];
1539 struct radeon_semaphore_driver semaphore_drv; 1535 struct radeon_semaphore_driver semaphore_drv;
1540 struct mutex ring_lock; 1536 struct mutex ring_lock;