[Libva] [PATCH] FIXED: remove context check in i965_create_buffer_internal to avoid the JPEG failed BUG ID 88728

Qu,Pengfei Pengfei.Qu at intel.com
Fri Jan 23 00:09:34 PST 2015


Signed-off-by: Qu,Pengfei <Pengfei.Qu at intel.com>
---
 src/i965_drv_video.c | 33 +--------------------------------
 1 file changed, 1 insertion(+), 32 deletions(-)

diff --git a/src/i965_drv_video.c b/src/i965_drv_video.c
index ff1ab62..8a1370f 100644
--- a/src/i965_drv_video.c
+++ b/src/i965_drv_video.c
@@ -1994,20 +1994,6 @@ i965_create_buffer_internal(VADriverContextP ctx,
     struct object_buffer *obj_buffer = NULL;
     struct buffer_store *buffer_store = NULL;
     int bufferID;
-    struct object_context *obj_context = NULL;
-    struct object_config *obj_config = NULL;
-    VAStatus vaStatus = VA_STATUS_ERROR_UNKNOWN;
-
-    if (i965->current_context_id == VA_INVALID_ID)
-        return vaStatus;
-
-    obj_context = CONTEXT(i965->current_context_id);
-
-    if (!obj_context)
-        return vaStatus;
-
-    obj_config = obj_context->obj_config;
-    assert(obj_config);
 
     /* Validate type */
     switch (type) {
@@ -2081,11 +2067,7 @@ i965_create_buffer_internal(VADriverContextP ctx,
             struct i965_coded_buffer_segment *coded_buffer_segment;
 
             dri_bo_map(buffer_store->bo, 1);
-            if(obj_config->profile == VAProfileHEVCMain){
-                coded_buffer_segment = (struct i965_coded_buffer_segment *)(buffer_store->bo->virtual + ALIGN(size - 0x1000, 0x1000));
-            }else {
-                coded_buffer_segment = (struct i965_coded_buffer_segment *)buffer_store->bo->virtual;
-            }
+            coded_buffer_segment = (struct i965_coded_buffer_segment *)buffer_store->bo->virtual;
             coded_buffer_segment->base.size = size - I965_CODEDBUFFER_HEADER_SIZE;
             coded_buffer_segment->base.bit_offset = 0;
             coded_buffer_segment->base.status = 0;
@@ -2163,22 +2145,9 @@ i965_MapBuffer(VADriverContextP ctx,
                void **pbuf)             /* out */
 {
     struct i965_driver_data *i965 = i965_driver_data(ctx);
-    struct object_context *obj_context = NULL;
-    struct object_config *obj_config = NULL;
     struct object_buffer *obj_buffer = BUFFER(buf_id);
     VAStatus vaStatus = VA_STATUS_ERROR_UNKNOWN;
 
-    if (i965->current_context_id == VA_INVALID_ID)
-        return vaStatus;
-
-    obj_context = CONTEXT(i965->current_context_id);
-
-    if (!obj_context)
-        return vaStatus;
-
-    obj_config = obj_context->obj_config;
-    assert(obj_config);
-
     ASSERT_RET(obj_buffer && obj_buffer->buffer_store, VA_STATUS_ERROR_INVALID_BUFFER);
     ASSERT_RET(obj_buffer->buffer_store->bo || obj_buffer->buffer_store->buffer, VA_STATUS_ERROR_INVALID_BUFFER);
     ASSERT_RET(!(obj_buffer->buffer_store->bo && obj_buffer->buffer_store->buffer), VA_STATUS_ERROR_INVALID_BUFFER);
-- 
1.9.1



More information about the Libva mailing list