summaryrefslogtreecommitdiff
path: root/i965_drv_video/intel_batchbuffer.h
diff options
context:
space:
mode:
authorAustin Yuan <shengquan.yuan@intel.com>2009-08-25 03:32:22 +0800
committerAustin Yuan <shengquan.yuan@intel.com>2009-08-25 03:32:22 +0800
commitfb431c22c4aeb593da780faf4f29573e00b01674 (patch)
tree5a07bf5241e51210bc490a8d6c8382e6daaace78 /i965_drv_video/intel_batchbuffer.h
parent49f5210a0aa8d60000a91f69d7f8ad4a682cad53 (diff)
downloadlibva-20090820_5.1.0.0121.tar.gz
Sync latest fd.o libva:master20090820_5.1.0.0121
Signed-off-by: Austin Yuan <shengquan.yuan@intel.com>
Diffstat (limited to 'i965_drv_video/intel_batchbuffer.h')
-rw-r--r--i965_drv_video/intel_batchbuffer.h51
1 files changed, 51 insertions, 0 deletions
diff --git a/i965_drv_video/intel_batchbuffer.h b/i965_drv_video/intel_batchbuffer.h
new file mode 100644
index 0000000..c3a2457
--- /dev/null
+++ b/i965_drv_video/intel_batchbuffer.h
@@ -0,0 +1,51 @@
+#ifndef _INTEL_BATCHBUFFER_H_
+#define _INTEL_BATCHBUFFER_H_
+
+#include <xf86drm.h>
+#include <drm.h>
+#include <i915_drm.h>
+#include <intel_bufmgr.h>
+
+#include "intel_driver.h"
+
+struct intel_batchbuffer
+{
+ struct intel_driver_data *intel;
+ dri_bo *buffer;
+ unsigned int size;
+ unsigned char *map;
+ unsigned char *ptr;
+ int atomic;
+};
+
+Bool intel_batchbuffer_init(struct intel_driver_data *intel);
+Bool intel_batchbuffer_terminate(struct intel_driver_data *intel);
+void intel_batchbuffer_emit_dword(VADriverContextP ctx, unsigned int x);
+void intel_batchbuffer_emit_reloc(VADriverContextP ctx, dri_bo *bo,
+ uint32_t read_domains, uint32_t write_domains,
+ uint32_t delta);
+void intel_batchbuffer_require_space(VADriverContextP ctx, unsigned int size);
+void intel_batchbuffer_data(VADriverContextP ctx, void *data, unsigned int size);
+void intel_batchbuffer_emit_mi_flush(VADriverContextP ctx);
+void intel_batchbuffer_start_atomic(VADriverContextP ctx, unsigned int size);
+void intel_batchbuffer_end_atomic(VADriverContextP ctx);
+Bool intel_batchbuffer_flush(VADriverContextP ctx);
+
+#define BEGIN_BATCH(ctx, n) do { \
+ intel_batchbuffer_require_space(ctx, (n) * 4); \
+} while (0)
+
+#define OUT_BATCH(ctx, d) do { \
+ intel_batchbuffer_emit_dword(ctx, d); \
+} while (0)
+
+#define OUT_RELOC(ctx, bo, read_domains, write_domain, delta) do { \
+ assert((delta) >= 0); \
+ intel_batchbuffer_emit_reloc(ctx, bo, \
+ read_domains, write_domain, delta); \
+} while (0)
+
+#define ADVANCE_BATCH(ctx) do { \
+} while (0)
+
+#endif /* _INTEL_BATCHBUFFER_H_ */