1 #ifndef __NOUVEAU_LOCAL_H__
2 #define __NOUVEAU_LOCAL_H__
7 #define NOUVEAU_MSG(fmt, args...) do { \
8 fprintf(stdout, "nouveau: "fmt, ##args); \
12 #define NOUVEAU_ERR(fmt, args...) do { \
13 fprintf(stderr, "%s:%d - "fmt, __func__, __LINE__, ##args); \
17 #define NOUVEAU_TIME_MSEC() 0
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_BARRIER
24 #define NOUVEAU_DMA_TIMEOUT 2000
26 /* Push buffer access macros */
27 #define OUT_RING(data) do { \
28 (*nv->channel->pushbuf->cur++) = (data); \
31 #define OUT_RINGp(src,size) do { \
32 memcpy(nv->channel->pushbuf->cur, (src), (size)<<2); \
33 nv->channel->pushbuf->cur += (size); \
36 #define OUT_RINGf(data) do { \
37 union { float v; uint32_t u; } c; \
42 #define FIRE_RING() do { \
43 nouveau_pushbuf_flush(nv->channel, 0); \
46 #define BEGIN_RING_GR(obj,mthd,size) do { \
47 if (nv->channel->pushbuf->remaining < ((size) + 1)) \
48 nouveau_pushbuf_flush(nv->channel, ((size) + 1)); \
49 OUT_RING(((obj)->subc << 13) | ((size) << 18) | (mthd)); \
50 nv->channel->pushbuf->remaining -= ((size) + 1); \
53 #define BEGIN_RING(obj,mthd,size) do { \
54 BEGIN_RING_GR(nv->obj, (mthd), (size)); \
57 #define BIND_RING(o,s) do { \
59 BEGIN_RING(o, 0x0000, 1); \
60 OUT_RING (nv->o->handle); \
63 #define OUT_RELOC(buf,data,flags,vor,tor) do { \
64 nouveau_pipe_emit_reloc(nv->channel, nv->channel->pushbuf->cur++, \
65 buf, (data), (flags), (vor), (tor)); \
68 /* Raw data + flags depending on FB/TT buffer */
69 #define OUT_RELOCd(bo,data,flags,vor,tor) do { \
70 OUT_RELOC((bo), (data), (flags) | NOUVEAU_BO_OR, (vor), (tor)); \
73 /* FB/TT object handle */
74 #define OUT_RELOCo(bo,flags) do { \
75 OUT_RELOC((bo), 0, (flags) | NOUVEAU_BO_OR, \
76 nv->channel->vram->handle, nv->channel->gart->handle); \
79 /* Low 32-bits of offset */
80 #define OUT_RELOCl(bo,delta,flags) do { \
81 OUT_RELOC((bo), (delta), (flags) | NOUVEAU_BO_LOW, 0, 0); \
84 /* High 32-bits of offset */
85 #define OUT_RELOCh(bo,delta,flags) do { \
86 OUT_RELOC((bo), (delta), (flags) | NOUVEAU_BO_HIGH, 0, 0); \