aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/radeon/radeon_fence.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/radeon/radeon_fence.c')
-rw-r--r--drivers/gpu/drm/radeon/radeon_fence.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_fence.c b/drivers/gpu/drm/radeon/radeon_fence.c
index 69902e623cb..9e7f8921714 100644
--- a/drivers/gpu/drm/radeon/radeon_fence.c
+++ b/drivers/gpu/drm/radeon/radeon_fence.c
@@ -368,6 +368,27 @@ void radeon_fence_process(struct radeon_device *rdev, int ring)
368 } 368 }
369} 369}
370 370
371int radeon_fence_count_emitted(struct radeon_device *rdev, int ring)
372{
373 unsigned long irq_flags;
374 int not_processed = 0;
375
376 read_lock_irqsave(&rdev->fence_lock, irq_flags);
377 if (!rdev->fence_drv[ring].initialized)
378 return 0;
379
380 if (!list_empty(&rdev->fence_drv[ring].emitted)) {
381 struct list_head *ptr;
382 list_for_each(ptr, &rdev->fence_drv[ring].emitted) {
383 /* count up to 3, that's enought info */
384 if (++not_processed >= 3)
385 break;
386 }
387 }
388 read_unlock_irqrestore(&rdev->fence_lock, irq_flags);
389 return not_processed;
390}
391
371int radeon_fence_driver_init(struct radeon_device *rdev, int num_rings) 392int radeon_fence_driver_init(struct radeon_device *rdev, int num_rings)
372{ 393{
373 unsigned long irq_flags; 394 unsigned long irq_flags;