diff options
author | Jerome Glisse <jglisse@redhat.com> | 2011-11-15 11:48:34 -0500 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2011-12-20 14:52:12 -0500 |
commit | b15ba51207e54245409d6f46e20dab36f906eed1 (patch) | |
tree | b34a37395efa5be0a9af4ba5b627e43813713ed3 /drivers/gpu/drm/radeon/r520.c | |
parent | 1b37078b7ddf35cab12ac6544187e3636d50c0dc (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/r520.c')
-rw-r--r-- | drivers/gpu/drm/radeon/r520.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/drivers/gpu/drm/radeon/r520.c b/drivers/gpu/drm/radeon/r520.c index 39b31544c6e7..4ae1615e752f 100644 --- a/drivers/gpu/drm/radeon/r520.c +++ b/drivers/gpu/drm/radeon/r520.c | |||
@@ -202,9 +202,15 @@ static int r520_startup(struct radeon_device *rdev) | |||
202 | dev_err(rdev->dev, "failed initializing CP (%d).\n", r); | 202 | dev_err(rdev->dev, "failed initializing CP (%d).\n", r); |
203 | return r; | 203 | return r; |
204 | } | 204 | } |
205 | r = r100_ib_init(rdev); | 205 | |
206 | r = radeon_ib_pool_start(rdev); | ||
207 | if (r) | ||
208 | return r; | ||
209 | |||
210 | r = r100_ib_test(rdev); | ||
206 | if (r) { | 211 | if (r) { |
207 | dev_err(rdev->dev, "failed initializing IB (%d).\n", r); | 212 | dev_err(rdev->dev, "failed testing IB (%d).\n", r); |
213 | rdev->accel_working = false; | ||
208 | return r; | 214 | return r; |
209 | } | 215 | } |
210 | return 0; | 216 | return 0; |
@@ -229,6 +235,8 @@ int r520_resume(struct radeon_device *rdev) | |||
229 | rv515_clock_startup(rdev); | 235 | rv515_clock_startup(rdev); |
230 | /* Initialize surface registers */ | 236 | /* Initialize surface registers */ |
231 | radeon_surface_init(rdev); | 237 | radeon_surface_init(rdev); |
238 | |||
239 | rdev->accel_working = true; | ||
232 | return r520_startup(rdev); | 240 | return r520_startup(rdev); |
233 | } | 241 | } |
234 | 242 | ||
@@ -298,7 +306,14 @@ int r520_init(struct radeon_device *rdev) | |||
298 | if (r) | 306 | if (r) |
299 | return r; | 307 | return r; |
300 | rv515_set_safe_registers(rdev); | 308 | rv515_set_safe_registers(rdev); |
309 | |||
310 | r = radeon_ib_pool_init(rdev); | ||
301 | rdev->accel_working = true; | 311 | rdev->accel_working = true; |
312 | if (r) { | ||
313 | dev_err(rdev->dev, "IB initialization failed (%d).\n", r); | ||
314 | rdev->accel_working = false; | ||
315 | } | ||
316 | |||
302 | r = r520_startup(rdev); | 317 | r = r520_startup(rdev); |
303 | if (r) { | 318 | if (r) { |
304 | /* Somethings want wront with the accel init stop accel */ | 319 | /* Somethings want wront with the accel init stop accel */ |