summaryrefslogtreecommitdiff
path: root/src/xvmc/intel_batchbuffer.h
diff options
context:
space:
mode:
authorXiang, Haihao <haihao.xiang@intel.com>2007-06-25 10:17:08 +0800
committerXiang, Haihao <haihao.xiang@intel.com>2007-07-19 17:28:35 +0800
commit934da9f2b83716bb37d0719a61b8e6b179fff2cd (patch)
treef75e779691c0baeadf4dbff4f24f0a6c9e110de5 /src/xvmc/intel_batchbuffer.h
parentc7920a0e819308762fca3d6fc7ab194bd565b06a (diff)
enable XvMC for i915
Diffstat (limited to 'src/xvmc/intel_batchbuffer.h')
-rw-r--r--src/xvmc/intel_batchbuffer.h42
1 files changed, 42 insertions, 0 deletions
diff --git a/src/xvmc/intel_batchbuffer.h b/src/xvmc/intel_batchbuffer.h
new file mode 100644
index 00000000..5b3e8e1b
--- /dev/null
+++ b/src/xvmc/intel_batchbuffer.h
@@ -0,0 +1,42 @@
+#ifndef _INTEL_BATCHBUFFER_H
+#define _INTEL_BATCHBUFFER_H
+
+/* #define VERBOSE 0 */
+#ifndef VERBOSE
+extern int VERBOSE;
+#endif
+
+#define BATCH_LOCALS char *batch_ptr;
+
+#define BEGIN_BATCH(n) \
+ do { \
+ if (VERBOSE) fprintf(stderr, \
+ "BEGIN_BATCH(%ld) in %s, %d dwords free\n", \
+ ((unsigned long)n), __FUNCTION__, \
+ pI915XvMC->batch.space/4); \
+ if (pI915XvMC->batch.space < (n)*4) \
+ intelFlushBatch(pI915XvMC, TRUE); \
+ batch_ptr = pI915XvMC->batch.ptr; \
+ } while (0)
+
+#define OUT_BATCH(n) \
+ do { \
+ *(GLuint *)batch_ptr = (n); \
+ if (VERBOSE) fprintf(stderr, " -- %08x at %s/%d\n", (n), __FILE__, __LINE__); \
+ batch_ptr += 4; \
+ } while (0)
+
+#define ADVANCE_BATCH() \
+ do { \
+ if (VERBOSE) fprintf(stderr, "ADVANCE_BATCH()\n"); \
+ pI915XvMC->batch.space -= (batch_ptr - pI915XvMC->batch.ptr); \
+ pI915XvMC->batch.ptr = batch_ptr; \
+ assert(pI915XvMC->batch.space >= 0); \
+ } while(0)
+
+extern void intelFlushBatch(i915XvMCContext *, Bool);
+extern void intelBatchbufferData(i915XvMCContext *, const void *, unsigned, unsigned);
+extern void intelInitBatchBuffer(i915XvMCContext *);
+extern void intelDestroyBatchBuffer(i915XvMCContext *);
+extern void intelCmdIoctl(i915XvMCContext *, char *, unsigned);
+#endif /* _INTEL_BATCHBUFFER_H */