summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXiang, Haihao <haihao.xiang@intel.com>2013-08-09 13:40:10 +0800
committerXiang, Haihao <haihao.xiang@intel.com>2013-09-06 15:30:27 +0800
commitdd9c77d4088cd6cd257227e66890929e65d6cd9c (patch)
tree66292b5d7d13f9afeebd00950aa7c01821245a67
parent7c0849287c2fa0186239973a0844592328bca9ba (diff)
A separate batch buffer for video processing
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)
-rwxr-xr-xsrc/i965_drv_video.c4
-rw-r--r--src/i965_drv_video.h1
-rwxr-xr-xsrc/i965_post_processing.c2
3 files changed, 6 insertions, 1 deletions
diff --git a/src/i965_drv_video.c b/src/i965_drv_video.c
index 6942eed..ea1f1d0 100755
--- a/src/i965_drv_video.c
+++ b/src/i965_drv_video.c
@@ -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);
diff --git a/src/i965_drv_video.h b/src/i965_drv_video.h
index 301ebad..a0e7790 100644
--- a/src/i965_drv_video.h
+++ b/src/i965_drv_video.h
@@ -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];
diff --git a/src/i965_post_processing.c b/src/i965_post_processing.c
index e91dc03..2207122 100755
--- a/src/i965_post_processing.c
+++ b/src/i965_post_processing.c
@@ -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;
}
}