aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/radeon/radeon_test.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/radeon/radeon_test.c')
-rw-r--r--drivers/gpu/drm/radeon/radeon_test.c42
1 files changed, 21 insertions, 21 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_test.c b/drivers/gpu/drm/radeon/radeon_test.c
index 5f4d31ef393..3ab4be9e63d 100644
--- a/drivers/gpu/drm/radeon/radeon_test.c
+++ b/drivers/gpu/drm/radeon/radeon_test.c
@@ -44,7 +44,7 @@ void radeon_test_moves(struct radeon_device *rdev)
44 */ 44 */
45 n = rdev->mc.gtt_size - RADEON_IB_POOL_SIZE*64*1024; 45 n = rdev->mc.gtt_size - RADEON_IB_POOL_SIZE*64*1024;
46 for (i = 0; i < RADEON_NUM_RINGS; ++i) 46 for (i = 0; i < RADEON_NUM_RINGS; ++i)
47 n -= rdev->cp[i].ring_size; 47 n -= rdev->ring[i].ring_size;
48 if (rdev->wb.wb_obj) 48 if (rdev->wb.wb_obj)
49 n -= RADEON_GPU_PAGE_SIZE; 49 n -= RADEON_GPU_PAGE_SIZE;
50 if (rdev->ih.ring_obj) 50 if (rdev->ih.ring_obj)
@@ -236,16 +236,16 @@ out_cleanup:
236} 236}
237 237
238void radeon_test_ring_sync(struct radeon_device *rdev, 238void radeon_test_ring_sync(struct radeon_device *rdev,
239 struct radeon_cp *cpA, 239 struct radeon_ring *ringA,
240 struct radeon_cp *cpB) 240 struct radeon_ring *ringB)
241{ 241{
242 struct radeon_fence *fence = NULL; 242 struct radeon_fence *fence = NULL;
243 struct radeon_semaphore *semaphore = NULL; 243 struct radeon_semaphore *semaphore = NULL;
244 int ringA = radeon_ring_index(rdev, cpA); 244 int ridxA = radeon_ring_index(rdev, ringA);
245 int ringB = radeon_ring_index(rdev, cpB); 245 int ridxB = radeon_ring_index(rdev, ringB);
246 int r; 246 int r;
247 247
248 r = radeon_fence_create(rdev, &fence, ringA); 248 r = radeon_fence_create(rdev, &fence, ridxA);
249 if (r) { 249 if (r) {
250 DRM_ERROR("Failed to create sync fence\n"); 250 DRM_ERROR("Failed to create sync fence\n");
251 goto out_cleanup; 251 goto out_cleanup;
@@ -257,14 +257,14 @@ void radeon_test_ring_sync(struct radeon_device *rdev,
257 goto out_cleanup; 257 goto out_cleanup;
258 } 258 }
259 259
260 r = radeon_ring_lock(rdev, cpA, 64); 260 r = radeon_ring_lock(rdev, ringA, 64);
261 if (r) { 261 if (r) {
262 DRM_ERROR("Failed to lock ring %d\n", ringA); 262 DRM_ERROR("Failed to lock ring A %d\n", ridxA);
263 goto out_cleanup; 263 goto out_cleanup;
264 } 264 }
265 radeon_semaphore_emit_wait(rdev, ringA, semaphore); 265 radeon_semaphore_emit_wait(rdev, ridxA, semaphore);
266 radeon_fence_emit(rdev, fence); 266 radeon_fence_emit(rdev, fence);
267 radeon_ring_unlock_commit(rdev, cpA); 267 radeon_ring_unlock_commit(rdev, ringA);
268 268
269 mdelay(1000); 269 mdelay(1000);
270 270
@@ -273,13 +273,13 @@ void radeon_test_ring_sync(struct radeon_device *rdev,
273 goto out_cleanup; 273 goto out_cleanup;
274 } 274 }
275 275
276 r = radeon_ring_lock(rdev, cpB, 64); 276 r = radeon_ring_lock(rdev, ringB, 64);
277 if (r) { 277 if (r) {
278 DRM_ERROR("Failed to lock ring %d\n", ringB); 278 DRM_ERROR("Failed to lock ring B %p\n", ringB);
279 goto out_cleanup; 279 goto out_cleanup;
280 } 280 }
281 radeon_semaphore_emit_signal(rdev, ringB, semaphore); 281 radeon_semaphore_emit_signal(rdev, ridxB, semaphore);
282 radeon_ring_unlock_commit(rdev, cpB); 282 radeon_ring_unlock_commit(rdev, ringB);
283 283
284 r = radeon_fence_wait(fence, false); 284 r = radeon_fence_wait(fence, false);
285 if (r) { 285 if (r) {
@@ -287,7 +287,7 @@ void radeon_test_ring_sync(struct radeon_device *rdev,
287 goto out_cleanup; 287 goto out_cleanup;
288 } 288 }
289 289
290 DRM_INFO("Syncing between rings %d and %d seems to work.\n", ringA, ringB); 290 DRM_INFO("Syncing between rings %d and %d seems to work.\n", ridxA, ridxB);
291 291
292out_cleanup: 292out_cleanup:
293 if (semaphore) 293 if (semaphore)
@@ -305,20 +305,20 @@ void radeon_test_syncing(struct radeon_device *rdev)
305 int i, j; 305 int i, j;
306 306
307 for (i = 1; i < RADEON_NUM_RINGS; ++i) { 307 for (i = 1; i < RADEON_NUM_RINGS; ++i) {
308 struct radeon_cp *cpA = &rdev->cp[i]; 308 struct radeon_ring *ringA = &rdev->ring[i];
309 if (!cpA->ready) 309 if (!ringA->ready)
310 continue; 310 continue;
311 311
312 for (j = 0; j < i; ++j) { 312 for (j = 0; j < i; ++j) {
313 struct radeon_cp *cpB = &rdev->cp[j]; 313 struct radeon_ring *ringB = &rdev->ring[j];
314 if (!cpB->ready) 314 if (!ringB->ready)
315 continue; 315 continue;
316 316
317 DRM_INFO("Testing syncing between rings %d and %d\n", i, j); 317 DRM_INFO("Testing syncing between rings %d and %d\n", i, j);
318 radeon_test_ring_sync(rdev, cpA, cpB); 318 radeon_test_ring_sync(rdev, ringA, ringB);
319 319
320 DRM_INFO("Testing syncing between rings %d and %d\n", j, i); 320 DRM_INFO("Testing syncing between rings %d and %d\n", j, i);
321 radeon_test_ring_sync(rdev, cpB, cpA); 321 radeon_test_ring_sync(rdev, ringB, ringA);
322 } 322 }
323 } 323 }
324} 324}