[Libva] [PATCH] Allow va{Get,Put}Image() to use derived image

Xiang, Haihao haihao.xiang at intel.com
Mon Mar 30 21:48:41 PDT 2015


From: "Xiang, Haihao" <haihao.xiang at intel.com>

The surface can't be the same surface from which the image has
been derived.

Signed-off-by: Xiang, Haihao <haihao.xiang at intel.com>
---
 src/i965_drv_video.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/src/i965_drv_video.c b/src/i965_drv_video.c
index d87a232..0f0e7c6 100644
--- a/src/i965_drv_video.c
+++ b/src/i965_drv_video.c
@@ -363,13 +363,14 @@ is_surface_busy(struct i965_driver_data *i965,
 
 /* Checks whether the image is in busy state */
 static bool
-is_image_busy(struct i965_driver_data *i965, struct object_image *obj_image)
+is_image_busy(struct i965_driver_data *i965, struct object_image *obj_image, VASurfaceID surface)
 {
     struct object_buffer *obj_buffer;
 
     assert(obj_image != NULL);
 
-    if (obj_image->derived_surface != VA_INVALID_ID)
+    if (obj_image->derived_surface != VA_INVALID_ID &&
+        obj_image->derived_surface == surface)
         return true;
 
     obj_buffer = BUFFER(obj_image->image.buf);
@@ -4108,7 +4109,7 @@ i965_GetImage(VADriverContextP ctx,
 
     if (!obj_image || !obj_image->bo)
         return VA_STATUS_ERROR_INVALID_IMAGE;
-    if (is_image_busy(i965, obj_image))
+    if (is_image_busy(i965, obj_image, surface))
         return VA_STATUS_ERROR_SURFACE_BUSY;
 
     if (x < 0 || y < 0)
@@ -4419,7 +4420,7 @@ i965_PutImage(VADriverContextP ctx,
 
     if (!obj_image || !obj_image->bo)
         return VA_STATUS_ERROR_INVALID_IMAGE;
-    if (is_image_busy(i965, obj_image))
+    if (is_image_busy(i965, obj_image, surface))
         return VA_STATUS_ERROR_SURFACE_BUSY;
 
     if (src_x < 0 ||
-- 
1.9.1



More information about the Libva mailing list