summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/radeon/radeon_ring.c
diff options
context:
space:
mode:
authorChristian König <deathsimple@vodafone.de>2012-05-02 15:11:23 +0200
committerDave Airlie <airlied@redhat.com>2012-05-03 09:16:38 +0100
commit7b9ef16bd187b7e7f43887afb393d1f89e5bee71 (patch)
treef36f2bcd3207f49361ffdf10ed7a630580da788d /drivers/gpu/drm/radeon/radeon_ring.c
parent67e3c7876878264a81afe0dceb8ac653af8387be (diff)
drm/radeon: make forcing ring activity a common function
Nothing chipset or ring specific with it, so also move it to radon_ring. Signed-off-by: Christian König <deathsimple@vodafone.de> Reviewed-by: Jerome Glisse <jglisse@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/radeon/radeon_ring.c')
-rw-r--r--drivers/gpu/drm/radeon/radeon_ring.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_ring.c b/drivers/gpu/drm/radeon/radeon_ring.c
index 407d90aaa0c3..2eb4c6ed198a 100644
--- a/drivers/gpu/drm/radeon/radeon_ring.c
+++ b/drivers/gpu/drm/radeon/radeon_ring.c
@@ -398,6 +398,22 @@ void radeon_ring_unlock_undo(struct radeon_device *rdev, struct radeon_ring *rin
mutex_unlock(&ring->mutex);
}
+void radeon_ring_force_activity(struct radeon_device *rdev, struct radeon_ring *ring)
+{
+ int r;
+
+ mutex_lock(&ring->mutex);
+ radeon_ring_free_size(rdev, ring);
+ if (ring->rptr == ring->wptr) {
+ r = radeon_ring_alloc(rdev, ring, 1);
+ if (!r) {
+ radeon_ring_write(ring, ring->nop);
+ radeon_ring_commit(rdev, ring);
+ }
+ }
+ mutex_unlock(&ring->mutex);
+}
+
void radeon_ring_lockup_update(struct radeon_ring *ring)
{
ring->last_rptr = ring->rptr;