OSDN Git Service

CSC: Set the right filter mode for YUY2/UYVY surface on BDW+
authorXiang, Haihao <haihao.xiang@intel.com>
Thu, 31 Mar 2016 07:38:17 +0000 (15:38 +0800)
committerXiang, Haihao <haihao.xiang@intel.com>
Thu, 31 Mar 2016 08:47:39 +0000 (16:47 +0800)
AVS doesn't support mode 3 for YUY2/UYVY surface

https://bugs.freedesktop.org/show_bug.cgi?id=94765

Cc: James Tang <jun.tang@intel.com>
Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
src/gen8_post_processing.c

index 3c10960..fbf0e57 100644 (file)
@@ -765,6 +765,19 @@ static const AVSConfig gen8_avs_config = {
     },
 };
 
+static int
+gen8_pp_get_8tap_filter_mode(VADriverContextP ctx,
+                             const struct i965_surface *surface)
+{
+    int fourcc = pp_get_surface_fourcc(ctx, surface);
+
+    if (fourcc == VA_FOURCC_YUY2 ||
+        fourcc == VA_FOURCC_UYVY)
+        return 1;
+    else
+        return 3;
+}
+
 VAStatus
 gen8_pp_plx_avs_initialize(VADriverContextP ctx, struct i965_post_processing_context *pp_context,
                            const struct i965_surface *src_surface,
@@ -841,7 +854,7 @@ gen8_pp_plx_avs_initialize(VADriverContextP ctx, struct i965_post_processing_con
      * If the 8tap filter is disabled, the adaptive filter should be disabled.
      * Only when 8tap filter is enabled, it can be enabled or not.
      */
-    sampler_8x8->dw3.enable_8tap_filter = 3;
+    sampler_8x8->dw3.enable_8tap_filter = gen8_pp_get_8tap_filter_mode(ctx, src_surface);
     sampler_8x8->dw3.ief4_smooth_enable = 0;
 
     sampler_8x8->dw4.s3u = 0;