Check the reference surface id against VA_INVALID_SURFACE on BDW
authorXiang, Haihao <haihao.xiang@intel.com>
Tue, 8 Oct 2013 03:05:28 +0000 (11:05 +0800)
committerXiang, Haihao <haihao.xiang@intel.com>
Thu, 27 Feb 2014 02:22:33 +0000 (10:22 +0800)
Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
src/gen8_vme.c

index 64aebe7..12a3137 100644 (file)
@@ -260,7 +260,7 @@ gen8_vme_surface_setup(VADriverContextP ctx,
        if (slice_type == SLICE_TYPE_P || slice_type == SLICE_TYPE_B) {
             slice_obj_surface = NULL;
             ref_surface_id = slice_param->RefPicList0[0].picture_id;
-            if (ref_surface_id != 0 && ref_surface_id != VA_INVALID_SURFACE) {
+            if (ref_surface_id != VA_INVALID_SURFACE) {
                 slice_obj_surface = SURFACE(ref_surface_id);
             }
             if (slice_obj_surface && slice_obj_surface->bo) {
@@ -276,7 +276,7 @@ gen8_vme_surface_setup(VADriverContextP ctx,
             /* reference 1 */
             slice_obj_surface = NULL;
             ref_surface_id = slice_param->RefPicList1[0].picture_id;
-            if (ref_surface_id != 0 && ref_surface_id != VA_INVALID_SURFACE) {
+            if (ref_surface_id != VA_INVALID_SURFACE) {
                 slice_obj_surface = SURFACE(ref_surface_id);
             }
             if (slice_obj_surface && slice_obj_surface->bo) {