diff options
author | Zhao Yakui <yakui.zhao@intel.com> | 2013-10-29 16:17:08 +0800 |
---|---|---|
committer | Yakui Zhao <yakui.zhao@intel.com> | 2013-10-29 16:17:08 +0800 |
commit | 0a6e8986e3cee77401f7843ee7ef9ca77b030a69 (patch) | |
tree | 7a9c08a826a84efcc0f82f1c996b8e57b467f228 | |
parent | 0883055f0ce37147aa1b0f783c83073047ff0a52 (diff) |
Use filter_callback to check whether the VPP filter is supported or not
Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
-rwxr-xr-x | src/i965_drv_video.c | 29 | ||||
-rw-r--r-- | src/i965_drv_video.h | 1 |
2 files changed, 19 insertions, 11 deletions
diff --git a/src/i965_drv_video.c b/src/i965_drv_video.c index 0ebdf7a..9efe403 100755 --- a/src/i965_drv_video.c +++ b/src/i965_drv_video.c @@ -84,6 +84,10 @@ static int get_sampling_from_fourcc(unsigned int fourcc); +static int +i965_os_has_ring_support(VADriverContextP ctx, + struct i965_filter *filter); + /* Check whether we are rendering to X11 (VA/X11 or VA/GLX API) */ #define IS_VA_X11(ctx) \ (((ctx)->display_type & VA_DISPLAY_MAJOR_MASK) == VA_DISPLAY_X11) @@ -236,8 +240,8 @@ static struct hw_codec_info gen6_hw_codec_info = { .num_filters = 2, .filters = { - { VAProcFilterNoiseReduction, I965_RING_NULL }, - { VAProcFilterDeinterlacing, I965_RING_NULL }, + { VAProcFilterNoiseReduction, I965_RING_NULL, i965_os_has_ring_support, }, + { VAProcFilterDeinterlacing, I965_RING_NULL, i965_os_has_ring_support, }, }, }; @@ -265,8 +269,8 @@ static struct hw_codec_info gen7_hw_codec_info = { .num_filters = 2, .filters = { - { VAProcFilterNoiseReduction, I965_RING_NULL }, - { VAProcFilterDeinterlacing, I965_RING_NULL }, + { VAProcFilterNoiseReduction, I965_RING_NULL, i965_os_has_ring_support, }, + { VAProcFilterDeinterlacing, I965_RING_NULL, i965_os_has_ring_support, }, }, }; @@ -294,10 +298,10 @@ static struct hw_codec_info gen75_hw_codec_info = { .num_filters = 4, .filters = { - { VAProcFilterNoiseReduction, I965_RING_VEBOX }, - { VAProcFilterDeinterlacing, I965_RING_VEBOX }, - { VAProcFilterSharpening, I965_RING_NULL }, - { VAProcFilterColorBalance, I965_RING_VEBOX}, + { VAProcFilterNoiseReduction, I965_RING_VEBOX, i965_os_has_ring_support, }, + { VAProcFilterDeinterlacing, I965_RING_VEBOX, i965_os_has_ring_support, }, + { VAProcFilterSharpening, I965_RING_NULL, i965_os_has_ring_support, }, + { VAProcFilterColorBalance, I965_RING_VEBOX, i965_os_has_ring_support, }, }, }; @@ -4567,9 +4571,10 @@ i965_QuerySurfaceAttributes(VADriverContextP ctx, static int i965_os_has_ring_support(VADriverContextP ctx, - int ring) + struct i965_filter *filter) { struct i965_driver_data *const i965 = i965_driver_data(ctx); + int ring = filter->ring; switch (ring) { case I965_RING_BSD: @@ -4610,7 +4615,8 @@ VAStatus i965_QueryVideoProcFilters( return VA_STATUS_ERROR_INVALID_PARAMETER; for (i = 0; i < i965->codec_info->num_filters; i++) { - if (i965_os_has_ring_support(ctx, i965->codec_info->filters[i].ring)) { + if (i965->codec_info->filters[i].filter_callback(ctx, + &i965->codec_info->filters[i])) { if (num == *num_filters) { *num_filters = i965->codec_info->num_filters; @@ -4642,7 +4648,8 @@ VAStatus i965_QueryVideoProcFilterCaps( for (i = 0; i < i965->codec_info->num_filters; i++) { if (type == i965->codec_info->filters[i].type && - i965_os_has_ring_support(ctx, i965->codec_info->filters[i].ring)) + i965->codec_info->filters[i].filter_callback(ctx, + &i965->codec_info->filters[i])) break; } diff --git a/src/i965_drv_video.h b/src/i965_drv_video.h index af3701f..4284a4b 100644 --- a/src/i965_drv_video.h +++ b/src/i965_drv_video.h @@ -275,6 +275,7 @@ struct i965_filter { VAProcFilterType type; int ring; + int (*filter_callback)(VADriverContextP ctx, struct i965_filter *filter); }; struct hw_codec_info |