1 #ifndef _INTEL_BATCHBUFFER_H_
2 #define _INTEL_BATCHBUFFER_H_
7 #include <intel_bufmgr.h>
9 #include "intel_driver.h"
11 struct intel_batchbuffer
13 struct intel_driver_data *intel;
21 Bool intel_batchbuffer_init(struct intel_driver_data *intel);
22 Bool intel_batchbuffer_terminate(struct intel_driver_data *intel);
23 void intel_batchbuffer_emit_dword(VADriverContextP ctx, unsigned int x);
24 void intel_batchbuffer_emit_reloc(VADriverContextP ctx, dri_bo *bo,
25 uint32_t read_domains, uint32_t write_domains,
27 void intel_batchbuffer_require_space(VADriverContextP ctx, unsigned int size);
28 void intel_batchbuffer_data(VADriverContextP ctx, void *data, unsigned int size);
29 void intel_batchbuffer_emit_mi_flush(VADriverContextP ctx);
30 void intel_batchbuffer_start_atomic(VADriverContextP ctx, unsigned int size);
31 void intel_batchbuffer_end_atomic(VADriverContextP ctx);
32 Bool intel_batchbuffer_flush(VADriverContextP ctx);
34 #define BEGIN_BATCH(ctx, n) do { \
35 intel_batchbuffer_require_space(ctx, (n) * 4); \
38 #define OUT_BATCH(ctx, d) do { \
39 intel_batchbuffer_emit_dword(ctx, d); \
42 #define OUT_RELOC(ctx, bo, read_domains, write_domain, delta) do { \
43 assert((delta) >= 0); \
44 intel_batchbuffer_emit_reloc(ctx, bo, \
45 read_domains, write_domain, delta); \
48 #define ADVANCE_BATCH(ctx) do { \
51 #endif /* _INTEL_BATCHBUFFER_H_ */