Fix the issue in i965_UnlockSurface to lock it next time
authorZhao Yakui <yakui.zhao@intel.com>
Wed, 31 Oct 2012 08:47:54 +0000 (16:47 +0800)
committerXiang, Haihao <haihao.xiang@intel.com>
Wed, 31 Oct 2012 14:04:07 +0000 (22:04 +0800)
It uses the variable of locked_image_id to check whether one surface is locked
or not. But as the locked_image_id is not assigned correctly, it causes that
it can't lock one surface next time although it calls the vaUnlockSurfaces.
Then the libva trace log can't dump the content of decoded/
encoded surface even after adding LIBVA_TRACE_SURFACE=XXX.

Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
Reviewed-by: Gwenole Beauchesne <gb.devel@gmail.com>
src/i965_drv_video.c

index 771f603..16f0343 100755 (executable)
@@ -3638,11 +3638,11 @@ i965_UnlockSurface(
 
     if (obj_surface == NULL) {
         vaStatus = VA_STATUS_ERROR_INVALID_PARAMETER;   // Surface is absent
-        goto error;
+        return vaStatus;
     }
     if (obj_surface->locked_image_id == VA_INVALID_ID) {
         vaStatus = VA_STATUS_ERROR_INVALID_PARAMETER;   // Surface is not locked
-        goto error;
+        return vaStatus;
     }
 
     locked_img = IMAGE(obj_surface->locked_image_id);
@@ -3669,6 +3669,8 @@ i965_UnlockSurface(
     locked_img->image.image_id = VA_INVALID_ID;
 
  error:
+    obj_surface->locked_image_id = VA_INVALID_ID;
+
     return vaStatus;
 }