OSDN Git Service

work around hw limitation(dword alignment) of horizontal offset
authorZhao Halley <halley.zhao@intel.com>
Thu, 2 Aug 2012 09:22:33 +0000 (12:22 +0300)
committerXiang, Haihao <haihao.xiang@intel.com>
Fri, 31 Aug 2012 08:12:46 +0000 (04:12 -0400)
on dst surface left edge for load/save procedure

src/i965_post_processing.c
src/i965_post_processing.h

index 7de3678..9ef540c 100755 (executable)
@@ -1685,9 +1685,10 @@ static int
 pp_load_save_set_block_parameter(struct i965_post_processing_context *pp_context, int x, int y)
 {
     struct pp_inline_parameter *pp_inline_parameter = pp_context->pp_inline_parameter;
+    struct pp_load_save_context *pp_load_save_context = (struct pp_load_save_context *)&pp_context->private_context;
 
-    pp_inline_parameter->grf5.destination_block_horizontal_origin = x * 16;
-    pp_inline_parameter->grf5.destination_block_vertical_origin = y * 8;
+    pp_inline_parameter->grf5.destination_block_horizontal_origin = x * 16 + pp_load_save_context->dest_x;
+    pp_inline_parameter->grf5.destination_block_vertical_origin = y * 8 + pp_load_save_context->dest_y;
 
     return 0;
 }
@@ -1751,11 +1752,15 @@ pp_plx_load_save_plx_initialize(VADriverContextP ctx, struct i965_post_processin
     pp_context->pp_x_steps = pp_load_save_x_steps;
     pp_context->pp_y_steps = pp_load_save_y_steps;
     pp_context->pp_set_block_parameter = pp_load_save_set_block_parameter;
-    pp_load_save_context->dest_h = ALIGN(height[Y], 8);
-    pp_load_save_context->dest_w = ALIGN(width[Y], 16);
 
-    pp_inline_parameter->grf5.block_count_x = ALIGN(width[Y], 16) / 16;   /* 1 x N */
-    pp_inline_parameter->grf5.number_blocks = ALIGN(width[Y], 16) / 16;
+    int dst_left_edge_extend = dst_rect->x%GPU_ASM_X_OFFSET_ALIGNMENT;;
+    pp_load_save_context->dest_x = dst_rect->x - dst_left_edge_extend;
+    pp_load_save_context->dest_y = dst_rect->y;
+    pp_load_save_context->dest_h = ALIGN(dst_rect->height, 8);
+    pp_load_save_context->dest_w = ALIGN(dst_rect->width+dst_left_edge_extend, 16);
+
+    pp_inline_parameter->grf5.block_count_x = pp_load_save_context->dest_w / 16;   /* 1 x N */
+    pp_inline_parameter->grf5.number_blocks = pp_load_save_context->dest_w / 16;
 
     pp_static_parameter->grf3.horizontal_origin_offset = src_rect->x;
     pp_static_parameter->grf3.vertical_origin_offset = src_rect->y;
index ecfbae1..cf8e216 100755 (executable)
@@ -60,6 +60,8 @@ struct i965_post_processing_context;
 
 struct pp_load_save_context
 {
+    int dest_x;
+    int dest_y;
     int dest_w;
     int dest_h;
 };