diff options
author | Dave Airlie <[email protected]> | 2010-09-17 12:51:04 +1000 |
---|---|---|
committer | Dave Airlie <[email protected]> | 2010-09-17 15:29:31 +1000 |
commit | 189a59751352208cb0386131f9ad82256ec9bed9 (patch) | |
tree | a1637cf7ad4aca4c5e7984e799dbfa349d20c8ee /src/gallium/winsys | |
parent | 7c1fcc41be15b6d648f84c8c1870a3a00575a48f (diff) |
r600g: use malloc bufmgr for constant buffers
Diffstat (limited to 'src/gallium/winsys')
-rw-r--r-- | src/gallium/winsys/r600/drm/radeon.c | 7 | ||||
-rw-r--r-- | src/gallium/winsys/r600/drm/radeon_priv.h | 1 | ||||
-rw-r--r-- | src/gallium/winsys/r600/drm/radeon_ws_bo.c | 2 |
3 files changed, 9 insertions, 1 deletions
diff --git a/src/gallium/winsys/r600/drm/radeon.c b/src/gallium/winsys/r600/drm/radeon.c index 2135b07ab63..7b88075c568 100644 --- a/src/gallium/winsys/r600/drm/radeon.c +++ b/src/gallium/winsys/r600/drm/radeon.c @@ -20,6 +20,7 @@ #include <unistd.h> #include <string.h> #include <errno.h> +#include <pipebuffer/pb_bufmgr.h> #include "xf86drm.h" #include "radeon_priv.h" #include "radeon_drm.h" @@ -125,6 +126,10 @@ struct radeon *radeon_new(int fd, unsigned device) __func__, radeon->device); break; } + + radeon->mman = pb_malloc_bufmgr_create(); + if (!radeon->mman) + return NULL; return radeon; } @@ -143,6 +148,8 @@ struct radeon *radeon_decref(struct radeon *radeon) if (--radeon->refcount > 0) { return NULL; } + + radeon->mman->destroy(radeon->mman); drmClose(radeon->fd); free(radeon); return NULL; diff --git a/src/gallium/winsys/r600/drm/radeon_priv.h b/src/gallium/winsys/r600/drm/radeon_priv.h index 49fe1a6ead1..cb18d159a08 100644 --- a/src/gallium/winsys/r600/drm/radeon_priv.h +++ b/src/gallium/winsys/r600/drm/radeon_priv.h @@ -87,6 +87,7 @@ struct radeon { struct radeon_stype_info *stype; unsigned max_states; boolean use_mem_constant; /* true for evergreen */ + struct pb_manager *mman; /* malloc manager */ }; struct radeon_ws_bo { diff --git a/src/gallium/winsys/r600/drm/radeon_ws_bo.c b/src/gallium/winsys/r600/drm/radeon_ws_bo.c index 422e298a8db..09e379f837d 100644 --- a/src/gallium/winsys/r600/drm/radeon_ws_bo.c +++ b/src/gallium/winsys/r600/drm/radeon_ws_bo.c @@ -12,7 +12,7 @@ struct radeon_ws_bo *radeon_ws_bo(struct radeon *radeon, if (radeon->use_mem_constant && (usage & PIPE_BIND_CONSTANT_BUFFER)) { desc.alignment = alignment; desc.usage = usage; - ws_bo->pb = pb_malloc_buffer_create(size, &desc); + ws_bo->pb = radeon->mman->create_buffer(radeon->mman, size, &desc); if (ws_bo->pb == NULL) { free(ws_bo); return NULL; |