summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXiang, Haihao <haihao.xiang@intel.com>2013-09-11 10:33:25 +0800
committerXiang, Haihao <haihao.xiang@intel.com>2013-09-13 13:43:19 +0800
commit4faf6bf47f8e4e2fe587e3bb6a004340edd59c4c (patch)
tree657fcec6beebf3fb01dfadaad18e4ec46562d54a
parentc55cc476b1f75ddf0504a8b85ac80c0168585c5c (diff)
VPP: Create separate sub-context for each processing
Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
-rwxr-xr-xsrc/i965_post_processing.c49
-rwxr-xr-xsrc/i965_post_processing.h15
2 files changed, 37 insertions, 27 deletions
diff --git a/src/i965_post_processing.c b/src/i965_post_processing.c
index 79daa48..e5c023c 100755
--- a/src/i965_post_processing.c
+++ b/src/i965_post_processing.c
@@ -1505,8 +1505,8 @@ ironlake_pp_object_walker(VADriverContextP ctx,
int x, x_steps, y, y_steps;
struct pp_inline_parameter *pp_inline_parameter = pp_context->pp_inline_parameter;
- x_steps = pp_context->pp_x_steps(&pp_context->private_context);
- y_steps = pp_context->pp_y_steps(&pp_context->private_context);
+ x_steps = pp_context->pp_x_steps(pp_context->private_context);
+ y_steps = pp_context->pp_y_steps(pp_context->private_context);
for (y = 0; y < y_steps; y++) {
for (x = 0; x < x_steps; x++) {
@@ -2081,6 +2081,7 @@ pp_null_initialize(VADriverContextP ctx, struct i965_post_processing_context *pp
/* private function & data */
pp_context->pp_x_steps = pp_null_x_steps;
pp_context->pp_y_steps = pp_null_y_steps;
+ pp_context->private_context = NULL;
pp_context->pp_set_block_parameter = pp_null_set_block_parameter;
dst_surface->flags = src_surface->flags;
@@ -2106,7 +2107,7 @@ 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;
+ 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_load_save_context->dest_x;
pp_inline_parameter->grf5.destination_block_vertical_origin = y * 8 + pp_load_save_context->dest_y;
@@ -2155,7 +2156,7 @@ pp_plx_load_save_plx_initialize(VADriverContextP ctx, struct i965_post_processin
const VARectangle *dst_rect,
void *filter_param)
{
- struct pp_load_save_context *pp_load_save_context = (struct pp_load_save_context *)&pp_context->private_context;
+ struct pp_load_save_context *pp_load_save_context = (struct pp_load_save_context *)&pp_context->pp_load_save_context;
struct pp_inline_parameter *pp_inline_parameter = pp_context->pp_inline_parameter;
struct pp_static_parameter *pp_static_parameter = pp_context->pp_static_parameter;
int width[3], height[3], pitch[3], offset[3];
@@ -2171,6 +2172,7 @@ pp_plx_load_save_plx_initialize(VADriverContextP ctx, struct i965_post_processin
/* private function & data */
pp_context->pp_x_steps = pp_load_save_x_steps;
pp_context->pp_y_steps = pp_load_save_y_steps;
+ pp_context->private_context = &pp_context->pp_load_save_context;
pp_context->pp_set_block_parameter = pp_load_save_set_block_parameter;
int dst_left_edge_extend = dst_rect->x%GPU_ASM_X_OFFSET_ALIGNMENT;;
@@ -2211,7 +2213,7 @@ pp_scaling_y_steps(void *private_context)
static int
pp_scaling_set_block_parameter(struct i965_post_processing_context *pp_context, int x, int y)
{
- struct pp_scaling_context *pp_scaling_context = (struct pp_scaling_context *)&pp_context->private_context;
+ struct pp_scaling_context *pp_scaling_context = (struct pp_scaling_context *)pp_context->private_context;
struct pp_inline_parameter *pp_inline_parameter = pp_context->pp_inline_parameter;
struct pp_static_parameter *pp_static_parameter = pp_context->pp_static_parameter;
float src_x_steping = pp_inline_parameter->grf5.normalized_video_x_scaling_step;
@@ -2233,7 +2235,7 @@ pp_nv12_scaling_initialize(VADriverContextP ctx, struct i965_post_processing_con
const VARectangle *dst_rect,
void *filter_param)
{
- struct pp_scaling_context *pp_scaling_context = (struct pp_scaling_context *)&pp_context->private_context;
+ struct pp_scaling_context *pp_scaling_context = (struct pp_scaling_context *)&pp_context->pp_scaling_context;
struct pp_inline_parameter *pp_inline_parameter = pp_context->pp_inline_parameter;
struct pp_static_parameter *pp_static_parameter = pp_context->pp_static_parameter;
struct object_surface *obj_surface;
@@ -2303,6 +2305,7 @@ pp_nv12_scaling_initialize(VADriverContextP ctx, struct i965_post_processing_con
/* private function & data */
pp_context->pp_x_steps = pp_scaling_x_steps;
pp_context->pp_y_steps = pp_scaling_y_steps;
+ pp_context->private_context = &pp_context->pp_scaling_context;
pp_context->pp_set_block_parameter = pp_scaling_set_block_parameter;
int dst_left_edge_extend = dst_rect->x%GPU_ASM_X_OFFSET_ALIGNMENT;
@@ -2342,7 +2345,7 @@ pp_avs_y_steps(void *private_context)
static int
pp_avs_set_block_parameter(struct i965_post_processing_context *pp_context, int x, int y)
{
- struct pp_avs_context *pp_avs_context = (struct pp_avs_context *)&pp_context->private_context;
+ struct pp_avs_context *pp_avs_context = (struct pp_avs_context *)pp_context->private_context;
struct pp_inline_parameter *pp_inline_parameter = pp_context->pp_inline_parameter;
struct pp_static_parameter *pp_static_parameter = pp_context->pp_static_parameter;
float src_x_steping, src_y_steping, video_step_delta;
@@ -2449,7 +2452,7 @@ pp_nv12_avs_initialize(VADriverContextP ctx, struct i965_post_processing_context
void *filter_param,
int nlas)
{
- struct pp_avs_context *pp_avs_context = (struct pp_avs_context *)&pp_context->private_context;
+ struct pp_avs_context *pp_avs_context = (struct pp_avs_context *)&pp_context->pp_avs_context;
struct pp_inline_parameter *pp_inline_parameter = pp_context->pp_inline_parameter;
struct pp_static_parameter *pp_static_parameter = pp_context->pp_static_parameter;
struct object_surface *obj_surface;
@@ -2692,6 +2695,7 @@ pp_nv12_avs_initialize(VADriverContextP ctx, struct i965_post_processing_context
/* private function & data */
pp_context->pp_x_steps = pp_avs_x_steps;
pp_context->pp_y_steps = pp_avs_y_steps;
+ pp_context->private_context = &pp_context->pp_avs_context;
pp_context->pp_set_block_parameter = pp_avs_set_block_parameter;
int dst_left_edge_extend = dst_rect->x%GPU_ASM_X_OFFSET_ALIGNMENT;
@@ -2771,7 +2775,7 @@ gen7_pp_avs_y_steps(void *private_context)
static int
gen7_pp_avs_set_block_parameter(struct i965_post_processing_context *pp_context, int x, int y)
{
- struct pp_avs_context *pp_avs_context = (struct pp_avs_context *)&pp_context->private_context;
+ struct pp_avs_context *pp_avs_context = (struct pp_avs_context *)pp_context->private_context;
struct gen7_pp_inline_parameter *pp_inline_parameter = pp_context->pp_inline_parameter;
pp_inline_parameter->grf7.destination_block_horizontal_origin = x * 16 + pp_avs_context->dest_x;
@@ -2808,7 +2812,7 @@ gen7_pp_plx_avs_initialize(VADriverContextP ctx, struct i965_post_processing_con
const VARectangle *dst_rect,
void *filter_param)
{
- struct pp_avs_context *pp_avs_context = (struct pp_avs_context *)&pp_context->private_context;
+ struct pp_avs_context *pp_avs_context = (struct pp_avs_context *)&pp_context->pp_avs_context;
struct i965_driver_data *i965 = i965_driver_data(ctx);
struct gen7_pp_static_parameter *pp_static_parameter = pp_context->pp_static_parameter;
struct gen7_sampler_8x8 *sampler_8x8;
@@ -2974,6 +2978,7 @@ gen7_pp_plx_avs_initialize(VADriverContextP ctx, struct i965_post_processing_con
/* private function & data */
pp_context->pp_x_steps = gen7_pp_avs_x_steps;
pp_context->pp_y_steps = gen7_pp_avs_y_steps;
+ pp_context->private_context = &pp_context->pp_avs_context;
pp_context->pp_set_block_parameter = gen7_pp_avs_set_block_parameter;
pp_avs_context->dest_x = dst_rect->x;
@@ -3019,7 +3024,7 @@ gen7_pp_rgbx_avs_initialize(VADriverContextP ctx, struct i965_post_processing_co
const VARectangle *dst_rect,
void *filter_param)
{
- struct pp_avs_context *pp_avs_context = (struct pp_avs_context *)&pp_context->private_context;
+ struct pp_avs_context *pp_avs_context = (struct pp_avs_context *)&pp_context->pp_avs_context;
struct gen7_pp_static_parameter *pp_static_parameter = pp_context->pp_static_parameter;
struct gen7_sampler_8x8 *sampler_8x8;
struct i965_sampler_8x8_state *sampler_8x8_state;
@@ -3187,6 +3192,7 @@ gen7_pp_rgbx_avs_initialize(VADriverContextP ctx, struct i965_post_processing_co
/* private function & data */
pp_context->pp_x_steps = gen7_pp_avs_x_steps;
pp_context->pp_y_steps = gen7_pp_avs_y_steps;
+ pp_context->private_context = &pp_context->pp_avs_context;
pp_context->pp_set_block_parameter = gen7_pp_avs_set_block_parameter;
pp_avs_context->dest_x = dst_rect->x;
@@ -3254,7 +3260,7 @@ pp_nv12_dndi_initialize(VADriverContextP ctx, struct i965_post_processing_contex
void *filter_param)
{
struct i965_driver_data *i965 = i965_driver_data(ctx);
- struct pp_dndi_context *pp_dndi_context = (struct pp_dndi_context *)&pp_context->private_context;
+ struct pp_dndi_context *pp_dndi_context = (struct pp_dndi_context *)&pp_context->pp_dndi_context;
struct pp_inline_parameter *pp_inline_parameter = pp_context->pp_inline_parameter;
struct pp_static_parameter *pp_static_parameter = pp_context->pp_static_parameter;
struct object_surface *obj_surface;
@@ -3390,6 +3396,7 @@ pp_nv12_dndi_initialize(VADriverContextP ctx, struct i965_post_processing_contex
/* private function & data */
pp_context->pp_x_steps = pp_dndi_x_steps;
pp_context->pp_y_steps = pp_dndi_y_steps;
+ pp_context->private_context = &pp_context->pp_dndi_context;
pp_context->pp_set_block_parameter = pp_dndi_set_block_parameter;
pp_static_parameter->grf1.statistics_surface_picth = w / 2;
@@ -3444,7 +3451,7 @@ pp_nv12_dn_initialize(VADriverContextP ctx, struct i965_post_processing_context
void *filter_param)
{
struct i965_driver_data *i965 = i965_driver_data(ctx);
- struct pp_dn_context *pp_dn_context = (struct pp_dn_context *)&pp_context->private_context;
+ struct pp_dn_context *pp_dn_context = (struct pp_dn_context *)&pp_context->pp_dn_context;
struct object_surface *obj_surface;
struct i965_sampler_dndi *sampler_dndi;
struct pp_static_parameter *pp_static_parameter = pp_context->pp_static_parameter;
@@ -3596,6 +3603,7 @@ pp_nv12_dn_initialize(VADriverContextP ctx, struct i965_post_processing_context
/* private function & data */
pp_context->pp_x_steps = pp_dn_x_steps;
pp_context->pp_y_steps = pp_dn_y_steps;
+ pp_context->private_context = &pp_context->pp_dn_context;
pp_context->pp_set_block_parameter = pp_dn_set_block_parameter;
pp_static_parameter->grf1.statistics_surface_picth = w / 2;
@@ -3652,7 +3660,7 @@ gen7_pp_nv12_dndi_initialize(VADriverContextP ctx, struct i965_post_processing_c
void *filter_param)
{
struct i965_driver_data *i965 = i965_driver_data(ctx);
- struct pp_dndi_context *pp_dndi_context = (struct pp_dndi_context *)&pp_context->private_context;
+ struct pp_dndi_context *pp_dndi_context = (struct pp_dndi_context *)&pp_context->pp_dndi_context;
struct gen7_pp_static_parameter *pp_static_parameter = pp_context->pp_static_parameter;
struct object_surface *obj_surface;
struct gen7_sampler_dndi *sampler_dndi;
@@ -3824,6 +3832,7 @@ gen7_pp_nv12_dndi_initialize(VADriverContextP ctx, struct i965_post_processing_c
/* private function & data */
pp_context->pp_x_steps = gen7_pp_dndi_x_steps;
pp_context->pp_y_steps = gen7_pp_dndi_y_steps;
+ pp_context->private_context = &pp_context->pp_dndi_context;
pp_context->pp_set_block_parameter = gen7_pp_dndi_set_block_parameter;
pp_static_parameter->grf1.di_statistics_surface_pitch_div2 = w / 2;
@@ -3882,7 +3891,7 @@ gen7_pp_nv12_dn_initialize(VADriverContextP ctx, struct i965_post_processing_con
void *filter_param)
{
struct i965_driver_data *i965 = i965_driver_data(ctx);
- struct pp_dn_context *pp_dn_context = (struct pp_dn_context *)&pp_context->private_context;
+ struct pp_dn_context *pp_dn_context = (struct pp_dn_context *)&pp_context->pp_dn_context;
struct gen7_pp_static_parameter *pp_static_parameter = pp_context->pp_static_parameter;
struct object_surface *obj_surface;
struct gen7_sampler_dndi *sampler_dn;
@@ -4052,6 +4061,7 @@ gen7_pp_nv12_dn_initialize(VADriverContextP ctx, struct i965_post_processing_con
/* private function & data */
pp_context->pp_x_steps = gen7_pp_dn_x_steps;
pp_context->pp_y_steps = gen7_pp_dn_y_steps;
+ pp_context->private_context = &pp_context->pp_dn_context;
pp_context->pp_set_block_parameter = gen7_pp_dn_set_block_parameter;
pp_static_parameter->grf1.di_statistics_surface_pitch_div2 = w / 2;
@@ -4094,7 +4104,7 @@ static int
gen7_pp_blending_set_block_parameter(struct i965_post_processing_context *pp_context, int x, int y)
{
struct gen7_pp_inline_parameter *pp_inline_parameter = pp_context->pp_inline_parameter;
- struct pp_blending_context *pp_blending_context = (struct pp_blending_context *)&pp_context->private_context;
+ struct pp_blending_context *pp_blending_context = (struct pp_blending_context *)pp_context->private_context;
pp_inline_parameter->grf7.destination_block_horizontal_origin = x * 16 + pp_blending_context->dest_x;
pp_inline_parameter->grf7.destination_block_vertical_origin = y * 16 + pp_blending_context->dest_y;
@@ -4111,7 +4121,7 @@ gen7_pp_nv12_blending_initialize(VADriverContextP ctx, struct i965_post_processi
void *filter_param)
{
struct gen7_pp_static_parameter *pp_static_parameter = pp_context->pp_static_parameter;
- struct pp_blending_context *pp_blending_context = (struct pp_blending_context *)&pp_context->private_context;
+ struct pp_blending_context *pp_blending_context = (struct pp_blending_context *)&pp_context->pp_blending_context;
VABlendState *blend_state = (VABlendState*)filter_param;
struct object_surface *obj_surface;
int orig_w, orig_h, w, h;
@@ -4157,6 +4167,7 @@ gen7_pp_nv12_blending_initialize(VADriverContextP ctx, struct i965_post_processi
/* private function & data */
pp_context->pp_x_steps = gen7_pp_blending_x_steps;
pp_context->pp_y_steps = gen7_pp_blending_y_steps;
+ pp_context->private_context = &pp_context->pp_blending_context;
pp_context->pp_set_block_parameter = gen7_pp_blending_set_block_parameter;
pp_blending_context->dest_x = dst_rect->x;
@@ -4635,8 +4646,8 @@ gen6_pp_object_walker(VADriverContextP ctx,
else
param_size = sizeof(struct pp_inline_parameter);
- x_steps = pp_context->pp_x_steps(&pp_context->private_context);
- y_steps = pp_context->pp_y_steps(&pp_context->private_context);
+ x_steps = pp_context->pp_x_steps(pp_context->private_context);
+ y_steps = pp_context->pp_y_steps(pp_context->private_context);
command_length_in_dws = 6 + (param_size >> 2);
command_buffer = dri_bo_alloc(i965->intel.bufmgr,
"command objects buffer",
diff --git a/src/i965_post_processing.h b/src/i965_post_processing.h
index 3791cdc..0852226 100755
--- a/src/i965_post_processing.h
+++ b/src/i965_post_processing.h
@@ -489,14 +489,13 @@ struct i965_post_processing_context
dri_bo *bo;
} stmm;
- union {
- struct pp_load_save_context pp_load_save_context;
- struct pp_scaling_context pp_scaling_context;
- struct pp_avs_context pp_avs_context;
- struct pp_dndi_context pp_dndi_context;
- struct pp_dn_context pp_dn_context;
- struct pp_blending_context pp_blending_context;
- } private_context;
+ struct pp_load_save_context pp_load_save_context;
+ struct pp_scaling_context pp_scaling_context;
+ struct pp_avs_context pp_avs_context;
+ struct pp_dndi_context pp_dndi_context;
+ struct pp_dn_context pp_dn_context;
+ struct pp_blending_context pp_blending_context;
+ void *private_context; /* pointer to the current private context */
int (*pp_x_steps)(void *private_context);
int (*pp_y_steps)(void *private_context);