summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/radeon/radeon_ring.c
diff options
context:
space:
mode:
authorJerome Glisse <jglisse@redhat.com>2011-12-21 12:13:46 -0500
committerDave Airlie <airlied@redhat.com>2012-01-05 10:03:33 +0000
commit69e130a6a42270f94e6ee0bce34c3480a6b9da61 (patch)
tree025e3a3d94400eb3f6dd15535544d569cc57b5ad /drivers/gpu/drm/radeon/radeon_ring.c
parent1f2e124df90cfc1347fd301409570fa9b0aed2c9 (diff)
drm/radeon: make ib size variable
This avoid to waste ib pool size and avoid a bunch of wait for previous ib to finish. Signed-off-by: Jerome Glisse <jglisse@redhat.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/radeon/radeon_ring.c')
-rw-r--r--drivers/gpu/drm/radeon/radeon_ring.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_ring.c b/drivers/gpu/drm/radeon/radeon_ring.c
index f6a4fbd102a0..bc844fe86ae6 100644
--- a/drivers/gpu/drm/radeon/radeon_ring.c
+++ b/drivers/gpu/drm/radeon/radeon_ring.c
@@ -93,13 +93,16 @@ static bool radeon_ib_try_free(struct radeon_device *rdev,
return done;
}
-int radeon_ib_get(struct radeon_device *rdev, int ring, struct radeon_ib **ib)
+int radeon_ib_get(struct radeon_device *rdev, int ring,
+ struct radeon_ib **ib, unsigned size)
{
struct radeon_fence *fence;
unsigned cretry = 0;
int r = 0, i, idx;
*ib = NULL;
+ /* align size on 256 bytes */
+ size = ALIGN(size, 256);
r = radeon_fence_create(rdev, &fence, ring);
if (r) {
@@ -122,7 +125,7 @@ retry:
if (rdev->ib_pool.ibs[idx].fence == NULL) {
r = radeon_sa_bo_new(rdev, &rdev->ib_pool.sa_manager,
&rdev->ib_pool.ibs[idx].sa_bo,
- 64*1024, 64);
+ size, 256);
if (!r) {
*ib = &rdev->ib_pool.ibs[idx];
(*ib)->ptr = rdev->ib_pool.sa_manager.cpu_ptr;