diff options
author | Jerome Glisse <jglisse@redhat.com> | 2011-12-21 12:13:46 -0500 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2012-01-05 05:03:33 -0500 |
commit | 69e130a6a42270f94e6ee0bce34c3480a6b9da61 (patch) | |
tree | 025e3a3d94400eb3f6dd15535544d569cc57b5ad /drivers/gpu/drm/radeon/radeon_ring.c | |
parent | 1f2e124df90cfc1347fd301409570fa9b0aed2c9 (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.c | 7 |
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, | |||
93 | return done; | 93 | return done; |
94 | } | 94 | } |
95 | 95 | ||
96 | int radeon_ib_get(struct radeon_device *rdev, int ring, struct radeon_ib **ib) | 96 | int radeon_ib_get(struct radeon_device *rdev, int ring, |
97 | struct radeon_ib **ib, unsigned size) | ||
97 | { | 98 | { |
98 | struct radeon_fence *fence; | 99 | struct radeon_fence *fence; |
99 | unsigned cretry = 0; | 100 | unsigned cretry = 0; |
100 | int r = 0, i, idx; | 101 | int r = 0, i, idx; |
101 | 102 | ||
102 | *ib = NULL; | 103 | *ib = NULL; |
104 | /* align size on 256 bytes */ | ||
105 | size = ALIGN(size, 256); | ||
103 | 106 | ||
104 | r = radeon_fence_create(rdev, &fence, ring); | 107 | r = radeon_fence_create(rdev, &fence, ring); |
105 | if (r) { | 108 | if (r) { |
@@ -122,7 +125,7 @@ retry: | |||
122 | if (rdev->ib_pool.ibs[idx].fence == NULL) { | 125 | if (rdev->ib_pool.ibs[idx].fence == NULL) { |
123 | r = radeon_sa_bo_new(rdev, &rdev->ib_pool.sa_manager, | 126 | r = radeon_sa_bo_new(rdev, &rdev->ib_pool.sa_manager, |
124 | &rdev->ib_pool.ibs[idx].sa_bo, | 127 | &rdev->ib_pool.ibs[idx].sa_bo, |
125 | 64*1024, 64); | 128 | size, 256); |
126 | if (!r) { | 129 | if (!r) { |
127 | *ib = &rdev->ib_pool.ibs[idx]; | 130 | *ib = &rdev->ib_pool.ibs[idx]; |
128 | (*ib)->ptr = rdev->ib_pool.sa_manager.cpu_ptr; | 131 | (*ib)->ptr = rdev->ib_pool.sa_manager.cpu_ptr; |