2008-05-21 14:19:51 -06:00
|
|
|
#ifndef _INTEL_BATCHBUFFER_H
|
|
|
|
#define _INTEL_BATCHBUFFER_H
|
|
|
|
|
|
|
|
/* #define VERBOSE 0 */
|
|
|
|
#ifndef VERBOSE
|
|
|
|
extern int VERBOSE;
|
|
|
|
#endif
|
|
|
|
|
2009-06-25 14:16:43 -06:00
|
|
|
#define BATCH_LOCALS unsigned char *batch_ptr;
|
2008-05-21 14:19:51 -06:00
|
|
|
|
|
|
|
#define BEGIN_BATCH(n) \
|
|
|
|
do { \
|
2010-05-10 16:32:28 -06:00
|
|
|
assert(xvmc_driver->batch.space >= (n) *4); \
|
2009-06-25 14:16:43 -06:00
|
|
|
batch_ptr = xvmc_driver->batch.ptr; \
|
2008-05-21 14:19:51 -06:00
|
|
|
} while (0)
|
|
|
|
|
|
|
|
#define OUT_BATCH(n) \
|
|
|
|
do { \
|
2009-06-25 14:16:43 -06:00
|
|
|
*(unsigned int *)batch_ptr = (n); \
|
2008-05-21 14:19:51 -06:00
|
|
|
batch_ptr += 4; \
|
|
|
|
} while (0)
|
|
|
|
|
2010-05-10 16:32:28 -06:00
|
|
|
#define OUT_RELOC(bo,read_domains,write_domains,delta) \
|
|
|
|
do { \
|
2011-11-29 05:39:02 -07:00
|
|
|
*(unsigned int *)batch_ptr = (delta) + bo->offset; \
|
2010-05-10 16:32:28 -06:00
|
|
|
intel_batch_emit_reloc(bo, read_domains, write_domains, delta, batch_ptr); \
|
|
|
|
batch_ptr += 4; \
|
|
|
|
} while (0)
|
|
|
|
|
2009-06-25 14:16:43 -06:00
|
|
|
#define OUT_BATCH_SHORT(n) \
|
|
|
|
do { \
|
|
|
|
*(short *)batch_ptr = (n); \
|
|
|
|
batch_ptr += 2; \
|
|
|
|
} while (0)
|
|
|
|
|
|
|
|
#define OUT_BATCH_CHAR(n) \
|
|
|
|
do { \
|
|
|
|
*(char *)batch_ptr = (n); \
|
|
|
|
batch_ptr ++; \
|
|
|
|
} while (0)
|
|
|
|
#define ADVANCE_BATCH() \
|
|
|
|
do { \
|
|
|
|
xvmc_driver->batch.space -= (batch_ptr - xvmc_driver->batch.ptr);\
|
|
|
|
xvmc_driver->batch.ptr = batch_ptr; \
|
2008-05-21 14:19:51 -06:00
|
|
|
} while(0)
|
|
|
|
|
2014-02-03 08:54:42 -07:00
|
|
|
extern void intelFlushBatch(void);
|
2008-05-21 14:19:51 -06:00
|
|
|
extern void intelBatchbufferData(const void *, unsigned, unsigned);
|
|
|
|
extern Bool intelInitBatchBuffer(void);
|
|
|
|
extern void intelFiniBatchBuffer(void);
|
|
|
|
extern void intelCmdIoctl(char *, unsigned);
|
2010-05-10 16:32:28 -06:00
|
|
|
extern void intel_batch_emit_reloc(dri_bo * bo, uint32_t read_domain,
|
|
|
|
uint32_t write_domain, uint32_t delta,
|
|
|
|
unsigned char *);
|
2008-05-21 14:19:51 -06:00
|
|
|
#endif /* _INTEL_BATCHBUFFER_H */
|