A separate batch buffer for video processing
authorXiang, Haihao <haihao.xiang@intel.com>
Fri, 9 Aug 2013 05:40:10 +0000 (13:40 +0800)
committerXiang, Haihao <haihao.xiang@intel.com>
Fri, 6 Sep 2013 07:30:27 +0000 (15:30 +0800)
It is easy to result in multithread issue if the rendering code
and video processing code share the same batch buffer

Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
(cherry picked from commit ce0984814269e0923f44196e47f1c7cc2dddc55c)

src/i965_drv_video.c
src/i965_drv_video.h
src/i965_post_processing.c

index 6942eed..ea1f1d0 100755 (executable)
@@ -4795,6 +4795,7 @@ i965_driver_data_init(VADriverContextP ctx)
         goto err_subpic_heap;
 
     i965->batch = intel_batchbuffer_new(&i965->intel, I915_EXEC_RENDER, 0);
+    i965->pp_batch = intel_batchbuffer_new(&i965->intel, I915_EXEC_RENDER, 0);
     _i965InitMutex(&i965->render_mutex);
     _i965InitMutex(&i965->pp_mutex);
 
@@ -4826,6 +4827,9 @@ i965_driver_data_terminate(VADriverContextP ctx)
     if (i965->batch)
         intel_batchbuffer_free(i965->batch);
 
+    if (i965->pp_batch)
+        intel_batchbuffer_free(i965->pp_batch);
+
     i965_destroy_heap(&i965->subpic_heap, i965_destroy_subpic);
     i965_destroy_heap(&i965->image_heap, i965_destroy_image);
     i965_destroy_heap(&i965->buffer_heap, i965_destroy_buffer);
index 301ebad..a0e7790 100644 (file)
@@ -313,6 +313,7 @@ struct i965_driver_data
     _I965Mutex render_mutex;
     _I965Mutex pp_mutex;
     struct intel_batchbuffer *batch;
+    struct intel_batchbuffer *pp_batch;
     struct i965_render_state render_state;
     void *pp_context;
     char va_vendor[256];
index e91dc03..2207122 100755 (executable)
@@ -5147,7 +5147,7 @@ i965_post_processing_init(VADriverContextP ctx)
     if (HAS_PP(i965)) {
         if (pp_context == NULL) {
             pp_context = calloc(1, sizeof(*pp_context));
-            i965_post_processing_context_init(ctx, pp_context, i965->batch);
+            i965_post_processing_context_init(ctx, pp_context, i965->pp_batch);
             i965->pp_context = pp_context;
         }
     }