Commit 12f5b095 authored by Xiang, Haihao's avatar Xiang, Haihao

i965_drv_video: update post processing interface

Signed-off-by: default avatarXiang, Haihao <haihao.xiang@intel.com>
parent f152e212
...@@ -435,8 +435,6 @@ i965_destroy_surface(struct object_heap *heap, struct object_base *obj) ...@@ -435,8 +435,6 @@ i965_destroy_surface(struct object_heap *heap, struct object_base *obj)
dri_bo_unreference(obj_surface->bo); dri_bo_unreference(obj_surface->bo);
obj_surface->bo = NULL; obj_surface->bo = NULL;
dri_bo_unreference(obj_surface->pp_out_bo);
obj_surface->pp_out_bo = NULL;
if (obj_surface->free_private_data != NULL) { if (obj_surface->free_private_data != NULL) {
obj_surface->free_private_data(&obj_surface->private_data); obj_surface->free_private_data(&obj_surface->private_data);
...@@ -491,7 +489,6 @@ i965_CreateSurfaces(VADriverContextP ctx, ...@@ -491,7 +489,6 @@ i965_CreateSurfaces(VADriverContextP ctx,
obj_surface->flags = SURFACE_REFERENCED; obj_surface->flags = SURFACE_REFERENCED;
obj_surface->fourcc = 0; obj_surface->fourcc = 0;
obj_surface->bo = NULL; obj_surface->bo = NULL;
obj_surface->pp_out_bo = NULL;
obj_surface->locked_image_id = VA_INVALID_ID; obj_surface->locked_image_id = VA_INVALID_ID;
obj_surface->private_data = NULL; obj_surface->private_data = NULL;
obj_surface->free_private_data = NULL; obj_surface->free_private_data = NULL;
......
...@@ -156,11 +156,6 @@ struct object_surface ...@@ -156,11 +156,6 @@ struct object_surface
int flags; int flags;
unsigned int fourcc; unsigned int fourcc;
dri_bo *bo; dri_bo *bo;
int pp_out_width;
int pp_out_height;
int orig_pp_out_width;
int orig_pp_out_height;
dri_bo *pp_out_bo;
VAImageID locked_image_id; VAImageID locked_image_id;
void (*free_private_data)(void **data); void (*free_private_data)(void **data);
void *private_data; void *private_data;
......
This diff is collapsed.
...@@ -53,14 +53,22 @@ struct pp_load_save_context ...@@ -53,14 +53,22 @@ struct pp_load_save_context
struct pp_scaling_context struct pp_scaling_context
{ {
int dest_x; /* in pixel */
int dest_y; /* in pixel */
int dest_w; int dest_w;
int dest_h; int dest_h;
int src_normalized_x;
int src_normalized_y;
}; };
struct pp_avs_context struct pp_avs_context
{ {
int dest_x; /* in pixel */
int dest_y; /* in pixel */
int dest_w; int dest_w;
int dest_h; int dest_h;
int src_normalized_x;
int src_normalized_y;
int src_w; int src_w;
int src_h; int src_h;
}; };
...@@ -69,7 +77,6 @@ struct pp_dndi_context ...@@ -69,7 +77,6 @@ struct pp_dndi_context
{ {
int dest_w; int dest_w;
int dest_h; int dest_h;
}; };
struct pp_module struct pp_module
...@@ -77,9 +84,9 @@ struct pp_module ...@@ -77,9 +84,9 @@ struct pp_module
struct i965_kernel kernel; struct i965_kernel kernel;
/* others */ /* others */
void (*initialize)(VADriverContextP ctx, VASurfaceID surface, int input, void (*initialize)(VADriverContextP ctx,
unsigned short srcw, unsigned short srch, VASurfaceID in_surface_id, VASurfaceID out_surface_id,
unsigned short destw, unsigned short desth); const VARectangle *src_rect, const VARectangle *dst_rect);
}; };
struct pp_static_parameter struct pp_static_parameter
...@@ -350,13 +357,14 @@ struct i965_post_processing_context ...@@ -350,13 +357,14 @@ struct i965_post_processing_context
int (*pp_set_block_parameter)(struct i965_post_processing_context *pp_context, int x, int y); int (*pp_set_block_parameter)(struct i965_post_processing_context *pp_context, int x, int y);
}; };
void VASurfaceID
i965_post_processing( i965_post_processing(
VADriverContextP ctx, VADriverContextP ctx,
VASurfaceID surface, VASurfaceID surface,
const VARectangle *src_rect, const VARectangle *src_rect,
const VARectangle *dst_rect, const VARectangle *dst_rect,
unsigned int flags unsigned int flags,
int *has_done_scaling
); );
Bool Bool
......
...@@ -757,7 +757,6 @@ i965_render_src_surfaces_state(VADriverContextP ctx, ...@@ -757,7 +757,6 @@ i965_render_src_surfaces_state(VADriverContextP ctx,
VASurfaceID surface) VASurfaceID surface)
{ {
struct i965_driver_data *i965 = i965_driver_data(ctx); struct i965_driver_data *i965 = i965_driver_data(ctx);
struct i965_render_state *render_state = &i965->render_state;
struct object_surface *obj_surface; struct object_surface *obj_surface;
int w, h; int w, h;
int rw, rh; int rw, rh;
...@@ -766,19 +765,11 @@ i965_render_src_surfaces_state(VADriverContextP ctx, ...@@ -766,19 +765,11 @@ i965_render_src_surfaces_state(VADriverContextP ctx,
obj_surface = SURFACE(surface); obj_surface = SURFACE(surface);
assert(obj_surface); assert(obj_surface);
if (obj_surface->pp_out_bo) {
w = obj_surface->pp_out_width;
h = obj_surface->pp_out_height;
rw = obj_surface->orig_pp_out_width;
rh = obj_surface->orig_pp_out_height;
region = obj_surface->pp_out_bo;
} else {
w = obj_surface->width; w = obj_surface->width;
h = obj_surface->height; h = obj_surface->height;
rw = obj_surface->orig_width; rw = obj_surface->orig_width;
rh = obj_surface->orig_height; rh = obj_surface->orig_height;
region = obj_surface->bo; region = obj_surface->bo;
}
i965_render_src_surface_state(ctx, 1, region, 0, rw, rh, w, I965_SURFACEFORMAT_R8_UNORM); /* Y */ i965_render_src_surface_state(ctx, 1, region, 0, rw, rh, w, I965_SURFACEFORMAT_R8_UNORM); /* Y */
i965_render_src_surface_state(ctx, 2, region, 0, rw, rh, w, I965_SURFACEFORMAT_R8_UNORM); i965_render_src_surface_state(ctx, 2, region, 0, rw, rh, w, I965_SURFACEFORMAT_R8_UNORM);
...@@ -2901,7 +2892,10 @@ gen7_render_put_subpicture( ...@@ -2901,7 +2892,10 @@ gen7_render_put_subpicture(
/* /*
* global functions * global functions
*/ */
VAStatus
i965_DestroySurfaces(VADriverContextP ctx,
VASurfaceID *surface_list,
int num_surfaces);
void void
intel_render_put_surface( intel_render_put_surface(
VADriverContextP ctx, VADriverContextP ctx,
...@@ -2912,15 +2906,24 @@ intel_render_put_surface( ...@@ -2912,15 +2906,24 @@ intel_render_put_surface(
) )
{ {
struct i965_driver_data *i965 = i965_driver_data(ctx); struct i965_driver_data *i965 = i965_driver_data(ctx);
int has_done_scaling = 0;
VASurfaceID in_surface_id = surface;
VASurfaceID out_surface_id = i965_post_processing(ctx, surface, src_rect, dst_rect, flags, &has_done_scaling);
assert((!has_done_scaling) || (out_surface_id != VA_INVALID_ID));
i965_post_processing(ctx, surface, src_rect, dst_rect, flags); if (out_surface_id != VA_INVALID_ID)
in_surface_id = out_surface_id;
if (IS_GEN7(i965->intel.device_id)) if (IS_GEN7(i965->intel.device_id))
gen7_render_put_surface(ctx, surface, src_rect, dst_rect, flags); gen7_render_put_surface(ctx, in_surface_id, has_done_scaling ? dst_rect : src_rect, dst_rect, flags);
else if (IS_GEN6(i965->intel.device_id)) else if (IS_GEN6(i965->intel.device_id))
gen6_render_put_surface(ctx, surface, src_rect, dst_rect, flags); gen6_render_put_surface(ctx, in_surface_id, has_done_scaling ? dst_rect : src_rect, dst_rect, flags);
else else
i965_render_put_surface(ctx, surface, src_rect, dst_rect, flags); i965_render_put_surface(ctx, in_surface_id, has_done_scaling ? dst_rect : src_rect, dst_rect, flags);
if (in_surface_id != surface)
i965_DestroySurfaces(ctx, &in_surface_id, 1);
} }
void void
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment