aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/radeon/r420.c
diff options
context:
space:
mode:
authorChristian König <deathsimple@vodafone.de>2011-09-23 09:11:23 -0400
committerDave Airlie <airlied@redhat.com>2011-12-20 14:49:46 -0500
commit7b1f2485db253aaa0081e1c5213533e166130732 (patch)
tree77f7e6517d67501108feedfa029f4ea8549a9642 /drivers/gpu/drm/radeon/r420.c
parent15d3332f31afd571a6d23971dbc8d8db2856e661 (diff)
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/r420.c')
-rw-r--r--drivers/gpu/drm/radeon/r420.c22
1 files changed, 13 insertions, 9 deletions
diff --git a/drivers/gpu/drm/radeon/r420.c b/drivers/gpu/drm/radeon/r420.c
index 5dbc378d3c2e..4c0af4955f08 100644
--- a/drivers/gpu/drm/radeon/r420.c
+++ b/drivers/gpu/drm/radeon/r420.c
@@ -199,6 +199,8 @@ static void r420_clock_resume(struct radeon_device *rdev)
199 199
200static void r420_cp_errata_init(struct radeon_device *rdev) 200static void r420_cp_errata_init(struct radeon_device *rdev)
201{ 201{
202 struct radeon_cp *cp = &rdev->cp;
203
202 /* RV410 and R420 can lock up if CP DMA to host memory happens 204 /* RV410 and R420 can lock up if CP DMA to host memory happens
203 * while the 2D engine is busy. 205 * while the 2D engine is busy.
204 * 206 *
@@ -206,22 +208,24 @@ static void r420_cp_errata_init(struct radeon_device *rdev)
206 * of the CP init, apparently. 208 * of the CP init, apparently.
207 */ 209 */
208 radeon_scratch_get(rdev, &rdev->config.r300.resync_scratch); 210 radeon_scratch_get(rdev, &rdev->config.r300.resync_scratch);
209 radeon_ring_lock(rdev, 8); 211 radeon_ring_lock(rdev, cp, 8);
210 radeon_ring_write(rdev, PACKET0(R300_CP_RESYNC_ADDR, 1)); 212 radeon_ring_write(cp, PACKET0(R300_CP_RESYNC_ADDR, 1));
211 radeon_ring_write(rdev, rdev->config.r300.resync_scratch); 213 radeon_ring_write(cp, rdev->config.r300.resync_scratch);
212 radeon_ring_write(rdev, 0xDEADBEEF); 214 radeon_ring_write(cp, 0xDEADBEEF);
213 radeon_ring_unlock_commit(rdev); 215 radeon_ring_unlock_commit(rdev, cp);
214} 216}
215 217
216static void r420_cp_errata_fini(struct radeon_device *rdev) 218static void r420_cp_errata_fini(struct radeon_device *rdev)
217{ 219{
220 struct radeon_cp *cp = &rdev->cp;
221
218 /* Catch the RESYNC we dispatched all the way back, 222 /* Catch the RESYNC we dispatched all the way back,
219 * at the very beginning of the CP init. 223 * at the very beginning of the CP init.
220 */ 224 */
221 radeon_ring_lock(rdev, 8); 225 radeon_ring_lock(rdev, cp, 8);
222 radeon_ring_write(rdev, PACKET0(R300_RB3D_DSTCACHE_CTLSTAT, 0)); 226 radeon_ring_write(cp, PACKET0(R300_RB3D_DSTCACHE_CTLSTAT, 0));
223 radeon_ring_write(rdev, R300_RB3D_DC_FINISH); 227 radeon_ring_write(cp, R300_RB3D_DC_FINISH);
224 radeon_ring_unlock_commit(rdev); 228 radeon_ring_unlock_commit(rdev, cp);
225 radeon_scratch_free(rdev, rdev->config.r300.resync_scratch); 229 radeon_scratch_free(rdev, rdev->config.r300.resync_scratch);
226} 230}
227 231