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_SUBCHAN_LRU
24 #define NOUVEAU_DMA_BARRIER
25 #define NOUVEAU_DMA_TIMEOUT 2000
27 /* Push buffer access macros */
28 #define BEGIN_RING(obj,mthd,size) do { \
29 nv->pushbuf = nouveau_pipe_dma_beginp(nv->obj, (mthd), (size)); \
32 #define OUT_RING(data) do { \
33 (*nv->pushbuf++) = (data); \
36 #define OUT_RINGp(src,size) do { \
37 memcpy(nv->pushbuf, (src), (size)<<2); \
38 nv->pushbuf += (size); \
41 #define OUT_RINGf(data) do { \
42 union { float v; uint32_t u; } c; \
47 #define FIRE_RING() do { \
48 nouveau_pipe_dma_kickoff(nv->channel); \
51 #define OUT_RELOC(bo,data,flags,vor,tor) do { \
52 nouveau_pushbuf_emit_reloc(nv->channel, nv->pushbuf, (void*)(bo), \
53 (data), (flags), (vor), (tor)); \
57 /* Raw data + flags depending on FB/TT buffer */
58 #define OUT_RELOCd(bo,data,flags,vor,tor) do { \
59 OUT_RELOC((bo), (data), (flags) | NOUVEAU_BO_OR, (vor), (tor)); \
62 /* FB/TT object handle */
63 #define OUT_RELOCo(bo,flags) do { \
64 OUT_RELOC((bo), 0, (flags) | NOUVEAU_BO_OR, \
65 nv->channel->vram->handle, nv->channel->gart->handle); \
68 /* Low 32-bits of offset */
69 #define OUT_RELOCl(bo,delta,flags) do { \
70 OUT_RELOC((bo), (delta), (flags) | NOUVEAU_BO_LOW, 0, 0); \
73 /* High 32-bits of offset */
74 #define OUT_RELOCh(bo,delta,flags) do { \
75 OUT_RELOC((bo), (delta), (flags) | NOUVEAU_BO_HIGH, 0, 0); \