summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGwenole Beauchesne <gwenole.beauchesne@intel.com>2014-10-13 17:58:46 +0200
committerGwenole Beauchesne <gwenole.beauchesne@intel.com>2014-11-11 11:57:18 +0100
commitd491750cac25123684fba4ed84a11083e47a5b25 (patch)
tree325b5dbf90340f01a5e46031a4127c5a72787aa7
parent6af907d7cb9c6b38aeec81a83f63445b60bfdff1 (diff)
downloadlibva-intel-driver-d491750cac25123684fba4ed84a11083e47a5b25.tar.gz
vpp: drop internal postprocessing (I965_PP_xxx) flags.
Exclusively use VA-API defined video processing flags, instead of yet redefining another set with limited use. This means that we can use scaling, colorspace and picture structure flags as is, without an extra layer of conversion. Drop I965_PP_FLAG_MCDI (motion compensated deinterlacing), which was never set. Dropped the associated dead code, which was never used. And, anyway, advanced deinterlacing modes shall go through the explcit VPP interfaces. Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
-rw-r--r--src/gen75_vpp_vebox.c6
-rw-r--r--src/gen8_render.c6
-rw-r--r--src/i965_output_dri.c19
-rwxr-xr-xsrc/i965_post_processing.c50
-rwxr-xr-xsrc/i965_post_processing.h9
-rw-r--r--src/i965_render.c12
-rw-r--r--src/i965_vpp_avs.h7
7 files changed, 31 insertions, 78 deletions
diff --git a/src/gen75_vpp_vebox.c b/src/gen75_vpp_vebox.c
index b4cae792..e3beaae7 100644
--- a/src/gen75_vpp_vebox.c
+++ b/src/gen75_vpp_vebox.c
@@ -87,10 +87,9 @@ vpp_surface_convert(VADriverContextP ctx, struct object_surface *src_obj_surf,
static VAStatus
vpp_surface_scaling(VADriverContextP ctx, struct object_surface *src_obj_surf,
- struct object_surface *dst_obj_surf)
+ struct object_surface *dst_obj_surf, uint32_t flags)
{
VAStatus va_status = VA_STATUS_SUCCESS;
- int flags = I965_PP_FLAG_AVS;
assert(src_obj_surf->fourcc == VA_FOURCC_NV12);
assert(dst_obj_surf->fourcc == VA_FOURCC_NV12);
@@ -1241,7 +1240,8 @@ int hsw_veb_post_format_convert(VADriverContextP ctx,
assert(obj_surface->fourcc == VA_FOURCC_NV12);
/* first step :surface scaling */
- vpp_surface_scaling(ctx, obj_surface, proc_ctx->surface_output_scaled_object);
+ vpp_surface_scaling(ctx, obj_surface,
+ proc_ctx->surface_output_scaled_object, 0);
/* second step: color format convert and copy to output */
obj_surface = proc_ctx->surface_output_object;
diff --git a/src/gen8_render.c b/src/gen8_render.c
index 9c49cbc6..b7494a1a 100644
--- a/src/gen8_render.c
+++ b/src/gen8_render.c
@@ -189,11 +189,11 @@ gen8_render_set_surface_state(
memset(ss, 0, sizeof(*ss));
- switch (flags & (I965_PP_FLAG_TOP_FIELD|I965_PP_FLAG_BOTTOM_FIELD)) {
- case I965_PP_FLAG_BOTTOM_FIELD:
+ switch (flags & (VA_TOP_FIELD|VA_BOTTOM_FIELD)) {
+ case VA_BOTTOM_FIELD:
ss->ss0.vert_line_stride_ofs = 1;
/* fall-through */
- case I965_PP_FLAG_TOP_FIELD:
+ case VA_TOP_FIELD:
ss->ss0.vert_line_stride = 1;
height /= 2;
break;
diff --git a/src/i965_output_dri.c b/src/i965_output_dri.c
index 6f8ea312..9bba3330 100644
--- a/src/i965_output_dri.c
+++ b/src/i965_output_dri.c
@@ -123,11 +123,9 @@ i965_put_surface_dri(
union dri_buffer *buffer;
struct intel_region *dest_region;
struct object_surface *obj_surface;
- unsigned int pp_flag = 0;
bool new_region = false;
uint32_t name;
int i, ret;
- unsigned int color_flag = 0;
/* Currently don't support DRI1 */
if (!VA_CHECK_DRM_AUTH_TYPE(ctx, VA_DRM_AUTH_DRI2))
@@ -179,21 +177,10 @@ i965_put_surface_dri(
assert(ret == 0);
}
- color_flag = flags & VA_SRC_COLOR_MASK;
- if (color_flag == 0)
- color_flag = VA_SRC_BT601;
+ if (!(flags & VA_SRC_COLOR_MASK))
+ flags |= VA_SRC_BT601;
- pp_flag = color_flag;
-
- if ((flags & VA_FILTER_SCALING_MASK) == VA_FILTER_SCALING_NL_ANAMORPHIC)
- pp_flag |= I965_PP_FLAG_AVS;
-
- if (flags & VA_TOP_FIELD)
- pp_flag |= I965_PP_FLAG_TOP_FIELD;
- else if (flags & VA_BOTTOM_FIELD)
- pp_flag |= I965_PP_FLAG_BOTTOM_FIELD;
-
- intel_render_put_surface(ctx, obj_surface, src_rect, dst_rect, pp_flag);
+ intel_render_put_surface(ctx, obj_surface, src_rect, dst_rect, flags);
for (i = 0; i < I965_MAX_SUBPIC_SUM; i++) {
if (obj_surface->obj_subpic[i] != NULL) {
diff --git a/src/i965_post_processing.c b/src/i965_post_processing.c
index 647efc43..9a59325c 100755
--- a/src/i965_post_processing.c
+++ b/src/i965_post_processing.c
@@ -4798,7 +4798,7 @@ i965_scaling_processing(
const VARectangle *src_rect,
struct object_surface *dst_surface_obj,
const VARectangle *dst_rect,
- unsigned int flags)
+ unsigned int va_flags)
{
VAStatus va_status = VA_STATUS_SUCCESS;
struct i965_driver_data *i965 = i965_driver_data(ctx);
@@ -4806,7 +4806,7 @@ i965_scaling_processing(
assert(src_surface_obj->fourcc == VA_FOURCC_NV12);
assert(dst_surface_obj->fourcc == VA_FOURCC_NV12);
- if (HAS_VPP(i965) && (flags & I965_PP_FLAG_AVS)) {
+ if (HAS_VPP(i965)) {
struct i965_surface src_surface;
struct i965_surface dst_surface;
@@ -4820,12 +4820,8 @@ i965_scaling_processing(
dst_surface.flags = I965_SURFACE_FLAG_FRAME;
va_status = i965_post_processing_internal(ctx, i965->pp_context,
- &src_surface,
- src_rect,
- &dst_surface,
- dst_rect,
- PP_NV12_AVS,
- NULL);
+ &src_surface, src_rect, &dst_surface, dst_rect,
+ avs_is_needed(va_flags) ? PP_NV12_AVS : PP_NV12_SCALING, NULL);
_i965UnlockMutex(&i965->pp_mutex);
}
@@ -4839,7 +4835,7 @@ i965_post_processing(
struct object_surface *obj_surface,
const VARectangle *src_rect,
const VARectangle *dst_rect,
- unsigned int flags,
+ unsigned int va_flags,
int *has_done_scaling
)
{
@@ -4860,38 +4856,7 @@ i965_post_processing(
_i965LockMutex(&i965->pp_mutex);
- if (flags & I965_PP_FLAG_MCDI) {
- src_surface.base = (struct object_base *)obj_surface;
- src_surface.type = I965_SURFACE_TYPE_SURFACE;
- src_surface.flags = (flags & I965_PP_FLAG_TOP_FIELD) ?
- I965_SURFACE_FLAG_TOP_FIELD_FIRST : I965_SURFACE_FLAG_BOTTOME_FIELD_FIRST;
-
- status = i965_CreateSurfaces(ctx,
- obj_surface->orig_width,
- obj_surface->orig_height,
- VA_RT_FORMAT_YUV420,
- 1,
- &out_surface_id);
- assert(status == VA_STATUS_SUCCESS);
- obj_surface = SURFACE(out_surface_id);
- assert(obj_surface);
- i965_check_alloc_surface_bo(ctx, obj_surface, 0, VA_FOURCC_NV12, SUBSAMPLE_YUV420);
- i965_vpp_clear_surface(ctx, i965->pp_context, obj_surface, 0);
-
- dst_surface.base = (struct object_base *)obj_surface;
- dst_surface.type = I965_SURFACE_TYPE_SURFACE;
- dst_surface.flags = I965_SURFACE_FLAG_FRAME;
-
- i965_post_processing_internal(ctx, i965->pp_context,
- &src_surface,
- src_rect,
- &dst_surface,
- dst_rect,
- PP_NV12_DNDI,
- NULL);
- }
-
- if (flags & I965_PP_FLAG_AVS) {
+ if (avs_is_needed(va_flags)) {
struct i965_render_state *render_state = &i965->render_state;
struct intel_region *dest_region = render_state->draw_region;
@@ -5692,8 +5657,7 @@ i965_proc_picture(VADriverContextP ctx,
&src_rect,
&dst_surface,
&dst_rect,
- (pipeline_param->filter_flags & VA_FILTER_SCALING_MASK) == VA_FILTER_SCALING_NL_ANAMORPHIC ?
- PP_NV12_AVS : PP_NV12_SCALING,
+ avs_is_needed(pipeline_param->filter_flags) ? PP_NV12_AVS : PP_NV12_SCALING,
NULL);
}
diff --git a/src/i965_post_processing.h b/src/i965_post_processing.h
index 1350401a..a5675274 100755
--- a/src/i965_post_processing.h
+++ b/src/i965_post_processing.h
@@ -33,11 +33,6 @@
#define MAX_PP_SURFACES 48
-#define I965_PP_FLAG_TOP_FIELD 1
-#define I965_PP_FLAG_BOTTOM_FIELD 2
-#define I965_PP_FLAG_MCDI 4
-#define I965_PP_FLAG_AVS 8
-
enum
{
PP_NULL = 0,
@@ -553,7 +548,7 @@ i965_post_processing(
struct object_surface *obj_surface,
const VARectangle *src_rect,
const VARectangle *dst_rect,
- unsigned int flags,
+ unsigned int va_flags,
int *has_done_scaling
);
@@ -564,7 +559,7 @@ i965_scaling_processing(
const VARectangle *src_rect,
struct object_surface *dst_surface_obj,
const VARectangle *dst_rect,
- unsigned int flags
+ unsigned int va_flags
);
VAStatus
diff --git a/src/i965_render.c b/src/i965_render.c
index 38f70ebb..f34a54ac 100644
--- a/src/i965_render.c
+++ b/src/i965_render.c
@@ -708,11 +708,11 @@ i965_render_set_surface_state(
memset(ss, 0, sizeof(*ss));
- switch (flags & (I965_PP_FLAG_TOP_FIELD|I965_PP_FLAG_BOTTOM_FIELD)) {
- case I965_PP_FLAG_BOTTOM_FIELD:
+ switch (flags & (VA_TOP_FIELD|VA_BOTTOM_FIELD)) {
+ case VA_BOTTOM_FIELD:
ss->ss0.vert_line_stride_ofs = 1;
/* fall-through */
- case I965_PP_FLAG_TOP_FIELD:
+ case VA_TOP_FIELD:
ss->ss0.vert_line_stride = 1;
height /= 2;
break;
@@ -779,11 +779,11 @@ gen7_render_set_surface_state(
memset(ss, 0, sizeof(*ss));
- switch (flags & (I965_PP_FLAG_TOP_FIELD|I965_PP_FLAG_BOTTOM_FIELD)) {
- case I965_PP_FLAG_BOTTOM_FIELD:
+ switch (flags & (VA_TOP_FIELD|VA_BOTTOM_FIELD)) {
+ case VA_BOTTOM_FIELD:
ss->ss0.vert_line_stride_ofs = 1;
/* fall-through */
- case I965_PP_FLAG_TOP_FIELD:
+ case VA_TOP_FIELD:
ss->ss0.vert_line_stride = 1;
height /= 2;
break;
diff --git a/src/i965_vpp_avs.h b/src/i965_vpp_avs.h
index ead42614..0b01c8f5 100644
--- a/src/i965_vpp_avs.h
+++ b/src/i965_vpp_avs.h
@@ -99,4 +99,11 @@ avs_init_state(AVSState *avs, const AVSConfig *config);
bool
avs_update_coefficients(AVSState *avs, float sx, float sy, uint32_t flags);
+/** Checks whether AVS is needed, e.g. if high-quality scaling is requested */
+static inline bool
+avs_is_needed(uint32_t flags)
+{
+ return ((flags & VA_FILTER_SCALING_MASK) >= VA_FILTER_SCALING_HQ);
+}
+
#endif /* I965_VPP_AVS_H */