summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/i810/i810ioctl.h
blob: 748d29ae36aec1cf89423faa1ad5bb1ba3f9ce80 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48

#ifndef I810_IOCTL_H
#define I810_IOCTL_H

#include "i810context.h"

void i810EmitPrim( i810ContextPtr imesa );
void i810FlushPrims( i810ContextPtr mmesa ); 
void i810FlushPrimsLocked( i810ContextPtr mmesa );
void i810FlushPrimsGetBuffer( i810ContextPtr imesa );

void i810WaitAgeLocked( i810ContextPtr imesa, int age );
void i810WaitAge( i810ContextPtr imesa, int age );
void i810DmaFinish( i810ContextPtr imesa );
void i810RegetLockQuiescent( i810ContextPtr imesa );
void i810InitIoctlFuncs( struct dd_function_table *functions );
void i810CopyBuffer( const __DRIdrawablePrivate *dpriv );
void i810PageFlip( const __DRIdrawablePrivate *dpriv );
int i810_check_copy(int fd);

#define I810_STATECHANGE(imesa, flag)				\
do {								\
   if (imesa->vertex_low != imesa->vertex_last_prim)		\
      i810FlushPrims(imesa);					\
   imesa->dirty |= flag;					\
} while (0)							\


#define I810_FIREVERTICES(imesa)				\
do {								\
   if (imesa->vertex_buffer) {					\
      i810FlushPrims(imesa);					\
   }								\
} while (0)

static __inline GLuint *i810AllocDmaLow( i810ContextPtr imesa, int bytes )
{
   if (imesa->vertex_low + bytes > imesa->vertex_high) 
      i810FlushPrimsGetBuffer( imesa );

   {
      GLuint *start = (GLuint *)(imesa->vertex_addr + imesa->vertex_low);
      imesa->vertex_low += bytes;
      return start;
   }
}

#endif