Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 307262
b: refs/heads/master
c: c3b7fe8
h: refs/heads/master
v: v3
  • Loading branch information
Christian König authored and Dave Airlie committed May 9, 2012
1 parent 30dee03 commit 50a67e6
Show file tree
Hide file tree
Showing 4 changed files with 232 additions and 108 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 0085c95061e836f3ed489d042b502733c094e7e4
refs/heads/master: c3b7fe8b8a0b717f90a4a0c49cffae27e46e3fb7
7 changes: 5 additions & 2 deletions trunk/drivers/gpu/drm/radeon/radeon.h
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,9 @@ struct radeon_bo_list {
struct radeon_sa_manager {
spinlock_t lock;
struct radeon_bo *bo;
struct list_head sa_bo;
struct list_head *hole;
struct list_head flist[RADEON_NUM_RINGS];
struct list_head olist;
unsigned size;
uint64_t gpu_addr;
void *cpu_ptr;
Expand All @@ -396,7 +398,8 @@ struct radeon_sa_bo;

/* sub-allocation buffer */
struct radeon_sa_bo {
struct list_head list;
struct list_head olist;
struct list_head flist;
struct radeon_sa_manager *manager;
unsigned soffset;
unsigned eoffset;
Expand Down
19 changes: 8 additions & 11 deletions trunk/drivers/gpu/drm/radeon/radeon_ring.c
Original file line number Diff line number Diff line change
Expand Up @@ -204,25 +204,22 @@ int radeon_ib_schedule(struct radeon_device *rdev, struct radeon_ib *ib)

int radeon_ib_pool_init(struct radeon_device *rdev)
{
struct radeon_sa_manager tmp;
int i, r;

r = radeon_sa_bo_manager_init(rdev, &tmp,
RADEON_IB_POOL_SIZE*64*1024,
RADEON_GEM_DOMAIN_GTT);
if (r) {
return r;
}

radeon_mutex_lock(&rdev->ib_pool.mutex);
if (rdev->ib_pool.ready) {
radeon_mutex_unlock(&rdev->ib_pool.mutex);
radeon_sa_bo_manager_fini(rdev, &tmp);
return 0;
}

rdev->ib_pool.sa_manager = tmp;
INIT_LIST_HEAD(&rdev->ib_pool.sa_manager.sa_bo);
r = radeon_sa_bo_manager_init(rdev, &rdev->ib_pool.sa_manager,
RADEON_IB_POOL_SIZE*64*1024,
RADEON_GEM_DOMAIN_GTT);
if (r) {
radeon_mutex_unlock(&rdev->ib_pool.mutex);
return r;
}

for (i = 0; i < RADEON_IB_POOL_SIZE; i++) {
rdev->ib_pool.ibs[i].fence = NULL;
rdev->ib_pool.ibs[i].idx = i;
Expand Down
Loading

0 comments on commit 50a67e6

Please sign in to comment.