aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/radeon/radeon_cs.c
diff options
context:
space:
mode:
authorChristian König <deathsimple@vodafone.de>2012-07-13 07:06:00 -0400
committerChristian König <deathsimple@vodafone.de>2012-07-18 07:17:49 -0400
commit4ef72566f1035fef5abd0913100d13746e066ee3 (patch)
tree48aa82020454839b036e9fe48e969027d322dc87 /drivers/gpu/drm/radeon/radeon_cs.c
parentbfb38d35c1cacb182d8bbda23379397bffeafc8c (diff)
drm/radeon: fix const IB handling v2
Const IBs are executed on the CE not the CP, so we can't fence them in the normal way. So submit them directly before the IB instead, just as the documentation says. v2: keep the extra documentation Signed-off-by: Christian König <deathsimple@vodafone.de> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/radeon/radeon_cs.c')
-rw-r--r--drivers/gpu/drm/radeon/radeon_cs.c25
1 files changed, 12 insertions, 13 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_cs.c b/drivers/gpu/drm/radeon/radeon_cs.c
index 553da67a4cd..8a4c49ef0cc 100644
--- a/drivers/gpu/drm/radeon/radeon_cs.c
+++ b/drivers/gpu/drm/radeon/radeon_cs.c
@@ -354,7 +354,7 @@ static int radeon_cs_ib_chunk(struct radeon_device *rdev,
354 } 354 }
355 radeon_cs_sync_rings(parser); 355 radeon_cs_sync_rings(parser);
356 parser->ib.vm_id = 0; 356 parser->ib.vm_id = 0;
357 r = radeon_ib_schedule(rdev, &parser->ib); 357 r = radeon_ib_schedule(rdev, &parser->ib, NULL);
358 if (r) { 358 if (r) {
359 DRM_ERROR("Failed to schedule IB !\n"); 359 DRM_ERROR("Failed to schedule IB !\n");
360 } 360 }
@@ -452,25 +452,24 @@ static int radeon_cs_ib_vm_chunk(struct radeon_device *rdev,
452 } 452 }
453 radeon_cs_sync_rings(parser); 453 radeon_cs_sync_rings(parser);
454 454
455 parser->ib.vm_id = vm->id;
456 /* ib pool is bind at 0 in virtual address space,
457 * so gpu_addr is the offset inside the pool bo
458 */
459 parser->ib.gpu_addr = parser->ib.sa_bo->soffset;
460
455 if ((rdev->family >= CHIP_TAHITI) && 461 if ((rdev->family >= CHIP_TAHITI) &&
456 (parser->chunk_const_ib_idx != -1)) { 462 (parser->chunk_const_ib_idx != -1)) {
457 parser->const_ib.vm_id = vm->id; 463 parser->const_ib.vm_id = vm->id;
458 /* ib pool is bind at 0 in virtual address space to gpu_addr is the 464 /* ib pool is bind at 0 in virtual address space,
459 * offset inside the pool bo 465 * so gpu_addr is the offset inside the pool bo
460 */ 466 */
461 parser->const_ib.gpu_addr = parser->const_ib.sa_bo->soffset; 467 parser->const_ib.gpu_addr = parser->const_ib.sa_bo->soffset;
462 r = radeon_ib_schedule(rdev, &parser->const_ib); 468 r = radeon_ib_schedule(rdev, &parser->ib, &parser->const_ib);
463 if (r) 469 } else {
464 goto out; 470 r = radeon_ib_schedule(rdev, &parser->ib, NULL);
465 } 471 }
466 472
467 parser->ib.vm_id = vm->id;
468 /* ib pool is bind at 0 in virtual address space to gpu_addr is the
469 * offset inside the pool bo
470 */
471 parser->ib.gpu_addr = parser->ib.sa_bo->soffset;
472 parser->ib.is_const_ib = false;
473 r = radeon_ib_schedule(rdev, &parser->ib);
474out: 473out:
475 if (!r) { 474 if (!r) {
476 if (vm->fence) { 475 if (vm->fence) {