[Libva] [PATCH intel-driver 05/13] vebox: fix invalid conversion and scaling params order.

Gwenole Beauchesne gb.devel at gmail.com
Wed Aug 27 04:50:30 PDT 2014


The arguments to vpp_surface_convert() were mixed up. i.e. both input
and output surfaces were reversed. Changed the vpp_surface_scaling()
arguments order as well to have more consistent helper functions.

Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne at intel.com>
---
 src/gen75_vpp_vebox.c |   22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/src/gen75_vpp_vebox.c b/src/gen75_vpp_vebox.c
index 9a60c27..6971077 100644
--- a/src/gen75_vpp_vebox.c
+++ b/src/gen75_vpp_vebox.c
@@ -54,9 +54,9 @@ extern VAStatus
 i965_DestroyImage(VADriverContextP ctx, VAImageID image);
 
 
-VAStatus vpp_surface_convert(VADriverContextP ctx,
-                             struct object_surface *src_obj_surf,
-                             struct object_surface *dst_obj_surf)
+VAStatus
+vpp_surface_convert(VADriverContextP ctx, struct object_surface *src_obj_surf,
+    struct object_surface *dst_obj_surf)
 {
     VAStatus va_status = VA_STATUS_SUCCESS;
 
@@ -86,9 +86,9 @@ VAStatus vpp_surface_convert(VADriverContextP ctx,
     return va_status;
 }
 
-VAStatus vpp_surface_scaling(VADriverContextP ctx,
-                             struct object_surface *dst_obj_surf,
-                             struct object_surface *src_obj_surf)
+static VAStatus
+vpp_surface_scaling(VADriverContextP ctx, struct object_surface *src_obj_surf,
+    struct object_surface *dst_obj_surf)
 {
     VAStatus va_status = VA_STATUS_SUCCESS;
     int flags = I965_PP_FLAG_AVS;
@@ -1177,7 +1177,7 @@ int hsw_veb_pre_format_convert(VADriverContextP ctx,
              }
          }
        
-         vpp_surface_convert(ctx, proc_ctx->surface_input_vebox_object, proc_ctx->surface_input_object);
+         vpp_surface_convert(ctx, proc_ctx->surface_input_object, proc_ctx->surface_input_vebox_object);
       }
 
       /* create one temporary NV12 surfaces for conversion*/
@@ -1248,7 +1248,7 @@ int hsw_veb_post_format_convert(VADriverContextP ctx,
 
     if (proc_ctx->format_convert_flags & POST_COPY_CONVERT) {
         /* copy the saved frame in the second call */
-        vpp_surface_convert(ctx,proc_ctx->surface_output_object, obj_surface);
+        vpp_surface_convert(ctx, obj_surface, proc_ctx->surface_output_object);
     } else if(!(proc_ctx->format_convert_flags & POST_FORMAT_CONVERT) &&
        !(proc_ctx->format_convert_flags & POST_SCALING_CONVERT)){
         /* Output surface format is covered by vebox pipeline and 
@@ -1257,14 +1257,14 @@ int hsw_veb_post_format_convert(VADriverContextP ctx,
     } else if ((proc_ctx->format_convert_flags & POST_FORMAT_CONVERT) &&
                !(proc_ctx->format_convert_flags & POST_SCALING_CONVERT)){
        /* convert and copy NV12 to YV12/IMC3/IMC2/RGBA output*/
-        vpp_surface_convert(ctx,proc_ctx->surface_output_object, obj_surface);
+        vpp_surface_convert(ctx, obj_surface, proc_ctx->surface_output_object);
 
     } else if(proc_ctx->format_convert_flags & POST_SCALING_CONVERT) {
        /* scaling, convert and copy NV12 to YV12/IMC3/IMC2/RGBA output*/
         assert(obj_surface->fourcc == VA_FOURCC_NV12);
      
         /* first step :surface scaling */
-        vpp_surface_scaling(ctx,proc_ctx->surface_output_scaled_object, obj_surface);
+        vpp_surface_scaling(ctx, obj_surface, proc_ctx->surface_output_scaled_object);
 
         /* second step: color format convert and copy to output */
         obj_surface = proc_ctx->surface_output_object;
@@ -1276,7 +1276,7 @@ int hsw_veb_post_format_convert(VADriverContextP ctx,
            obj_surface->fourcc ==  VA_FOURCC_IMC1 ||
            obj_surface->fourcc ==  VA_FOURCC_IMC3 ||
            obj_surface->fourcc ==  VA_FOURCC_RGBA) {
-           vpp_surface_convert(ctx, proc_ctx->surface_output_object, proc_ctx->surface_output_scaled_object);
+            vpp_surface_convert(ctx, proc_ctx->surface_output_scaled_object, obj_surface);
        }else {
            assert(0); 
        }
-- 
1.7.9.5



More information about the Libva mailing list