summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/radeon/r200.c
diff options
context:
space:
mode:
authorChristian König <deathsimple@vodafone.de>2011-09-23 15:11:23 +0200
committerDave Airlie <airlied@redhat.com>2011-12-20 19:49:46 +0000
commit7b1f2485db253aaa0081e1c5213533e166130732 (patch)
tree77f7e6517d67501108feedfa029f4ea8549a9642 /drivers/gpu/drm/radeon/r200.c
parent15d3332f31afd571a6d23971dbc8d8db2856e661 (diff)
downloadop-kernel-dev-7b1f2485db253aaa0081e1c5213533e166130732.zip
op-kernel-dev-7b1f2485db253aaa0081e1c5213533e166130732.tar.gz
drm/radeon: make all functions work with multiple rings.
Give all asic and radeon_ring_* functions a radeon_cp parameter, so they know the ring to work with. 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/r200.c')
-rw-r--r--drivers/gpu/drm/radeon/r200.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/drivers/gpu/drm/radeon/r200.c b/drivers/gpu/drm/radeon/r200.c
index a1f3ba0..d84e633f 100644
--- a/drivers/gpu/drm/radeon/r200.c
+++ b/drivers/gpu/drm/radeon/r200.c
@@ -87,6 +87,7 @@ int r200_copy_dma(struct radeon_device *rdev,
unsigned num_gpu_pages,
struct radeon_fence *fence)
{
+ struct radeon_cp *cp = &rdev->cp;
uint32_t size;
uint32_t cur_size;
int i, num_loops;
@@ -95,33 +96,33 @@ int r200_copy_dma(struct radeon_device *rdev,
/* radeon pitch is /64 */
size = num_gpu_pages << RADEON_GPU_PAGE_SHIFT;
num_loops = DIV_ROUND_UP(size, 0x1FFFFF);
- r = radeon_ring_lock(rdev, num_loops * 4 + 64);
+ r = radeon_ring_lock(rdev, cp, num_loops * 4 + 64);
if (r) {
DRM_ERROR("radeon: moving bo (%d).\n", r);
return r;
}
/* Must wait for 2D idle & clean before DMA or hangs might happen */
- radeon_ring_write(rdev, PACKET0(RADEON_WAIT_UNTIL, 0));
- radeon_ring_write(rdev, (1 << 16));
+ radeon_ring_write(cp, PACKET0(RADEON_WAIT_UNTIL, 0));
+ radeon_ring_write(cp, (1 << 16));
for (i = 0; i < num_loops; i++) {
cur_size = size;
if (cur_size > 0x1FFFFF) {
cur_size = 0x1FFFFF;
}
size -= cur_size;
- radeon_ring_write(rdev, PACKET0(0x720, 2));
- radeon_ring_write(rdev, src_offset);
- radeon_ring_write(rdev, dst_offset);
- radeon_ring_write(rdev, cur_size | (1 << 31) | (1 << 30));
+ radeon_ring_write(cp, PACKET0(0x720, 2));
+ radeon_ring_write(cp, src_offset);
+ radeon_ring_write(cp, dst_offset);
+ radeon_ring_write(cp, cur_size | (1 << 31) | (1 << 30));
src_offset += cur_size;
dst_offset += cur_size;
}
- radeon_ring_write(rdev, PACKET0(RADEON_WAIT_UNTIL, 0));
- radeon_ring_write(rdev, RADEON_WAIT_DMA_GUI_IDLE);
+ radeon_ring_write(cp, PACKET0(RADEON_WAIT_UNTIL, 0));
+ radeon_ring_write(cp, RADEON_WAIT_DMA_GUI_IDLE);
if (fence) {
r = radeon_fence_emit(rdev, fence);
}
- radeon_ring_unlock_commit(rdev);
+ radeon_ring_unlock_commit(rdev, cp);
return r;
}
OpenPOWER on IntegriCloud