summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/radeon/radeon_sa.c
diff options
context:
space:
mode:
authorChristian König <deathsimple@vodafone.de>2012-05-09 15:34:52 +0200
committerDave Airlie <airlied@redhat.com>2012-05-09 17:22:34 +0100
commite6661a96647447aee83db976e8aad3d3a5c30cbd (patch)
tree30dc9b424580ed0358c3245c97f5745fc9df5c83 /drivers/gpu/drm/radeon/radeon_sa.c
parent711a9729337466e5ec70c418d33f4bf9fa65c38d (diff)
drm/radeon: keep start and end offset in the SA
Instead of offset + size keep start and end offset directly. Signed-off-by: Christian König <deathsimple@vodafone.de> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/radeon/radeon_sa.c')
-rw-r--r--drivers/gpu/drm/radeon/radeon_sa.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_sa.c b/drivers/gpu/drm/radeon/radeon_sa.c
index 1db056873b4..3bea7ba1e48 100644
--- a/drivers/gpu/drm/radeon/radeon_sa.c
+++ b/drivers/gpu/drm/radeon/radeon_sa.c
@@ -152,11 +152,11 @@ int radeon_sa_bo_new(struct radeon_device *rdev,
offset = 0;
list_for_each_entry(tmp, &sa_manager->sa_bo, list) {
/* room before this object ? */
- if (offset < tmp->offset && (tmp->offset - offset) >= size) {
+ if (offset < tmp->soffset && (tmp->soffset - offset) >= size) {
head = tmp->list.prev;
goto out;
}
- offset = tmp->offset + tmp->size;
+ offset = tmp->eoffset;
wasted = offset % align;
if (wasted) {
wasted = align - wasted;
@@ -166,7 +166,7 @@ int radeon_sa_bo_new(struct radeon_device *rdev,
/* room at the end ? */
head = sa_manager->sa_bo.prev;
tmp = list_entry(head, struct radeon_sa_bo, list);
- offset = tmp->offset + tmp->size;
+ offset = tmp->eoffset;
wasted = offset % align;
if (wasted) {
wasted = align - wasted;
@@ -180,8 +180,8 @@ int radeon_sa_bo_new(struct radeon_device *rdev,
out:
sa_bo->manager = sa_manager;
- sa_bo->offset = offset;
- sa_bo->size = size;
+ sa_bo->soffset = offset;
+ sa_bo->eoffset = offset + size;
list_add(&sa_bo->list, head);
spin_unlock(&sa_manager->lock);
return 0;
@@ -202,7 +202,8 @@ void radeon_sa_bo_dump_debug_info(struct radeon_sa_manager *sa_manager,
spin_lock(&sa_manager->lock);
list_for_each_entry(i, &sa_manager->sa_bo, list) {
- seq_printf(m, "offset %08d: size %4d\n", i->offset, i->size);
+ seq_printf(m, "[%08x %08x] size %4d [%p]\n",
+ i->soffset, i->eoffset, i->eoffset - i->soffset, i);
}
spin_unlock(&sa_manager->lock);
}