Tizen 2.0 Release
[profile/ivi/osmesa.git] / src / mesa / drivers / dri / i810 / i810ioctl.h
1
2 #ifndef I810_IOCTL_H
3 #define I810_IOCTL_H
4
5 #include "i810context.h"
6
7 void i810EmitPrim( i810ContextPtr imesa );
8 void i810FlushPrims( i810ContextPtr mmesa ); 
9 void i810FlushPrimsLocked( i810ContextPtr mmesa );
10 void i810FlushPrimsGetBuffer( i810ContextPtr imesa );
11
12 void i810WaitAgeLocked( i810ContextPtr imesa, int age );
13 void i810WaitAge( i810ContextPtr imesa, int age );
14 void i810DmaFinish( i810ContextPtr imesa );
15 void i810RegetLockQuiescent( i810ContextPtr imesa );
16 void i810InitIoctlFuncs( struct dd_function_table *functions );
17 void i810CopyBuffer( const __DRIdrawable *dpriv );
18 void i810PageFlip( const __DRIdrawable *dpriv );
19 int i810_check_copy(int fd);
20
21 #define I810_STATECHANGE(imesa, flag)                           \
22 do {                                                            \
23    if (imesa->vertex_low != imesa->vertex_last_prim)            \
24       i810FlushPrims(imesa);                                    \
25    imesa->dirty |= flag;                                        \
26 } while (0)                                                     \
27
28
29 #define I810_FIREVERTICES(imesa)                                \
30 do {                                                            \
31    if (imesa->vertex_buffer) {                                  \
32       i810FlushPrims(imesa);                                    \
33    }                                                            \
34 } while (0)
35
36 static INLINE GLuint *i810AllocDmaLow( i810ContextPtr imesa, int bytes )
37 {
38    if (imesa->vertex_low + bytes > imesa->vertex_high) 
39       i810FlushPrimsGetBuffer( imesa );
40
41    {
42       GLuint *start = (GLuint *)(imesa->vertex_addr + imesa->vertex_low);
43       imesa->vertex_low += bytes;
44       return start;
45    }
46 }
47
48 #endif