summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/common/dri_bufmgr_fake.c
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2007-05-24 16:55:06 -0700
committerEric Anholt <eric@anholt.net>2007-05-24 16:55:06 -0700
commitb9323aa2cb4563fba1b328dbc802d673449056ac (patch)
treea2711a7b2152971311607ef72186c86b244e3738 /src/mesa/drivers/dri/common/dri_bufmgr_fake.c
parentfd9d27e0686f5a15803d13d207e58be1972fdf31 (diff)
Replace the flags/hint arguments to bo_alloc{,_static} with a location mask.
Now, allocations only take locations, rather than a variety of unused flags. The only interesting flag before was the no_move/no_evict pair for scanout and similar buffers, which the DRI drivers don't use. That will be readded when we get to using this code for display buffer allocation, by adding a pin/unpin call (dynamic pinning/unpinning may be useful for VT switching and root window resizing). This commit changes one instance of DRM_BO_FLAG_MEM_LOCAL with DRM_BO_FLAG_MEM_TT, which appeared to have been unintentional.
Diffstat (limited to 'src/mesa/drivers/dri/common/dri_bufmgr_fake.c')
-rw-r--r--src/mesa/drivers/dri/common/dri_bufmgr_fake.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/mesa/drivers/dri/common/dri_bufmgr_fake.c b/src/mesa/drivers/dri/common/dri_bufmgr_fake.c
index daa09cc5cd..90a2ff85f9 100644
--- a/src/mesa/drivers/dri/common/dri_bufmgr_fake.c
+++ b/src/mesa/drivers/dri/common/dri_bufmgr_fake.c
@@ -541,9 +541,9 @@ dri_bufmgr_fake_contended_lock_take(dri_bufmgr *bufmgr)
}
static dri_bo *
-dri_fake_alloc(dri_bufmgr *bufmgr, const char *name,
- unsigned long size, unsigned int alignment, unsigned int flags,
- unsigned int hint)
+dri_fake_bo_alloc(dri_bufmgr *bufmgr, const char *name,
+ unsigned long size, unsigned int alignment,
+ unsigned int location_mask)
{
dri_bufmgr_fake *bufmgr_fake;
dri_bo_fake *bo_fake;
@@ -567,16 +567,16 @@ dri_fake_alloc(dri_bufmgr *bufmgr, const char *name,
bo_fake->alignment = alignment;
bo_fake->id = ++bufmgr_fake->buf_nr;
bo_fake->name = name;
- bo_fake->flags = flags;
+ bo_fake->flags = 0;
bo_fake->is_static = GL_FALSE;
return &bo_fake->bo;
}
static dri_bo *
-dri_fake_alloc_static(dri_bufmgr *bufmgr, const char *name,
- unsigned long offset, unsigned long size, void *virtual,
- unsigned int flags, unsigned int hint)
+dri_fake_bo_alloc_static(dri_bufmgr *bufmgr, const char *name,
+ unsigned long offset, unsigned long size,
+ void *virtual, unsigned int location_mask)
{
dri_bufmgr_fake *bufmgr_fake;
dri_bo_fake *bo_fake;
@@ -593,7 +593,7 @@ dri_fake_alloc_static(dri_bufmgr *bufmgr, const char *name,
bo_fake->bo.bufmgr = bufmgr;
bo_fake->refcount = 1;
bo_fake->name = name;
- bo_fake->flags = flags;
+ bo_fake->flags = DRM_BO_FLAG_NO_EVICT | DRM_BO_FLAG_NO_MOVE;
bo_fake->is_static = GL_TRUE;
return &bo_fake->bo;
@@ -854,8 +854,8 @@ dri_bufmgr_fake_init(unsigned long low_offset, void *low_virtual,
_glthread_INIT_MUTEX(bufmgr_fake->mutex);
/* Hook in methods */
- bufmgr_fake->bufmgr.bo_alloc = dri_fake_alloc;
- bufmgr_fake->bufmgr.bo_alloc_static = dri_fake_alloc_static;
+ bufmgr_fake->bufmgr.bo_alloc = dri_fake_bo_alloc;
+ bufmgr_fake->bufmgr.bo_alloc_static = dri_fake_bo_alloc_static;
bufmgr_fake->bufmgr.bo_reference = dri_fake_bo_reference;
bufmgr_fake->bufmgr.bo_unreference = dri_fake_bo_unreference;
bufmgr_fake->bufmgr.bo_map = dri_fake_bo_map;