Fix parameter setting for AVS on Ivybridge
authorXiang, Haihao <haihao.xiang@intel.com>
Thu, 19 Apr 2012 02:22:34 +0000 (10:22 +0800)
committerXiang, Haihao <haihao.xiang@intel.com>
Thu, 19 Apr 2012 02:27:29 +0000 (10:27 +0800)
DU multiplied by width in SURFACE_STATE must be less
than 16 for the sample_8x8 message.

Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
src/i965_post_processing.c

index f72fd90..c0ce399 100644 (file)
@@ -2092,11 +2092,14 @@ gen7_pp_plx_avs_initialize(VADriverContextP ctx, struct i965_post_processing_con
     pp_avs_context->src_w = src_rect->width;
     pp_avs_context->src_h = src_rect->height;
 
+    int dw = (pp_avs_context->src_w - 1) / 16 + 1;
+    dw = MAX(dw, pp_avs_context->dest_w);
+
     pp_static_parameter->grf1.pointer_to_inline_parameter = 7;
-    pp_static_parameter->grf3.sampler_load_horizontal_scaling_step_ratio = (float) pp_avs_context->src_w / pp_avs_context->dest_w;
+    pp_static_parameter->grf3.sampler_load_horizontal_scaling_step_ratio = (float) pp_avs_context->src_w / dw;
     pp_static_parameter->grf4.sampler_load_vertical_scaling_step = (float) 1.0 / pp_avs_context->dest_h;
     pp_static_parameter->grf5.sampler_load_vertical_frame_origin = -(float)pp_avs_context->dest_y / pp_avs_context->dest_h;
-    pp_static_parameter->grf6.sampler_load_horizontal_frame_origin = -(float)pp_avs_context->dest_x / pp_avs_context->dest_w;
+    pp_static_parameter->grf6.sampler_load_horizontal_frame_origin = -(float)pp_avs_context->dest_x / dw;
 
     dst_surface->flags = src_surface->flags;