Use write posting in the kickoff function too.
[mesa.git] / src / mesa / drivers / dri / nouveau_winsys / nouveau_local.h
1 #ifndef __NOUVEAU_LOCAL_H__
2 #define __NOUVEAU_LOCAL_H__
3
4 #include <stdio.h>
5
6 /* Debug output */
7 #define NOUVEAU_MSG(fmt, args...) do { \
8 fprintf(stdout, "nouveau: "fmt, ##args); \
9 fflush(stdout); \
10 } while(0)
11
12 #define NOUVEAU_ERR(fmt, args...) do { \
13 fprintf(stderr, "%s:%d - "fmt, __func__, __LINE__, ##args); \
14 fflush(stderr); \
15 } while(0)
16
17 #define NOUVEAU_TIME_MSEC() 0
18
19 /* User FIFO control */
20 //#define NOUVEAU_DMA_TRACE
21 //#define NOUVEAU_DMA_DEBUG
22 //#define NOUVEAU_DMA_DUMP_POSTRELOC_PUSHBUF
23 #define NOUVEAU_DMA_SUBCHAN_LRU
24 #define NOUVEAU_DMA_BARRIER
25 #define NOUVEAU_DMA_TIMEOUT 2000
26
27 /* Push buffer access macros */
28 #define BEGIN_RING(obj,mthd,size) do { \
29 BEGIN_RING_CH(nv->channel, nv->obj, (mthd), (size)); \
30 } while(0)
31
32 #define OUT_RING(data) do { \
33 OUT_RING_CH(nv->channel, (data)); \
34 } while(0)
35
36 #define OUT_RINGp(src,size) do { \
37 OUT_RINGp_CH(nv->channel, (src), (size)); \
38 } while(0)
39
40 #define OUT_RINGf(data) do { \
41 union { float v; uint32_t u; } c; \
42 c.v = (data); \
43 OUT_RING(c.u); \
44 } while(0)
45
46 #define WAIT_RING(size) do { \
47 WAIT_RING_CH(nv->channel, (size)); \
48 } while(0)
49
50 #define FIRE_RING() do { \
51 FIRE_RING_CH(nv->channel); \
52 } while(0)
53
54 #define OUT_RELOC(bo,data,flags,vor,tor) do { \
55 struct nouveau_channel_priv *chan = nouveau_channel(nv->channel); \
56 nouveau_bo_emit_reloc(nv->channel, &chan->pushbuf[chan->dma.cur], \
57 (void*)(bo), (data), (flags), (vor), (tor)); \
58 OUT_RING(0); \
59 } while(0)
60
61 /* Raw data + flags depending on FB/TT buffer */
62 #define OUT_RELOCd(bo,data,flags,vor,tor) do { \
63 OUT_RELOC((bo), (data), (flags) | NOUVEAU_BO_OR, (vor), (tor)); \
64 } while(0)
65
66 /* FB/TT object handle */
67 #define OUT_RELOCo(bo,flags) do { \
68 OUT_RELOC((bo), 0, (flags) | NOUVEAU_BO_OR, \
69 nv->channel->vram->handle, nv->channel->gart->handle); \
70 } while(0)
71
72 /* Low 32-bits of offset */
73 #define OUT_RELOCl(bo,delta,flags) do { \
74 OUT_RELOC((bo), (delta), (flags) | NOUVEAU_BO_LOW, 0, 0); \
75 } while(0)
76
77 /* High 32-bits of offset */
78 #define OUT_RELOCh(bo,delta,flags) do { \
79 OUT_RELOC((bo), (delta), (flags) | NOUVEAU_BO_HIGH, 0, 0); \
80 } while(0)
81
82 #endif