• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 
2 #ifndef UTIL_RINGBUFFER_H
3 #define UTIL_RINGBUFFER_H
4 
5 #include "pipe/p_compiler.h"
6 #include "pipe/p_defines.h"       /* only for pipe_error! */
7 
8 /* Generic header
9  */
10 struct util_packet {
11    unsigned dwords:8;
12    unsigned data24:24;
13 };
14 
15 struct util_ringbuffer;
16 
17 struct util_ringbuffer *util_ringbuffer_create( unsigned dwords );
18 
19 void util_ringbuffer_destroy( struct util_ringbuffer *ring );
20 
21 void util_ringbuffer_enqueue( struct util_ringbuffer *ring,
22                               const struct util_packet *packet );
23 
24 enum pipe_error util_ringbuffer_dequeue( struct util_ringbuffer *ring,
25                                          struct util_packet *packet,
26                                          unsigned max_dwords,
27                                          boolean wait );
28 
29 #endif
30