summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/intel
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2008-05-30 15:12:15 -0700
committerEric Anholt <[email protected]>2008-05-30 15:12:48 -0700
commitfccc427aac17b3fa17160332e6e6f3c2cef25ca5 (patch)
treef993d4728e8f89f66951be3d2cd741c9bbee09c4 /src/mesa/drivers/dri/intel
parentd8395f9d9eed4040d6fa12f1631dd7c372c73be4 (diff)
[intel-gem] Remember last offset of reused BOs to avoid more kernel relocs.
This is good for about 5% on ipers on 965, and should help any cpu-bound app.
Diffstat (limited to 'src/mesa/drivers/dri/intel')
-rw-r--r--src/mesa/drivers/dri/intel/intel_bufmgr_gem.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/mesa/drivers/dri/intel/intel_bufmgr_gem.c b/src/mesa/drivers/dri/intel/intel_bufmgr_gem.c
index f762b485f6e..3c1c3157e13 100644
--- a/src/mesa/drivers/dri/intel/intel_bufmgr_gem.c
+++ b/src/mesa/drivers/dri/intel/intel_bufmgr_gem.c
@@ -65,6 +65,7 @@ struct intel_validate_entry {
struct dri_gem_bo_bucket_entry {
uint32_t gem_handle;
+ uint32_t last_offset;
struct dri_gem_bo_bucket_entry *next;
};
@@ -306,6 +307,7 @@ dri_gem_bo_alloc(dri_bufmgr *bufmgr, const char *name,
bucket->num_entries--;
bo_gem->gem_handle = entry->gem_handle;
+ bo_gem->bo.offset = entry->last_offset;
free(entry);
}
}
@@ -324,7 +326,6 @@ dri_gem_bo_alloc(dri_bufmgr *bufmgr, const char *name,
}
}
- bo_gem->bo.offset = 0;
bo_gem->bo.virtual = NULL;
bo_gem->bo.bufmgr = bufmgr;
bo_gem->name = name;
@@ -436,6 +437,7 @@ dri_gem_bo_unreference(dri_bo *bo)
entry = calloc(1, sizeof(*entry));
entry->gem_handle = bo_gem->gem_handle;
+ entry->last_offset = bo->offset;
entry->next = NULL;
*bucket->tail = entry;