ws_dri_mallocpool.c File Reference

Include dependency graph for ws_dri_mallocpool.c:

Go to the source code of this file.

Functions

static void * pool_create (struct _DriBufferPool *pool, unsigned long size, uint64_t flags, unsigned hint, unsigned alignment)
static int pool_destroy (struct _DriBufferPool *pool, void *private)
static int pool_waitIdle (struct _DriBufferPool *pool, void *private, pipe_mutex *mutex, int lazy)
static int pool_map (struct _DriBufferPool *pool, void *private, unsigned flags, int hint, pipe_mutex *mutex, void **virtual)
static int pool_unmap (struct _DriBufferPool *pool, void *private)
static unsigned long pool_offset (struct _DriBufferPool *pool, void *private)
static unsigned long pool_poolOffset (struct _DriBufferPool *pool, void *private)
static uint64_t pool_flags (struct _DriBufferPool *pool, void *private)
static unsigned long pool_size (struct _DriBufferPool *pool, void *private)
static int pool_fence (struct _DriBufferPool *pool, void *private, struct _DriFenceObject *fence)
static drmBO * pool_kernel (struct _DriBufferPool *pool, void *private)
static void pool_takedown (struct _DriBufferPool *pool)
struct _DriBufferPooldriMallocPoolInit (void)


Function Documentation

struct _DriBufferPool* driMallocPoolInit ( void   )  [read]

Definition at line 137 of file ws_dri_mallocpool.c.

References _DriBufferPool::create, _DriBufferPool::data, _DriBufferPool::destroy, _DriBufferPool::fd, _DriBufferPool::fence, _DriBufferPool::flags, _DriBufferPool::kernel, _DriBufferPool::map, _DriBufferPool::offset, pool_create(), pool_destroy(), pool_fence(), pool_flags(), pool_kernel(), pool_map(), pool_offset(), pool_poolOffset(), pool_size(), pool_takedown(), pool_unmap(), pool_waitIdle(), _DriBufferPool::poolOffset, _DriBufferPool::size, _DriBufferPool::takeDown, _DriBufferPool::unmap, _DriBufferPool::validate, and _DriBufferPool::waitIdle.

00138 {
00139    struct _DriBufferPool *pool;
00140 
00141    pool = (struct _DriBufferPool *) malloc(sizeof(*pool));
00142    if (!pool)
00143        return NULL;
00144 
00145    pool->data = NULL;
00146    pool->fd = -1;
00147    pool->map = &pool_map;
00148    pool->unmap = &pool_unmap;
00149    pool->destroy = &pool_destroy;
00150    pool->offset = &pool_offset;
00151    pool->poolOffset = &pool_poolOffset;
00152    pool->flags = &pool_flags;
00153    pool->size = &pool_size;
00154    pool->create = &pool_create;
00155    pool->fence = &pool_fence;
00156    pool->kernel = &pool_kernel;
00157    pool->validate = NULL;
00158    pool->waitIdle = &pool_waitIdle;
00159    pool->takeDown = &pool_takedown;
00160    return pool;
00161 }

static void* pool_create ( struct _DriBufferPool pool,
unsigned long  size,
uint64_t  flags,
unsigned  hint,
unsigned  alignment 
) [static]

Definition at line 41 of file ws_dri_mallocpool.c.

00044 {
00045     unsigned long *private = malloc(size + 2*sizeof(unsigned long));
00046     if ((flags & DRM_BO_MASK_MEM) != DRM_BO_FLAG_MEM_LOCAL)
00047       abort();
00048 
00049     *private = size;
00050     return (void *)private;
00051 }

static int pool_destroy ( struct _DriBufferPool pool,
void *  private 
) [static]

Definition at line 55 of file ws_dri_mallocpool.c.

00056 {
00057     free(private);
00058     return 0;
00059 }

static int pool_fence ( struct _DriBufferPool pool,
void *  private,
struct _DriFenceObject fence 
) [static]

Definition at line 115 of file ws_dri_mallocpool.c.

00117 {
00118     abort();
00119     return 0UL;
00120 }

static uint64_t pool_flags ( struct _DriBufferPool pool,
void *  private 
) [static]

Definition at line 102 of file ws_dri_mallocpool.c.

00103 {
00104     return DRM_BO_FLAG_MEM_LOCAL | DRM_BO_FLAG_CACHED;
00105 }

static drmBO* pool_kernel ( struct _DriBufferPool pool,
void *  private 
) [static]

Definition at line 123 of file ws_dri_mallocpool.c.

00124 {
00125     abort();
00126     return NULL;
00127 }

static int pool_map ( struct _DriBufferPool pool,
void *  private,
unsigned  flags,
int  hint,
pipe_mutex mutex,
void **  virtual 
) [static]

Definition at line 69 of file ws_dri_mallocpool.c.

00071 {
00072     *virtual = (void *)((unsigned long *)private + 2);
00073     return 0;
00074 }

static unsigned long pool_offset ( struct _DriBufferPool pool,
void *  private 
) [static]

Definition at line 83 of file ws_dri_mallocpool.c.

00084 {
00085     /*
00086      * BUG
00087      */
00088     abort();
00089     return 0UL;
00090 }

static unsigned long pool_poolOffset ( struct _DriBufferPool pool,
void *  private 
) [static]

Definition at line 93 of file ws_dri_mallocpool.c.

00094 {
00095     /*
00096      * BUG
00097      */
00098     abort();
00099 }

static unsigned long pool_size ( struct _DriBufferPool pool,
void *  private 
) [static]

Definition at line 108 of file ws_dri_mallocpool.c.

00109 {
00110     return *(unsigned long *) private;
00111 }

static void pool_takedown ( struct _DriBufferPool pool  )  [static]

Definition at line 130 of file ws_dri_mallocpool.c.

00131 {
00132     free(pool);
00133 }

static int pool_unmap ( struct _DriBufferPool pool,
void *  private 
) [static]

Definition at line 77 of file ws_dri_mallocpool.c.

00078 {
00079     return 0;
00080 }

static int pool_waitIdle ( struct _DriBufferPool pool,
void *  private,
pipe_mutex mutex,
int  lazy 
) [static]

Definition at line 62 of file ws_dri_mallocpool.c.

00064 {
00065     return 0;
00066 }


Generated on Tue Sep 29 06:25:45 2009 for Gallium3D by  doxygen 1.5.4