Add special macro and command for vebox batch buffer execution.
authorroot <root@xiaowei-hsw.(none)>
Thu, 18 Oct 2012 01:51:49 +0000 (09:51 +0800)
committerXiang, Haihao <haihao.xiang@intel.com>
Mon, 29 Oct 2012 04:39:34 +0000 (12:39 +0800)
 Signed-off-by Li,Xiaowei <xiaowei.a.li@intel.com>

src/i965_defines.h
src/intel_batchbuffer.c
src/intel_batchbuffer.h

index cf9babd..0a5a737 100755 (executable)
 
 #define MFD_JPEG_BSD_OBJECT                     MFX(2, 7, 1, 8)
 
+#define VEB(pipeline, op, sub_opa, sub_opb)     \
+    (3 << 29 |                                  \
+     (pipeline) << 27 |                         \
+     (op) << 24 |                               \
+     (sub_opa) << 21 |                          \
+     (sub_opb) << 16)
+
+#define VEB_SURFACE_STATE                   VEB(2, 4, 0, 0)
+#define VEB_STATE                           VEB(2, 4, 0, 2)
+#define VEB_DNDI_IECP_STATE                 VEB(2, 4, 0, 3)
+
 #define I965_DEPTHFORMAT_D32_FLOAT              1
 
 #define BASE_ADDRESS_MODIFY             (1 << 0)
index 14c9452..6ae1a35 100644 (file)
@@ -39,7 +39,8 @@ intel_batchbuffer_reset(struct intel_batchbuffer *batch)
 
     assert(batch->flag == I915_EXEC_RENDER ||
            batch->flag == I915_EXEC_BLT ||
-           batch->flag == I915_EXEC_BSD);
+           batch->flag == I915_EXEC_BSD ||
+           batch->flag == I915_EXEC_VEBOX);
 
     dri_bo_unreference(batch->buffer);
     batch->buffer = dri_bo_alloc(intel->bufmgr, 
@@ -68,7 +69,8 @@ intel_batchbuffer_new(struct intel_driver_data *intel, int flag)
     struct intel_batchbuffer *batch = calloc(1, sizeof(*batch));
     assert(flag == I915_EXEC_RENDER ||
            flag == I915_EXEC_BSD ||
-           flag == I915_EXEC_BLT);
+           flag == I915_EXEC_BLT ||
+           flag == I915_EXEC_VEBOX);
 
     batch->intel = intel;
     batch->flag = flag;
@@ -188,6 +190,13 @@ intel_batchbuffer_emit_mi_flush(struct intel_batchbuffer *batch)
                 OUT_BLT_BATCH(batch, 0);
                 OUT_BLT_BATCH(batch, 0);
                 ADVANCE_BLT_BATCH(batch);
+            }else if (batch->flag == I915_EXEC_VEBOX) {
+                BEGIN_VEB_BATCH(batch, 4);
+                OUT_VEB_BATCH(batch, MI_FLUSH_DW);
+                OUT_VEB_BATCH(batch, 0);
+                OUT_VEB_BATCH(batch, 0);
+                OUT_VEB_BATCH(batch, 0);
+                ADVANCE_VEB_BATCH(batch);
             } else {
                 assert(batch->flag == I915_EXEC_BSD);
                 BEGIN_BCS_BATCH(batch, 4);
@@ -202,8 +211,8 @@ intel_batchbuffer_emit_mi_flush(struct intel_batchbuffer *batch)
         if (batch->flag == I915_EXEC_RENDER) {
             BEGIN_BATCH(batch, 1);
             OUT_BATCH(batch, MI_FLUSH | MI_FLUSH_STATE_INSTRUCTION_CACHE_INVALIDATE);
-            ADVANCE_BATCH(batch);
-        } else {
+            ADVANCE_BATCH(batch);              
+         } else {
             assert(batch->flag == I915_EXEC_BSD);
             BEGIN_BCS_BATCH(batch, 1);
             OUT_BCS_BATCH(batch, MI_FLUSH | MI_FLUSH_STATE_INSTRUCTION_CACHE_INVALIDATE);
@@ -230,7 +239,8 @@ intel_batchbuffer_check_batchbuffer_flag(struct intel_batchbuffer *batch, int fl
 {
     if (flag != I915_EXEC_RENDER &&
         flag != I915_EXEC_BLT &&
-        flag != I915_EXEC_BSD)
+        flag != I915_EXEC_BSD &&
+        flag != I915_EXEC_VEBOX)
         return;
 
     if (batch->flag == flag)
@@ -276,6 +286,13 @@ intel_batchbuffer_start_atomic_bcs(struct intel_batchbuffer *batch, unsigned int
 }
 
 void
+intel_batchbuffer_start_atomic_veb(struct intel_batchbuffer *batch, unsigned int size)
+{
+    intel_batchbuffer_start_atomic_helper(batch, I915_EXEC_VEBOX, size);
+}
+
+
+void
 intel_batchbuffer_end_atomic(struct intel_batchbuffer *batch)
 {
     assert(batch->atomic);
index 8212de6..25d817b 100644 (file)
@@ -72,11 +72,12 @@ void intel_batchbuffer_align(struct intel_batchbuffer *batch, unsigned int align
 #define BEGIN_BATCH(batch, n)           __BEGIN_BATCH(batch, n, I915_EXEC_RENDER)
 #define BEGIN_BLT_BATCH(batch, n)       __BEGIN_BATCH(batch, n, I915_EXEC_BLT)
 #define BEGIN_BCS_BATCH(batch, n)       __BEGIN_BATCH(batch, n, I915_EXEC_BSD)
-
+#define BEGIN_VEB_BATCH(batch, n)       __BEGIN_BATCH(batch, n, I915_EXEC_VEBOX)
 
 #define OUT_BATCH(batch, d)             __OUT_BATCH(batch, d)
 #define OUT_BLT_BATCH(batch, d)         __OUT_BATCH(batch, d)
 #define OUT_BCS_BATCH(batch, d)         __OUT_BATCH(batch, d)
+#define OUT_VEB_BATCH(batch, d)         __OUT_BATCH(batch, d)
 
 #define OUT_RELOC(batch, bo, read_domains, write_domain, delta) \
     __OUT_RELOC(batch, bo, read_domains, write_domain, delta)
@@ -88,5 +89,6 @@ void intel_batchbuffer_align(struct intel_batchbuffer *batch, unsigned int align
 #define ADVANCE_BATCH(batch)            __ADVANCE_BATCH(batch)
 #define ADVANCE_BLT_BATCH(batch)        __ADVANCE_BATCH(batch)
 #define ADVANCE_BCS_BATCH(batch)        __ADVANCE_BATCH(batch)
+#define ADVANCE_VEB_BATCH(batch)        __ADVANCE_BATCH(batch)
 
 #endif /* _INTEL_BATCHBUFFER_H_ */