[Libva] [Libva-intel-driver PATCH 1/9] Add one field for Config/Context/Surface/Buffer to store the wrapper content

Zhao Yakui yakui.zhao at intel.com
Sat Sep 5 18:39:08 PDT 2015


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 at intel.com>
Signed-off-by: Sean V Kelley <seanvk at posteo.de>
---
 src/i965_drv_video.c | 6 ++++++
 src/i965_drv_video.h | 8 ++++++++
 2 files changed, 14 insertions(+)

diff --git a/src/i965_drv_video.c b/src/i965_drv_video.c
index e14b74b..b0fb7d6 100644
--- a/src/i965_drv_video.c
+++ b/src/i965_drv_video.c
@@ -882,6 +882,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]);
@@ -1300,6 +1301,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) {
@@ -1861,6 +1864,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])) {
@@ -2045,6 +2049,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;
diff --git a/src/i965_drv_video.h b/src/i965_drv_video.h
index 65e86ed..84b557e 100644
--- a/src/i965_drv_video.h
+++ b/src/i965_drv_video.h
@@ -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 
-- 
1.8.4.2



More information about the Libva mailing list