[Libva] [libva-intel-driver PATCH] Propagate up the error when do VPP on HSW+

Xiang, Haihao haihao.xiang at intel.com
Thu Aug 7 07:33:36 PDT 2014


Signed-off-by: Xiang, Haihao <haihao.xiang at intel.com>
---
 src/gen75_picture_process.c | 13 ++++++-------
 src/gen75_vpp_vebox.c       | 40 ++++++++++++++++++++++++++++------------
 2 files changed, 34 insertions(+), 19 deletions(-)

diff --git a/src/gen75_picture_process.c b/src/gen75_picture_process.c
index 6978d4b..9c51ef7 100644
--- a/src/gen75_picture_process.c
+++ b/src/gen75_picture_process.c
@@ -170,7 +170,7 @@ gen75_proc_picture(VADriverContextP ctx,
  
     if(pipeline_param->num_filters == 0 || pipeline_param->filters == NULL ){
         /* implicity surface format coversion and scaling */
-        gen75_vpp_fmt_cvt(ctx, profile, codec_state, hw_context);
+        status = gen75_vpp_fmt_cvt(ctx, profile, codec_state, hw_context);
     }else if(pipeline_param->num_filters == 1) {
        struct object_buffer * obj_buf = BUFFER((*filter_id) + 0);
 
@@ -190,7 +190,7 @@ gen75_proc_picture(VADriverContextP ctx,
            filter->type == VAProcFilterDeinterlacing          ||
            filter->type == VAProcFilterSkinToneEnhancement    ||
            filter->type == VAProcFilterColorBalance){
-           gen75_vpp_vebox(ctx, proc_ctx);
+           status = gen75_vpp_vebox(ctx, proc_ctx);
        }else if(filter->type == VAProcFilterSharpening){
            if (obj_src_surf->fourcc != VA_FOURCC_NV12 ||
                obj_dst_surf->fourcc != VA_FOURCC_NV12) {
@@ -198,8 +198,9 @@ gen75_proc_picture(VADriverContextP ctx,
                goto error;
            }
 
-           gen75_vpp_gpe(ctx, proc_ctx);
-       } 
+           status = gen75_vpp_gpe(ctx, proc_ctx);
+       } else
+           status = VA_STATUS_ERROR_UNSUPPORTED_FILTER;
     }else if (pipeline_param->num_filters >= 2) {
          unsigned int i = 0;
          for (i = 0; i < pipeline_param->num_filters; i++){
@@ -223,11 +224,9 @@ gen75_proc_picture(VADriverContextP ctx,
                  assert(0);
              }
          }
-         gen75_vpp_vebox(ctx, proc_ctx);
+         status = gen75_vpp_vebox(ctx, proc_ctx);
     }     
 
-    return VA_STATUS_SUCCESS;
-
 error:
     return status;
 }
diff --git a/src/gen75_vpp_vebox.c b/src/gen75_vpp_vebox.c
index 1113c90..663c5ec 100644
--- a/src/gen75_vpp_vebox.c
+++ b/src/gen75_vpp_vebox.c
@@ -1113,7 +1113,7 @@ void hsw_veb_surface_unreference(VADriverContextP ctx,
     }
 }
 
-int hsw_veb_pre_format_convert(VADriverContextP ctx,
+VAStatus hsw_veb_pre_format_convert(VADriverContextP ctx,
                            struct intel_vebox_context *proc_ctx)
 {
     VAStatus va_status;
@@ -1238,10 +1238,10 @@ int hsw_veb_pre_format_convert(VADriverContextP ctx,
        }
      } 
     
-     return 0;
+     return VA_STATUS_SUCCESS;
 }
 
-int hsw_veb_post_format_convert(VADriverContextP ctx,
+VAStatus hsw_veb_post_format_convert(VADriverContextP ctx,
                            struct intel_vebox_context *proc_ctx)
 {
     struct object_surface *obj_surface = NULL;
@@ -1284,7 +1284,7 @@ int hsw_veb_post_format_convert(VADriverContextP ctx,
        }
    }
 
-    return 0;
+    return VA_STATUS_SUCCESS;
 }
 
 VAStatus gen75_vebox_process_picture(VADriverContextP ctx,
@@ -1296,6 +1296,7 @@ VAStatus gen75_vebox_process_picture(VADriverContextP ctx,
     VAProcFilterParameterBuffer* filter = NULL;
     struct object_buffer *obj_buf = NULL;
     unsigned int i;
+    VAStatus status = VA_STATUS_SUCCESS;
 
     for (i = 0; i < pipe->num_filters; i ++) {
          obj_buf = BUFFER(pipe->filters[i]);
@@ -1323,8 +1324,15 @@ VAStatus gen75_vebox_process_picture(VADriverContextP ctx,
          }
     }
 
-    hsw_veb_pre_format_convert(ctx, proc_ctx);
-    hsw_veb_surface_reference(ctx, proc_ctx);
+    status = hsw_veb_pre_format_convert(ctx, proc_ctx);
+
+    if (status != VA_STATUS_SUCCESS)
+        return status;
+
+    status = hsw_veb_surface_reference(ctx, proc_ctx);
+
+    if (status != VA_STATUS_SUCCESS)
+        return status;
 
     if (proc_ctx->frame_order == -1) {
         hsw_veb_resource_prepare(ctx, proc_ctx);
@@ -1346,12 +1354,12 @@ VAStatus gen75_vebox_process_picture(VADriverContextP ctx,
         intel_batchbuffer_flush(proc_ctx->batch);
     }
 
-    hsw_veb_post_format_convert(ctx, proc_ctx);
+    status = hsw_veb_post_format_convert(ctx, proc_ctx);
     // hsw_veb_surface_unreference(ctx, proc_ctx);
 
     proc_ctx->frame_order = (proc_ctx->frame_order + 1) % 2;
      
-    return VA_STATUS_SUCCESS;
+    return status;
 
 error:
     return VA_STATUS_ERROR_INVALID_PARAMETER;
@@ -1596,6 +1604,7 @@ VAStatus gen8_vebox_process_picture(VADriverContextP ctx,
     VAProcFilterParameterBuffer* filter = NULL;
     struct object_buffer *obj_buf = NULL;
     unsigned int i;
+    VAStatus status = VA_STATUS_SUCCESS;
 
     for (i = 0; i < pipe->num_filters; i ++) {
          obj_buf = BUFFER(pipe->filters[i]);
@@ -1623,8 +1632,15 @@ VAStatus gen8_vebox_process_picture(VADriverContextP ctx,
          }
     }
 
-    hsw_veb_pre_format_convert(ctx, proc_ctx);
-    hsw_veb_surface_reference(ctx, proc_ctx);
+    status = hsw_veb_pre_format_convert(ctx, proc_ctx);
+
+    if (status != VA_STATUS_SUCCESS)
+        return status;
+
+    status = hsw_veb_surface_reference(ctx, proc_ctx);
+
+    if (status != VA_STATUS_SUCCESS)
+        return status;
 
     if (proc_ctx->frame_order == -1) {
         hsw_veb_resource_prepare(ctx, proc_ctx);
@@ -1646,12 +1662,12 @@ VAStatus gen8_vebox_process_picture(VADriverContextP ctx,
         intel_batchbuffer_flush(proc_ctx->batch);
     }
 
-    hsw_veb_post_format_convert(ctx, proc_ctx);
+    status = hsw_veb_post_format_convert(ctx, proc_ctx);
     // hsw_veb_surface_unreference(ctx, proc_ctx);
 
     proc_ctx->frame_order = (proc_ctx->frame_order + 1) % 2;
      
-    return VA_STATUS_SUCCESS;
+    return status;
 
 error:
     return VA_STATUS_ERROR_INVALID_PARAMETER;
-- 
1.9.1



More information about the Libva mailing list