1
/**************************************************************************
3
* Copyright 2006 Tungsten Graphics, Inc., Bismarck, ND., USA
6
* Permission is hereby granted, free of charge, to any person obtaining a
7
* copy of this software and associated documentation files (the
8
* "Software"), to deal in the Software without restriction, including
9
* without limitation the rights to use, copy, modify, merge, publish,
10
* distribute, sub license, and/or sell copies of the Software, and to
11
* permit persons to whom the Software is furnished to do so, subject to
12
* the following conditions:
14
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
17
* THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM,
18
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
19
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
20
* USE OR OTHER DEALINGS IN THE SOFTWARE.
22
* The above copyright notice and this permission notice (including the
23
* next paragraph) shall be included in all copies or substantial portions
27
**************************************************************************/
29
* Authors: Thomas Hellstr�m <thomas-at-tungstengraphics-dot-com>
32
#ifndef _DRI_BUFPOOL_H_
33
#define _DRI_BUFPOOL_H_
36
struct _DriFenceObject;
38
typedef struct _DriBufferPool
41
int (*map) (struct _DriBufferPool * pool, void *private,
42
unsigned flags, int hint, void **virtual);
43
int (*unmap) (struct _DriBufferPool * pool, void *private);
44
int (*destroy) (struct _DriBufferPool * pool, void *private);
45
unsigned long (*offset) (struct _DriBufferPool * pool, void *private);
46
unsigned (*flags) (struct _DriBufferPool * pool, void *private);
47
unsigned long (*size) (struct _DriBufferPool * pool, void *private);
48
void *(*create) (struct _DriBufferPool * pool, unsigned long size,
49
unsigned flags, unsigned hint, unsigned alignment);
50
int (*fence) (struct _DriBufferPool * pool, void *private,
51
struct _DriFenceObject * fence);
52
drmBO *(*kernel) (struct _DriBufferPool * pool, void *private);
53
int (*validate) (struct _DriBufferPool * pool, void *private);
54
void *(*setstatic) (struct _DriBufferPool * pool, unsigned long offset,
55
unsigned long size, void *virtual, unsigned flags);
56
int (*waitIdle) (struct _DriBufferPool *pool, void *private,
58
void (*takeDown) (struct _DriBufferPool * pool);
62
extern void bmError(int val, const char *file, const char *function,
64
#define BM_CKFATAL(val) \
68
bmError(tstVal, __FILE__, __FUNCTION__, __LINE__); \
80
* Kernel buffer objects. Size in multiples of page size. Page size aligned.
83
extern struct _DriBufferPool *driDRMPoolInit(int fd);
84
extern struct _DriBufferPool *driDRMStaticPoolInit(int fd);