Commit 3179d67e authored by Gwenole Beauchesne's avatar Gwenole Beauchesne Committed by Xiang, Haihao

i965_drv_video: simplify put_surface() and put_subpicture() args.

parent 5b5dfd0e
......@@ -2244,10 +2244,12 @@ i965_PutSurface(VADriverContextP ctx,
union dri_buffer *buffer;
struct intel_region *dest_region;
struct object_surface *obj_surface;
VARectangle src_rect, dst_rect;
int ret;
uint32_t name;
Bool new_region = False;
int pp_flag = 0;
/* Currently don't support DRI1 */
if (dri_state->driConnectedFlag != VA_DRI2)
return VA_STATUS_ERROR_UNKNOWN;
......@@ -2305,16 +2307,21 @@ i965_PutSurface(VADriverContextP ctx,
if (flags & (VA_BOTTOM_FIELD | VA_TOP_FIELD))
pp_flag |= I965_PP_FLAG_DEINTERLACING;
intel_render_put_surface(ctx, surface,
srcx, srcy, srcw, srch,
destx, desty, destw, desth,
pp_flag);
src_rect.x = srcx;
src_rect.y = srcy;
src_rect.width = srcw;
src_rect.height = srch;
dst_rect.x = destx;
dst_rect.y = desty;
dst_rect.width = destw;
dst_rect.height = desth;
intel_render_put_surface(ctx, surface, &src_rect, &dst_rect, pp_flag);
if(obj_surface->subpic != VA_INVALID_ID) {
intel_render_put_subpicture(ctx, surface,
srcx, srcy, srcw, srch,
destx, desty, destw, desth);
}
intel_render_put_subpicture(ctx, surface, &src_rect, &dst_rect);
}
dri_swap_buffer(ctx, dri_drawable);
obj_surface->flags |= SURFACE_DISPLAYED;
......
......@@ -1748,18 +1748,14 @@ void pp_nv12_dndi_initialize(VADriverContextP ctx, VASurfaceID surface, int inpu
}
static void
ironlake_pp_initialize(VADriverContextP ctx,
VASurfaceID surface,
int input,
short srcx,
short srcy,
unsigned short srcw,
unsigned short srch,
short destx,
short desty,
unsigned short destw,
unsigned short desth,
int pp_index)
ironlake_pp_initialize(
VADriverContextP ctx,
VASurfaceID surface,
int input,
const VARectangle *src_rect,
const VARectangle *dst_rect,
int pp_index
)
{
struct i965_driver_data *i965 = i965_driver_data(ctx);
struct i965_post_processing_context *pp_context = i965->pp_context;
......@@ -1842,44 +1838,35 @@ ironlake_pp_initialize(VADriverContextP ctx,
pp_module = &pp_context->pp_modules[pp_index];
if (pp_module->initialize)
pp_module->initialize(ctx, surface, input, srcw, srch, destw, desth);
pp_module->initialize(ctx, surface, input,
src_rect->width, src_rect->height,
dst_rect->width, dst_rect->height);
}
static void
ironlake_post_processing(VADriverContextP ctx,
VASurfaceID surface,
int input,
short srcx,
short srcy,
unsigned short srcw,
unsigned short srch,
short destx,
short desty,
unsigned short destw,
unsigned short desth,
int pp_index)
ironlake_post_processing(
VADriverContextP ctx,
VASurfaceID surface,
int input,
const VARectangle *src_rect,
const VARectangle *dst_rect,
int pp_index
)
{
ironlake_pp_initialize(ctx, surface, input,
srcx, srcy, srcw, srch,
destx, desty, destw, desth,
pp_index);
ironlake_pp_initialize(ctx, surface, input, src_rect, dst_rect, pp_index);
ironlake_pp_states_setup(ctx);
ironlake_pp_pipeline_setup(ctx);
}
static void
gen6_pp_initialize(VADriverContextP ctx,
VASurfaceID surface,
int input,
short srcx,
short srcy,
unsigned short srcw,
unsigned short srch,
short destx,
short desty,
unsigned short destw,
unsigned short desth,
int pp_index)
gen6_pp_initialize(
VADriverContextP ctx,
VASurfaceID surface,
int input,
const VARectangle *src_rect,
const VARectangle *dst_rect,
int pp_index
)
{
struct i965_driver_data *i965 = i965_driver_data(ctx);
struct i965_post_processing_context *pp_context = i965->pp_context;
......@@ -1962,7 +1949,9 @@ gen6_pp_initialize(VADriverContextP ctx,
pp_module = &pp_context->pp_modules[pp_index];
if (pp_module->initialize)
pp_module->initialize(ctx, surface, input, srcw, srch, destw, desth);
pp_module->initialize(ctx, surface, input,
src_rect->width, src_rect->height,
dst_rect->width, dst_rect->height);
}
static void
......@@ -2206,68 +2195,48 @@ gen6_pp_pipeline_setup(VADriverContextP ctx)
}
static void
gen6_post_processing(VADriverContextP ctx,
VASurfaceID surface,
int input,
short srcx,
short srcy,
unsigned short srcw,
unsigned short srch,
short destx,
short desty,
unsigned short destw,
unsigned short desth,
int pp_index)
gen6_post_processing(
VADriverContextP ctx,
VASurfaceID surface,
int input,
const VARectangle *src_rect,
const VARectangle *dst_rect,
int pp_index
)
{
gen6_pp_initialize(ctx, surface, input,
srcx, srcy, srcw, srch,
destx, desty, destw, desth,
pp_index);
gen6_pp_initialize(ctx, surface, input, src_rect, dst_rect, pp_index);
gen6_pp_states_setup(ctx);
gen6_pp_pipeline_setup(ctx);
}
static void
i965_post_processing_internal(VADriverContextP ctx,
VASurfaceID surface,
int input,
short srcx,
short srcy,
unsigned short srcw,
unsigned short srch,
short destx,
short desty,
unsigned short destw,
unsigned short desth,
int pp_index)
i965_post_processing_internal(
VADriverContextP ctx,
VASurfaceID surface,
int input,
const VARectangle *src_rect,
const VARectangle *dst_rect,
int pp_index
)
{
struct i965_driver_data *i965 = i965_driver_data(ctx);
if (IS_GEN6(i965->intel.device_id) ||
IS_GEN7(i965->intel.device_id))
gen6_post_processing(ctx, surface, input,
srcx, srcy, srcw, srch,
destx, desty, destw, desth,
pp_index);
gen6_post_processing(ctx, surface, input, src_rect, dst_rect, pp_index);
else
ironlake_post_processing(ctx, surface, input,
srcx, srcy, srcw, srch,
destx, desty, destw, desth,
ironlake_post_processing(ctx, surface, input, src_rect, dst_rect,
pp_index);
}
void
i965_post_processing(VADriverContextP ctx,
VASurfaceID surface,
short srcx,
short srcy,
unsigned short srcw,
unsigned short srch,
short destx,
short desty,
unsigned short destw,
unsigned short desth,
unsigned int flag)
i965_post_processing(
VADriverContextP ctx,
VASurfaceID surface,
const VARectangle *src_rect,
const VARectangle *dst_rect,
unsigned int flags
)
{
struct i965_driver_data *i965 = i965_driver_data(ctx);
......@@ -2276,18 +2245,16 @@ i965_post_processing(VADriverContextP ctx,
if (i965->render_state.interleaved_uv) {
int internal_input = 0;
if (flag & I965_PP_FLAG_DEINTERLACING) {
if (flags & I965_PP_FLAG_DEINTERLACING) {
i965_post_processing_internal(ctx, surface, internal_input,
srcx, srcy, srcw, srch,
destx, desty, destw, desth,
src_rect, dst_rect,
PP_NV12_DNDI);
internal_input = 1;
}
if (flag & I965_PP_FLAG_AVS) {
if (flags & I965_PP_FLAG_AVS) {
i965_post_processing_internal(ctx, surface, internal_input,
srcx, srcy, srcw, srch,
destx, desty, destw, desth,
src_rect, dst_rect,
PP_NV12_AVS);
}
}
......
......@@ -351,17 +351,14 @@ struct i965_post_processing_context
};
void
i965_post_processing(VADriverContextP ctx,
VASurfaceID surface,
short srcx,
short srcy,
unsigned short srcw,
unsigned short srch,
short destx,
short desty,
unsigned short destw,
unsigned short desth,
unsigned int pp_index);
i965_post_processing(
VADriverContextP ctx,
VASurfaceID surface,
const VARectangle *src_rect,
const VARectangle *dst_rect,
unsigned int flags
);
Bool
i965_post_processing_terminate(VADriverContextP ctx);
Bool
......
This diff is collapsed.
......@@ -81,28 +81,22 @@ struct i965_render_state
Bool i965_render_init(VADriverContextP ctx);
Bool i965_render_terminate(VADriverContextP ctx);
void intel_render_put_surface(VADriverContextP ctx,
VASurfaceID surface,
short srcx,
short srcy,
unsigned short srcw,
unsigned short srch,
short destx,
short desty,
unsigned short destw,
unsigned short desth,
unsigned int flag);
void
intel_render_put_surface(
VADriverContextP ctx,
VASurfaceID surface,
const VARectangle *src_rect,
const VARectangle *dst_rect,
unsigned int flags
);
void
intel_render_put_subpicture(VADriverContextP ctx,
VASurfaceID surface,
short srcx,
short srcy,
unsigned short srcw,
unsigned short srch,
short destx,
short desty,
unsigned short destw,
unsigned short desth);
intel_render_put_subpicture(
VADriverContextP ctx,
VASurfaceID surface,
const VARectangle *src_rect,
const VARectangle *dst_rect
);
#endif /* _I965_RENDER_H_ */
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