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>
This commit is contained in:

committed by
Dave Airlie

parent
15d3332f31
commit
7b1f2485db
@@ -199,6 +199,8 @@ static void r420_clock_resume(struct radeon_device *rdev)
|
||||
|
||||
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 @@ static void r420_cp_errata_init(struct radeon_device *rdev)
|
||||
* 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);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user