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>
diff --git a/drivers/gpu/drm/radeon/r420.c b/drivers/gpu/drm/radeon/r420.c
index 5dbc378..4c0af49 100644
--- a/drivers/gpu/drm/radeon/r420.c
+++ b/drivers/gpu/drm/radeon/r420.c
@@ -199,6 +199,8 @@
static void r420_cp_errata_init(struct radeon_device *rdev)
{
+ struct radeon_cp *cp = &rdev->cp;
+
/* RV410 and R420 can lock up if CP DMA to host memory happens
* while the 2D engine is busy.
*
@@ -206,22 +208,24 @@
* of the CP init, apparently.
*/
radeon_scratch_get(rdev, &rdev->config.r300.resync_scratch);
- radeon_ring_lock(rdev, 8);
- radeon_ring_write(rdev, PACKET0(R300_CP_RESYNC_ADDR, 1));
- radeon_ring_write(rdev, rdev->config.r300.resync_scratch);
- radeon_ring_write(rdev, 0xDEADBEEF);
- radeon_ring_unlock_commit(rdev);
+ radeon_ring_lock(rdev, cp, 8);
+ radeon_ring_write(cp, PACKET0(R300_CP_RESYNC_ADDR, 1));
+ radeon_ring_write(cp, rdev->config.r300.resync_scratch);
+ radeon_ring_write(cp, 0xDEADBEEF);
+ radeon_ring_unlock_commit(rdev, cp);
}
static void r420_cp_errata_fini(struct radeon_device *rdev)
{
+ struct radeon_cp *cp = &rdev->cp;
+
/* Catch the RESYNC we dispatched all the way back,
* at the very beginning of the CP init.
*/
- radeon_ring_lock(rdev, 8);
- radeon_ring_write(rdev, PACKET0(R300_RB3D_DSTCACHE_CTLSTAT, 0));
- radeon_ring_write(rdev, R300_RB3D_DC_FINISH);
- radeon_ring_unlock_commit(rdev);
+ radeon_ring_lock(rdev, cp, 8);
+ radeon_ring_write(cp, PACKET0(R300_RB3D_DSTCACHE_CTLSTAT, 0));
+ radeon_ring_write(cp, R300_RB3D_DC_FINISH);
+ radeon_ring_unlock_commit(rdev, cp);
radeon_scratch_free(rdev, rdev->config.r300.resync_scratch);
}