diff options
Diffstat (limited to 'drivers/gpu/drm/radeon/r600.c')
-rw-r--r-- | drivers/gpu/drm/radeon/r600.c | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/drivers/gpu/drm/radeon/r600.c b/drivers/gpu/drm/radeon/r600.c index 59975317674..aaf8cd42943 100644 --- a/drivers/gpu/drm/radeon/r600.c +++ b/drivers/gpu/drm/radeon/r600.c | |||
@@ -2144,7 +2144,7 @@ static int r600_cp_load_microcode(struct radeon_device *rdev) | |||
2144 | 2144 | ||
2145 | int r600_cp_start(struct radeon_device *rdev) | 2145 | int r600_cp_start(struct radeon_device *rdev) |
2146 | { | 2146 | { |
2147 | struct radeon_cp *cp = &rdev->cp; | 2147 | struct radeon_cp *cp = &rdev->cp[RADEON_RING_TYPE_GFX_INDEX]; |
2148 | int r; | 2148 | int r; |
2149 | uint32_t cp_me; | 2149 | uint32_t cp_me; |
2150 | 2150 | ||
@@ -2174,7 +2174,7 @@ int r600_cp_start(struct radeon_device *rdev) | |||
2174 | 2174 | ||
2175 | int r600_cp_resume(struct radeon_device *rdev) | 2175 | int r600_cp_resume(struct radeon_device *rdev) |
2176 | { | 2176 | { |
2177 | struct radeon_cp *cp = &rdev->cp; | 2177 | struct radeon_cp *cp = &rdev->cp[RADEON_RING_TYPE_GFX_INDEX]; |
2178 | u32 tmp; | 2178 | u32 tmp; |
2179 | u32 rb_bufsz; | 2179 | u32 rb_bufsz; |
2180 | int r; | 2180 | int r; |
@@ -2248,7 +2248,7 @@ void r600_ring_init(struct radeon_device *rdev, struct radeon_cp *cp, unsigned r | |||
2248 | void r600_cp_fini(struct radeon_device *rdev) | 2248 | void r600_cp_fini(struct radeon_device *rdev) |
2249 | { | 2249 | { |
2250 | r600_cp_stop(rdev); | 2250 | r600_cp_stop(rdev); |
2251 | radeon_ring_fini(rdev, &rdev->cp); | 2251 | radeon_ring_fini(rdev, &rdev->cp[RADEON_RING_TYPE_GFX_INDEX]); |
2252 | } | 2252 | } |
2253 | 2253 | ||
2254 | 2254 | ||
@@ -2271,7 +2271,7 @@ int r600_ring_test(struct radeon_device *rdev, struct radeon_cp *cp) | |||
2271 | { | 2271 | { |
2272 | uint32_t scratch; | 2272 | uint32_t scratch; |
2273 | uint32_t tmp = 0; | 2273 | uint32_t tmp = 0; |
2274 | unsigned i; | 2274 | unsigned i, ridx = radeon_ring_index(rdev, cp); |
2275 | int r; | 2275 | int r; |
2276 | 2276 | ||
2277 | r = radeon_scratch_get(rdev, &scratch); | 2277 | r = radeon_scratch_get(rdev, &scratch); |
@@ -2282,7 +2282,7 @@ int r600_ring_test(struct radeon_device *rdev, struct radeon_cp *cp) | |||
2282 | WREG32(scratch, 0xCAFEDEAD); | 2282 | WREG32(scratch, 0xCAFEDEAD); |
2283 | r = radeon_ring_lock(rdev, cp, 3); | 2283 | r = radeon_ring_lock(rdev, cp, 3); |
2284 | if (r) { | 2284 | if (r) { |
2285 | DRM_ERROR("radeon: cp failed to lock ring %p (%d).\n", cp, r); | 2285 | DRM_ERROR("radeon: cp failed to lock ring %d (%d).\n", ridx, r); |
2286 | radeon_scratch_free(rdev, scratch); | 2286 | radeon_scratch_free(rdev, scratch); |
2287 | return r; | 2287 | return r; |
2288 | } | 2288 | } |
@@ -2297,10 +2297,10 @@ int r600_ring_test(struct radeon_device *rdev, struct radeon_cp *cp) | |||
2297 | DRM_UDELAY(1); | 2297 | DRM_UDELAY(1); |
2298 | } | 2298 | } |
2299 | if (i < rdev->usec_timeout) { | 2299 | if (i < rdev->usec_timeout) { |
2300 | DRM_INFO("ring test on %p succeeded in %d usecs\n", cp, i); | 2300 | DRM_INFO("ring test on %d succeeded in %d usecs\n", ridx, i); |
2301 | } else { | 2301 | } else { |
2302 | DRM_ERROR("radeon: ring %p test failed (scratch(0x%04X)=0x%08X)\n", | 2302 | DRM_ERROR("radeon: ring %d test failed (scratch(0x%04X)=0x%08X)\n", |
2303 | cp, scratch, tmp); | 2303 | ridx, scratch, tmp); |
2304 | r = -EINVAL; | 2304 | r = -EINVAL; |
2305 | } | 2305 | } |
2306 | radeon_scratch_free(rdev, scratch); | 2306 | radeon_scratch_free(rdev, scratch); |
@@ -2310,7 +2310,7 @@ int r600_ring_test(struct radeon_device *rdev, struct radeon_cp *cp) | |||
2310 | void r600_fence_ring_emit(struct radeon_device *rdev, | 2310 | void r600_fence_ring_emit(struct radeon_device *rdev, |
2311 | struct radeon_fence *fence) | 2311 | struct radeon_fence *fence) |
2312 | { | 2312 | { |
2313 | struct radeon_cp *cp = &rdev->cp; | 2313 | struct radeon_cp *cp = &rdev->cp[fence->ring]; |
2314 | 2314 | ||
2315 | if (rdev->wb.use_event) { | 2315 | if (rdev->wb.use_event) { |
2316 | u64 addr = rdev->wb.gpu_addr + R600_WB_EVENT_OFFSET + | 2316 | u64 addr = rdev->wb.gpu_addr + R600_WB_EVENT_OFFSET + |
@@ -2420,7 +2420,7 @@ void r600_clear_surface_reg(struct radeon_device *rdev, int reg) | |||
2420 | 2420 | ||
2421 | int r600_startup(struct radeon_device *rdev) | 2421 | int r600_startup(struct radeon_device *rdev) |
2422 | { | 2422 | { |
2423 | struct radeon_cp *cp = &rdev->cp; | 2423 | struct radeon_cp *cp = &rdev->cp[RADEON_RING_TYPE_GFX_INDEX]; |
2424 | int r; | 2424 | int r; |
2425 | 2425 | ||
2426 | /* enable pcie gen2 link */ | 2426 | /* enable pcie gen2 link */ |
@@ -2534,7 +2534,7 @@ int r600_suspend(struct radeon_device *rdev) | |||
2534 | r600_audio_fini(rdev); | 2534 | r600_audio_fini(rdev); |
2535 | /* FIXME: we should wait for ring to be empty */ | 2535 | /* FIXME: we should wait for ring to be empty */ |
2536 | r600_cp_stop(rdev); | 2536 | r600_cp_stop(rdev); |
2537 | rdev->cp.ready = false; | 2537 | rdev->cp[RADEON_RING_TYPE_GFX_INDEX].ready = false; |
2538 | r600_irq_suspend(rdev); | 2538 | r600_irq_suspend(rdev); |
2539 | radeon_wb_disable(rdev); | 2539 | radeon_wb_disable(rdev); |
2540 | r600_pcie_gart_disable(rdev); | 2540 | r600_pcie_gart_disable(rdev); |
@@ -2609,8 +2609,8 @@ int r600_init(struct radeon_device *rdev) | |||
2609 | if (r) | 2609 | if (r) |
2610 | return r; | 2610 | return r; |
2611 | 2611 | ||
2612 | rdev->cp.ring_obj = NULL; | 2612 | rdev->cp[RADEON_RING_TYPE_GFX_INDEX].ring_obj = NULL; |
2613 | r600_ring_init(rdev, &rdev->cp, 1024 * 1024); | 2613 | r600_ring_init(rdev, &rdev->cp[RADEON_RING_TYPE_GFX_INDEX], 1024 * 1024); |
2614 | 2614 | ||
2615 | rdev->ih.ring_obj = NULL; | 2615 | rdev->ih.ring_obj = NULL; |
2616 | r600_ih_ring_init(rdev, 64 * 1024); | 2616 | r600_ih_ring_init(rdev, 64 * 1024); |
@@ -2677,7 +2677,7 @@ void r600_fini(struct radeon_device *rdev) | |||
2677 | */ | 2677 | */ |
2678 | void r600_ring_ib_execute(struct radeon_device *rdev, struct radeon_ib *ib) | 2678 | void r600_ring_ib_execute(struct radeon_device *rdev, struct radeon_ib *ib) |
2679 | { | 2679 | { |
2680 | struct radeon_cp *cp = &rdev->cp; | 2680 | struct radeon_cp *cp = &rdev->cp[ib->fence->ring]; |
2681 | 2681 | ||
2682 | /* FIXME: implement */ | 2682 | /* FIXME: implement */ |
2683 | radeon_ring_write(cp, PACKET3(PACKET3_INDIRECT_BUFFER, 2)); | 2683 | radeon_ring_write(cp, PACKET3(PACKET3_INDIRECT_BUFFER, 2)); |
@@ -3518,7 +3518,7 @@ static int r600_debugfs_cp_ring_info(struct seq_file *m, void *data) | |||
3518 | struct drm_info_node *node = (struct drm_info_node *) m->private; | 3518 | struct drm_info_node *node = (struct drm_info_node *) m->private; |
3519 | struct drm_device *dev = node->minor->dev; | 3519 | struct drm_device *dev = node->minor->dev; |
3520 | struct radeon_device *rdev = dev->dev_private; | 3520 | struct radeon_device *rdev = dev->dev_private; |
3521 | struct radeon_cp *cp = &rdev->cp; | 3521 | struct radeon_cp *cp = &rdev->cp[RADEON_RING_TYPE_GFX_INDEX]; |
3522 | unsigned count, i, j; | 3522 | unsigned count, i, j; |
3523 | 3523 | ||
3524 | radeon_ring_free_size(rdev, cp); | 3524 | radeon_ring_free_size(rdev, cp); |