00001 00002 #ifndef INTEL_BE_BATCHBUFFER_H 00003 #define INTEL_BE_BATCHBUFFER_H 00004 00005 #include "i915simple/i915_batch.h" 00006 00007 #include "ws_dri_bufmgr.h" 00008 00009 #define BATCH_RESERVED 16 00010 00011 #define INTEL_DEFAULT_RELOCS 100 00012 #define INTEL_MAX_RELOCS 400 00013 00014 #define INTEL_BATCH_NO_CLIPRECTS 0x1 00015 #define INTEL_BATCH_CLIPRECTS 0x2 00016 00017 struct intel_be_context; 00018 struct intel_be_device; 00019 00020 struct intel_be_batchbuffer 00021 { 00022 struct i915_batchbuffer base; 00023 00024 struct intel_be_context *intel; 00025 struct intel_be_device *device; 00026 00027 struct _DriBufferObject *buffer; 00028 struct _DriFenceObject *last_fence; 00029 uint32_t flags; 00030 00031 struct _DriBufferList *list; 00032 size_t list_count; 00033 00034 uint32_t *reloc; 00035 size_t reloc_size; 00036 size_t nr_relocs; 00037 00038 uint32_t dirty_state; 00039 uint32_t id; 00040 00041 uint32_t poolOffset; 00042 uint8_t *drmBOVirtual; 00043 struct _drmBONode *node; /* Validation list node for this buffer */ 00044 int dest_location; /* Validation list sequence for this buffer */ 00045 }; 00046 00047 struct intel_be_batchbuffer * 00048 intel_be_batchbuffer_alloc(struct intel_be_context *intel); 00049 00050 void 00051 intel_be_batchbuffer_free(struct intel_be_batchbuffer *batch); 00052 00053 void 00054 intel_be_batchbuffer_finish(struct intel_be_batchbuffer *batch); 00055 00056 struct _DriFenceObject * 00057 intel_be_batchbuffer_flush(struct intel_be_batchbuffer *batch); 00058 00059 void 00060 intel_be_batchbuffer_reset(struct intel_be_batchbuffer *batch); 00061 00062 void 00063 intel_be_offset_relocation(struct intel_be_batchbuffer *batch, 00064 unsigned pre_add, 00065 struct _DriBufferObject *driBO, 00066 uint64_t val_flags, 00067 uint64_t val_mask); 00068 00069 #endif