#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"
__func__, radeon->device);
break;
}
+
+ radeon->mman = pb_malloc_bufmgr_create();
+ if (!radeon->mman)
+ return NULL;
return radeon;
}
if (--radeon->refcount > 0) {
return NULL;
}
+
+ radeon->mman->destroy(radeon->mman);
drmClose(radeon->fd);
free(radeon);
return NULL;
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 {
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;