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