summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/common/dri_bufmgr.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.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.c')
-rw-r--r--src/mesa/drivers/dri/common/dri_bufmgr.c22
1 files changed, 17 insertions, 5 deletions
diff --git a/src/mesa/drivers/dri/common/dri_bufmgr.c b/src/mesa/drivers/dri/common/dri_bufmgr.c
index 154e7841a0..840fc7601a 100644
--- a/src/mesa/drivers/dri/common/dri_bufmgr.c
+++ b/src/mesa/drivers/dri/common/dri_bufmgr.c
@@ -35,18 +35,30 @@
dri_bo *
dri_bo_alloc(dri_bufmgr *bufmgr, const char *name, unsigned long size,
- unsigned int alignment, unsigned int flags, unsigned int hint)
+ unsigned int alignment, unsigned int location_mask)
{
- return bufmgr->bo_alloc(bufmgr, name, size, alignment, flags, hint);
+ assert((location_mask & ~(DRM_BO_FLAG_MEM_LOCAL | DRM_BO_FLAG_MEM_TT |
+ DRM_BO_FLAG_MEM_VRAM | DRM_BO_FLAG_MEM_PRIV0 |
+ DRM_BO_FLAG_MEM_PRIV1 | DRM_BO_FLAG_MEM_PRIV2 |
+ DRM_BO_FLAG_MEM_PRIV3 |
+ DRM_BO_FLAG_MEM_PRIV4)) == 0);
+
+ return bufmgr->bo_alloc(bufmgr, name, size, alignment, location_mask);
}
dri_bo *
dri_bo_alloc_static(dri_bufmgr *bufmgr, const char *name, unsigned long offset,
- unsigned long size, void *virtual, unsigned int flags,
- unsigned int hint)
+ unsigned long size, void *virtual,
+ unsigned int location_mask)
{
+ assert((location_mask & ~(DRM_BO_FLAG_MEM_LOCAL | DRM_BO_FLAG_MEM_TT |
+ DRM_BO_FLAG_MEM_VRAM | DRM_BO_FLAG_MEM_PRIV0 |
+ DRM_BO_FLAG_MEM_PRIV1 | DRM_BO_FLAG_MEM_PRIV2 |
+ DRM_BO_FLAG_MEM_PRIV3 |
+ DRM_BO_FLAG_MEM_PRIV4)) == 0);
+
return bufmgr->bo_alloc_static(bufmgr, name, offset, size, virtual,
- flags, hint);
+ location_mask);
}
void