diff options
Diffstat (limited to 'src')
-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; |