#include "ttm_module.h"
-/* default destructor */
-static void ttm_bo_default_destroy(struct ttm_buffer_object *bo)
-{
- kfree(bo);
-}
-
static void ttm_bo_mem_space_debug(struct ttm_buffer_object *bo,
struct ttm_placement *placement)
{
bool locked;
int ret;
- bo->destroy = destroy ? destroy : ttm_bo_default_destroy;
-
+ bo->destroy = destroy;
kref_init(&bo->kref);
INIT_LIST_HEAD(&bo->ddestroy);
bo->bdev = bdev;
kfree(vmw_bo);
}
+/* default destructor */
+static void vmw_bo_default_destroy(struct ttm_buffer_object *bo)
+{
+ kfree(bo);
+}
+
/**
* vmw_bo_create_kernel - Create a pinned BO for internal kernel use.
*
ret = ttm_bo_init_reserved(&dev_priv->bdev, bo, size,
ttm_bo_type_kernel, placement, 0,
- &ctx, NULL, NULL, NULL);
+ &ctx, NULL, NULL, vmw_bo_default_destroy);
if (unlikely(ret))
goto error_free;
{
int ret;
+ BUG_ON(!bo_free);
+
*p_bo = kmalloc(sizeof(**p_bo), GFP_KERNEL);
if (unlikely(!*p_bo)) {
DRM_ERROR("Failed to allocate a buffer.\n");