summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rwxr-xr-xsrc/i965_drv_video.c62
-rw-r--r--src/i965_drv_video.h13
2 files changed, 59 insertions, 16 deletions
diff --git a/src/i965_drv_video.c b/src/i965_drv_video.c
index 3ac5418..606e279 100755
--- a/src/i965_drv_video.c
+++ b/src/i965_drv_video.c
@@ -232,8 +232,8 @@ static struct hw_codec_info gen6_hw_codec_info = {
.num_filters = 2,
.filters = {
- VAProcFilterNoiseReduction,
- VAProcFilterDeinterlacing,
+ { VAProcFilterNoiseReduction, I965_RING_NULL },
+ { VAProcFilterDeinterlacing, I965_RING_NULL },
},
};
@@ -259,8 +259,8 @@ static struct hw_codec_info gen7_hw_codec_info = {
.num_filters = 2,
.filters = {
- VAProcFilterNoiseReduction,
- VAProcFilterDeinterlacing,
+ { VAProcFilterNoiseReduction, I965_RING_NULL },
+ { VAProcFilterDeinterlacing, I965_RING_NULL },
},
};
@@ -285,10 +285,10 @@ static struct hw_codec_info gen75_hw_codec_info = {
.has_di_motion_adptive = 1,
.num_filters = 4,
.filters = {
- VAProcFilterNoiseReduction,
- VAProcFilterDeinterlacing,
- VAProcFilterSharpening,
- VAProcFilterColorBalance,
+ { VAProcFilterNoiseReduction, I965_RING_VEBOX },
+ { VAProcFilterDeinterlacing, I965_RING_VEBOX },
+ { VAProcFilterSharpening, I965_RING_NULL },
+ { VAProcFilterColorBalance, I965_RING_VEBOX},
},
};
@@ -4511,6 +4511,35 @@ i965_QuerySurfaceAttributes(VADriverContextP ctx,
return vaStatus;
}
+
+static int
+i965_os_has_ring_support(VADriverContextP ctx,
+ int ring)
+{
+ struct i965_driver_data *const i965 = i965_driver_data(ctx);
+
+ switch (ring) {
+ case I965_RING_BSD:
+ return i965->intel.has_bsd;
+
+ case I965_RING_BLT:
+ return i965->intel.has_blt;
+
+ case I965_RING_VEBOX:
+ return i965->intel.has_vebox;
+
+ case I965_RING_NULL:
+ return 1; /* Always support */
+
+ default:
+ /* should never get here */
+ assert(0);
+ break;
+ }
+
+ return 0;
+}
+
/*
* Query video processing pipeline
*/
@@ -4522,18 +4551,21 @@ VAStatus i965_QueryVideoProcFilters(
)
{
struct i965_driver_data *const i965 = i965_driver_data(ctx);
- unsigned int i = 0;
+ unsigned int i = 0, num = 0;
if (!num_filters || !filters)
return VA_STATUS_ERROR_INVALID_PARAMETER;
- for (i = 0; i < *num_filters && i < i965->codec_info->num_filters; i++)
- filters[i] = i965->codec_info->filters[i];
-
- *num_filters = i;
+ for (i = 0; i < i965->codec_info->num_filters; i++) {
+ if (i965_os_has_ring_support(ctx, i965->codec_info->filters[i].ring)) {
+ if (num == *num_filters)
+ return VA_STATUS_ERROR_MAX_NUM_EXCEEDED;
+
+ filters[num++] = i965->codec_info->filters[i].type;
+ }
+ }
- if (i < i965->codec_info->num_filters)
- return VA_STATUS_ERROR_MAX_NUM_EXCEEDED;
+ *num_filters = num;
return VA_STATUS_SUCCESS;
}
diff --git a/src/i965_drv_video.h b/src/i965_drv_video.h
index e694d67..48519cd 100644
--- a/src/i965_drv_video.h
+++ b/src/i965_drv_video.h
@@ -258,6 +258,17 @@ struct object_subpic
unsigned int flags;
};
+#define I965_RING_NULL 0
+#define I965_RING_BSD 1
+#define I965_RING_BLT 2
+#define I965_RING_VEBOX 3
+
+struct i965_filter
+{
+ VAProcFilterType type;
+ int ring;
+};
+
struct hw_codec_info
{
struct hw_context *(*dec_hw_context_init)(VADriverContextP, struct object_config *);
@@ -282,7 +293,7 @@ struct hw_codec_info
unsigned int has_di_motion_compensated:1;
unsigned int num_filters;
- VAProcFilterType filters[VAProcFilterCount];
+ struct i965_filter filters[VAProcFilterCount];
};