1 #ifndef __NOUVEAU_STATEBUF_H__
2 #define __NOUVEAU_STATEBUF_H__
4 /* state buffers: lightweight state objects interface */
5 /* relocations are not supported, but Gallium CSOs don't require them */
7 struct nouveau_statebuf_builder
16 #define sb_init(var) {var, var + sizeof(var) / sizeof((var)[0])}
17 #define sb_data(sb, v) do {assert((sb).p != (sb).pend); *(sb).p++ = (v);} while(0)
19 #define sb_init(var) {var}
20 #define sb_data(sb, v) *(sb).p++ = (v)
23 #define sb_method(sb, v, n) sb_data(sb, RING_3D(v, n));
25 #define sb_len(sb, var) ((sb).p - (var))
26 #define sb_emit(chan, sb_buf, sb_len) do {WAIT_RING((chan), (sb_len)); OUT_RINGp((chan), (sb_buf), (sb_len)); } while(0)