OSDN Git Service

Add one field for Config/Context/Surface/Buffer to store the wrapper content
authorZhao Yakui <yakui.zhao@intel.com>
Sun, 6 Sep 2015 01:39:08 +0000 (09:39 +0800)
committerXiang, Haihao <haihao.xiang@intel.com>
Sun, 6 Sep 2015 07:13:58 +0000 (15:13 +0800)
This is to do the preparation that the libva-intel-driver can be the user of
other backend driver.

Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
Signed-off-by: Sean V Kelley <seanvk@posteo.de>
(cherry picked from commit 2f254ecd154d59553a1e3949f66161bade6ca2b7)

src/i965_drv_video.c
src/i965_drv_video.h

index 85ef6aa..a446b74 100644 (file)
@@ -881,6 +881,7 @@ i965_CreateConfig(VADriverContextP ctx,
     obj_config->profile = profile;
     obj_config->entrypoint = entrypoint;
     obj_config->num_attribs = 0;
+    obj_config->wrapper_config = VA_INVALID_ID;
 
     for (i = 0; i < num_attribs; i++) {
         vaStatus = i965_ensure_config_attribute(obj_config, &attrib_list[i]);
@@ -1299,6 +1300,8 @@ i965_CreateSurfaces2(
         obj_surface->free_private_data = NULL;
         obj_surface->subsampling = SUBSAMPLE_YUV420;
 
+        obj_surface->wrapper_surface = VA_INVALID_ID;
+
         switch (memory_type) {
         case I965_SURFACE_MEM_NATIVE:
             if (memory_attibute) {
@@ -1860,6 +1863,7 @@ i965_CreateContext(VADriverContextP ctx,
     obj_context->render_targets = 
         (VASurfaceID *)calloc(num_render_targets, sizeof(VASurfaceID));
     obj_context->hw_context = NULL;
+    obj_context->wrapper_context = VA_INVALID_ID;
 
     for(i = 0; i < num_render_targets; i++) {
         if (NULL == SURFACE(render_targets[i])) {
@@ -2044,6 +2048,8 @@ i965_create_buffer_internal(VADriverContextP ctx,
     obj_buffer->type = type;
     obj_buffer->export_refcount = 0;
     obj_buffer->buffer_store = NULL;
+    obj_buffer->wrapper_buffer = VA_INVALID_ID;
+
     buffer_store = calloc(1, sizeof(struct buffer_store));
     assert(buffer_store);
     buffer_store->ref_count = 1;
index 65e86ed..84b557e 100644 (file)
@@ -105,6 +105,8 @@ struct object_config
     VAEntrypoint entrypoint;
     VAConfigAttrib attrib_list[I965_MAX_CONFIG_ATTRIBUTES];
     int num_attribs;
+
+    VAGenericID wrapper_config;
 };
 
 #define NUM_SLICES     10
@@ -245,6 +247,8 @@ struct object_context
     int codec_type;
     union codec_state codec_state;
     struct hw_context *hw_context;
+
+    VAGenericID       wrapper_context;
 };
 
 #define SURFACE_REFERENCED      (1 << 0)
@@ -285,6 +289,8 @@ struct object_surface
     uint32_t user_disable_tiling : 1;
     uint32_t user_h_stride_set   : 1;
     uint32_t user_v_stride_set   : 1;
+
+    VAGenericID wrapper_surface;
 };
 
 struct object_buffer 
@@ -299,6 +305,8 @@ struct object_buffer
     /* Export state */
     unsigned int export_refcount;
     VABufferInfo export_state;
+
+    VAGenericID wrapper_buffer;
 };
 
 struct object_image