aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/radeon/rv515.c
diff options
context:
space:
mode:
authorJerome Glisse <jglisse@redhat.com>2011-11-15 11:48:34 -0500
committerDave Airlie <airlied@redhat.com>2011-12-20 14:52:12 -0500
commitb15ba51207e54245409d6f46e20dab36f906eed1 (patch)
treeb34a37395efa5be0a9af4ba5b627e43813713ed3 /drivers/gpu/drm/radeon/rv515.c
parent1b37078b7ddf35cab12ac6544187e3636d50c0dc (diff)
drm/radeon: introduce a sub allocator and convert ib pool to it v4
Somewhat specializaed sub-allocator designed to perform sub-allocation for command buffer not only for current cs ioctl but for future command submission ioctl as well. Patch also convert current ib pool to use the sub allocator. Idea is that ib poll buffer can be share with other command buffer submission not having 64K granularity. v2 Harmonize pool handling and add suspend/resume callback to pin/unpin sa bo (tested on rv280, rv370, r420, rv515, rv610, rv710, redwood, cayman, rs480, rs690, rs880) v3 Simplify allocator v4 Fix radeon_ib_get error path to properly free fence Signed-off-by: Jerome Glisse <jglisse@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/radeon/rv515.c')
-rw-r--r--drivers/gpu/drm/radeon/rv515.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/drivers/gpu/drm/radeon/rv515.c b/drivers/gpu/drm/radeon/rv515.c
index 21d90d9fe11..880637fd194 100644
--- a/drivers/gpu/drm/radeon/rv515.c
+++ b/drivers/gpu/drm/radeon/rv515.c
@@ -408,9 +408,15 @@ static int rv515_startup(struct radeon_device *rdev)
408 dev_err(rdev->dev, "failed initializing CP (%d).\n", r); 408 dev_err(rdev->dev, "failed initializing CP (%d).\n", r);
409 return r; 409 return r;
410 } 410 }
411 r = r100_ib_init(rdev); 411
412 r = radeon_ib_pool_start(rdev);
413 if (r)
414 return r;
415
416 r = r100_ib_test(rdev);
412 if (r) { 417 if (r) {
413 dev_err(rdev->dev, "failed initializing IB (%d).\n", r); 418 dev_err(rdev->dev, "failed testing IB (%d).\n", r);
419 rdev->accel_working = false;
414 return r; 420 return r;
415 } 421 }
416 return 0; 422 return 0;
@@ -435,6 +441,8 @@ int rv515_resume(struct radeon_device *rdev)
435 rv515_clock_startup(rdev); 441 rv515_clock_startup(rdev);
436 /* Initialize surface registers */ 442 /* Initialize surface registers */
437 radeon_surface_init(rdev); 443 radeon_surface_init(rdev);
444
445 rdev->accel_working = true;
438 return rv515_startup(rdev); 446 return rv515_startup(rdev);
439} 447}
440 448
@@ -531,7 +539,14 @@ int rv515_init(struct radeon_device *rdev)
531 if (r) 539 if (r)
532 return r; 540 return r;
533 rv515_set_safe_registers(rdev); 541 rv515_set_safe_registers(rdev);
542
543 r = radeon_ib_pool_init(rdev);
534 rdev->accel_working = true; 544 rdev->accel_working = true;
545 if (r) {
546 dev_err(rdev->dev, "IB initialization failed (%d).\n", r);
547 rdev->accel_working = false;
548 }
549
535 r = rv515_startup(rdev); 550 r = rv515_startup(rdev);
536 if (r) { 551 if (r) {
537 /* Somethings want wront with the accel init stop accel */ 552 /* Somethings want wront with the accel init stop accel */