summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDaniel Charles <daniel.charles@intel.com>2016-11-10 15:08:20 -0800
committerSean V Kelley <seanvk@posteo.de>2016-11-10 15:46:15 -0800
commit55a538c80e0428e9837a6d4bf11a1539541a0aad (patch)
tree48ecbb6f38eda2293f04ada700aeb2514ed3fe6c /test
parenta3000fab93e03318b0e5e2a5b9a799db9a819714 (diff)
i965_test_config: return properly unsupported profile
jpege/jpegd and avce/avcd config tests to check against all supported entrypoints for a profile. UNSUPPORTED_PROFILE is expected when no entrypoints are available for a given profile, else expect UNSUPPORTED_ENTRYPOINT. Signed-off-by: Daniel Charles <daniel.charles@intel.com> Reviewed-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
Diffstat (limited to 'test')
-rw-r--r--test/i965_avcd_config_test.cpp71
-rw-r--r--test/i965_avce_config_test.cpp78
-rw-r--r--test/i965_jpegd_config_test.cpp29
-rw-r--r--test/i965_jpege_config_test.cpp29
4 files changed, 174 insertions, 33 deletions
diff --git a/test/i965_avcd_config_test.cpp b/test/i965_avcd_config_test.cpp
index 851e86e..8bc5e3c 100644
--- a/test/i965_avcd_config_test.cpp
+++ b/test/i965_avcd_config_test.cpp
@@ -27,6 +27,46 @@
namespace AVC {
namespace Decode {
+VAStatus ProfileNotSupported()
+{
+ return VA_STATUS_ERROR_UNSUPPORTED_PROFILE;
+}
+
+VAStatus EntrypointNotSupported()
+{
+ return VA_STATUS_ERROR_UNSUPPORTED_ENTRYPOINT;
+}
+
+// H264*NotSupported functions report properly if profile is not supported or
+// only entrypoint is not supported
+VAStatus H264NotSupported()
+{
+ I965TestEnvironment *env(I965TestEnvironment::instance());
+ EXPECT_PTR(env);
+
+ struct i965_driver_data *i965(*env);
+ EXPECT_PTR(i965);
+
+ if (!HAS_H264_ENCODING(i965)
+ && !HAS_LP_H264_ENCODING(i965))
+ return ProfileNotSupported();
+
+ return EntrypointNotSupported();
+}
+
+VAStatus H264MVCNotSupported()
+{
+ I965TestEnvironment *env(I965TestEnvironment::instance());
+ EXPECT_PTR(env);
+
+ struct i965_driver_data *i965(*env);
+ EXPECT_PTR(i965);
+
+ if (!HAS_H264_MVC_ENCODING(i965))
+ return ProfileNotSupported();
+
+ return EntrypointNotSupported();
+}
VAStatus HasDecodeSupport()
{
I965TestEnvironment *env(I965TestEnvironment::instance());
@@ -35,11 +75,13 @@ VAStatus HasDecodeSupport()
struct i965_driver_data *i965(*env);
EXPECT_PTR(i965);
- return HAS_H264_DECODING(i965) ? VA_STATUS_SUCCESS :
- VA_STATUS_ERROR_UNSUPPORTED_ENTRYPOINT;
+ if (HAS_H264_DECODING(i965))
+ return VA_STATUS_SUCCESS;
+
+ return H264NotSupported();
}
-VAStatus HasMVCDecodeSupport(const VAProfile& profile)
+VAStatus HasMVCDecodeSupport()
{
I965TestEnvironment *env(I965TestEnvironment::instance());
EXPECT_PTR(env);
@@ -47,22 +89,23 @@ VAStatus HasMVCDecodeSupport(const VAProfile& profile)
struct i965_driver_data *i965(*env);
EXPECT_PTR(i965);
- return HAS_H264_MVC_DECODING_PROFILE(i965, profile) ? VA_STATUS_SUCCESS :
- VA_STATUS_ERROR_UNSUPPORTED_ENTRYPOINT;
+ if (HAS_H264_MVC_DECODING(i965))
+ return VA_STATUS_SUCCESS;
+
+ return H264MVCNotSupported();
}
static const std::vector<ConfigTestInput> inputs = {
- {VAProfileH264Baseline, VAEntrypointVLD,
- []{return VA_STATUS_ERROR_UNSUPPORTED_PROFILE;}},
+ { VAProfileH264Baseline, VAEntrypointVLD, &ProfileNotSupported },
- {VAProfileH264ConstrainedBaseline, VAEntrypointVLD, &HasDecodeSupport},
- {VAProfileH264Main, VAEntrypointVLD, &HasDecodeSupport},
- {VAProfileH264High, VAEntrypointVLD, &HasDecodeSupport},
+ { VAProfileH264ConstrainedBaseline, VAEntrypointVLD, &HasDecodeSupport },
+ { VAProfileH264Main, VAEntrypointVLD, &HasDecodeSupport },
+ { VAProfileH264High, VAEntrypointVLD, &HasDecodeSupport },
- {VAProfileH264MultiviewHigh, VAEntrypointVLD,
- std::bind(&HasMVCDecodeSupport, VAProfileH264MultiviewHigh)},
- {VAProfileH264StereoHigh, VAEntrypointVLD,
- std::bind(&HasMVCDecodeSupport, VAProfileH264StereoHigh)},
+ { VAProfileH264MultiviewHigh, VAEntrypointVLD,
+ &HasMVCDecodeSupport },
+ { VAProfileH264StereoHigh, VAEntrypointVLD,
+ &HasMVCDecodeSupport },
};
INSTANTIATE_TEST_CASE_P(
diff --git a/test/i965_avce_config_test.cpp b/test/i965_avce_config_test.cpp
index b30abbc..4830af9 100644
--- a/test/i965_avce_config_test.cpp
+++ b/test/i965_avce_config_test.cpp
@@ -37,6 +37,52 @@ VAStatus EntrypointNotSupported()
return VA_STATUS_ERROR_UNSUPPORTED_ENTRYPOINT;
}
+//H264*NotSupported functions report properly if profile is not supported or
+//only entrypoint is not supported
+VAStatus H264NotSupported()
+{
+ I965TestEnvironment *env(I965TestEnvironment::instance());
+ EXPECT_PTR(env);
+
+ struct i965_driver_data *i965(*env);
+ EXPECT_PTR(i965);
+
+ if (!HAS_H264_DECODING(i965)
+ && !HAS_LP_H264_ENCODING(i965))
+ return ProfileNotSupported();
+
+ return EntrypointNotSupported();
+}
+
+VAStatus H264LPNotSupported()
+{
+ I965TestEnvironment *env(I965TestEnvironment::instance());
+ EXPECT_PTR(env);
+
+ struct i965_driver_data *i965(*env);
+ EXPECT_PTR(i965);
+
+ if (!HAS_H264_DECODING(i965)
+ && !HAS_H264_ENCODING(i965))
+ return ProfileNotSupported();
+
+ return EntrypointNotSupported();
+}
+
+VAStatus H264MVCNotSupported()
+{
+ I965TestEnvironment *env(I965TestEnvironment::instance());
+ EXPECT_PTR(env);
+
+ struct i965_driver_data *i965(*env);
+ EXPECT_PTR(i965);
+
+ if (!HAS_H264_MVC_DECODING(i965))
+ return ProfileNotSupported();
+
+ return EntrypointNotSupported();
+}
+
VAStatus HasEncodeSupport()
{
I965TestEnvironment *env(I965TestEnvironment::instance());
@@ -45,8 +91,10 @@ VAStatus HasEncodeSupport()
struct i965_driver_data *i965(*env);
EXPECT_PTR(i965);
- return HAS_H264_ENCODING(i965) ? VA_STATUS_SUCCESS :
- EntrypointNotSupported();
+ if (HAS_H264_ENCODING(i965))
+ return VA_STATUS_SUCCESS;
+
+ return H264NotSupported();
}
VAStatus HasLPEncodeSupport()
@@ -60,8 +108,10 @@ VAStatus HasLPEncodeSupport()
if (IS_SKL(i965->intel.device_info))
return VA_STATUS_SUCCESS;
- return HAS_LP_H264_ENCODING(i965) ? VA_STATUS_SUCCESS :
- EntrypointNotSupported();
+ if (HAS_LP_H264_ENCODING(i965))
+ return VA_STATUS_SUCCESS;
+
+ return H264LPNotSupported();
}
VAStatus HasMVCEncodeSupport()
@@ -72,8 +122,10 @@ VAStatus HasMVCEncodeSupport()
struct i965_driver_data *i965(*env);
EXPECT_PTR(i965);
- return HAS_H264_MVC_ENCODING(i965) ? VA_STATUS_SUCCESS :
- EntrypointNotSupported();
+ if (HAS_H264_MVC_ENCODING(i965))
+ return VA_STATUS_SUCCESS;
+
+ return H264MVCNotSupported();
}
static const std::vector<ConfigTestInput> inputs = {
@@ -83,23 +135,23 @@ static const std::vector<ConfigTestInput> inputs = {
{VAProfileH264ConstrainedBaseline, VAEntrypointEncSlice, &HasEncodeSupport},
{VAProfileH264ConstrainedBaseline, VAEntrypointEncSliceLP, &HasLPEncodeSupport},
- {VAProfileH264ConstrainedBaseline, VAEntrypointEncPicture, &EntrypointNotSupported},
+ {VAProfileH264ConstrainedBaseline, VAEntrypointEncPicture, &H264NotSupported},
{VAProfileH264Main, VAEntrypointEncSlice, &HasEncodeSupport},
{VAProfileH264Main, VAEntrypointEncSliceLP, &HasLPEncodeSupport},
- {VAProfileH264Main, VAEntrypointEncPicture, &EntrypointNotSupported},
+ {VAProfileH264Main, VAEntrypointEncPicture, &H264NotSupported},
{VAProfileH264High, VAEntrypointEncSlice, &HasEncodeSupport},
{VAProfileH264High, VAEntrypointEncSliceLP, &HasLPEncodeSupport},
- {VAProfileH264High, VAEntrypointEncPicture, &EntrypointNotSupported},
+ {VAProfileH264High, VAEntrypointEncPicture, &H264NotSupported},
{VAProfileH264MultiviewHigh, VAEntrypointEncSlice, &HasMVCEncodeSupport},
- {VAProfileH264MultiviewHigh, VAEntrypointEncSliceLP, &EntrypointNotSupported},
- {VAProfileH264MultiviewHigh, VAEntrypointEncPicture, &EntrypointNotSupported},
+ {VAProfileH264MultiviewHigh, VAEntrypointEncSliceLP, &H264MVCNotSupported},
+ {VAProfileH264MultiviewHigh, VAEntrypointEncPicture, &H264MVCNotSupported},
{VAProfileH264StereoHigh, VAEntrypointEncSlice, &HasMVCEncodeSupport},
- {VAProfileH264StereoHigh, VAEntrypointEncSliceLP, &EntrypointNotSupported},
- {VAProfileH264StereoHigh, VAEntrypointEncPicture, &EntrypointNotSupported},
+ {VAProfileH264StereoHigh, VAEntrypointEncSliceLP, &H264MVCNotSupported},
+ {VAProfileH264StereoHigh, VAEntrypointEncPicture, &H264MVCNotSupported},
};
INSTANTIATE_TEST_CASE_P(
diff --git a/test/i965_jpegd_config_test.cpp b/test/i965_jpegd_config_test.cpp
index 4e2216c..371b827 100644
--- a/test/i965_jpegd_config_test.cpp
+++ b/test/i965_jpegd_config_test.cpp
@@ -26,6 +26,29 @@
namespace JPEG {
namespace Decode {
+VAStatus ProfileNotSupported()
+{
+ return VA_STATUS_ERROR_UNSUPPORTED_PROFILE;
+}
+
+VAStatus EntrypointNotSupported()
+{
+ return VA_STATUS_ERROR_UNSUPPORTED_ENTRYPOINT;
+}
+
+VAStatus NotSupported()
+{
+ I965TestEnvironment *env(I965TestEnvironment::instance());
+ EXPECT_PTR(env);
+
+ struct i965_driver_data *i965(*env);
+ EXPECT_PTR(i965);
+
+ if (!HAS_JPEG_ENCODING(i965))
+ return ProfileNotSupported();
+
+ return EntrypointNotSupported();
+}
VAStatus HasDecodeSupport()
{
@@ -35,8 +58,10 @@ VAStatus HasDecodeSupport()
struct i965_driver_data *i965(*env);
EXPECT_PTR(i965);
- return HAS_JPEG_DECODING(i965) ? VA_STATUS_SUCCESS :
- VA_STATUS_ERROR_UNSUPPORTED_ENTRYPOINT;
+ if(HAS_JPEG_DECODING(i965))
+ return VA_STATUS_SUCCESS;
+
+ return NotSupported();
}
static const std::vector<ConfigTestInput> inputs = {
diff --git a/test/i965_jpege_config_test.cpp b/test/i965_jpege_config_test.cpp
index 924eccb..eb5931d 100644
--- a/test/i965_jpege_config_test.cpp
+++ b/test/i965_jpege_config_test.cpp
@@ -27,11 +27,30 @@
namespace JPEG {
namespace Encode {
+VAStatus ProfileNotSupported()
+{
+ return VA_STATUS_ERROR_UNSUPPORTED_PROFILE;
+}
+
VAStatus EntrypointNotSupported()
{
return VA_STATUS_ERROR_UNSUPPORTED_ENTRYPOINT;
}
+VAStatus NotSupported()
+{
+ I965TestEnvironment *env(I965TestEnvironment::instance());
+ EXPECT_PTR(env);
+
+ struct i965_driver_data *i965(*env);
+ EXPECT_PTR(i965);
+
+ if (!HAS_JPEG_DECODING(i965))
+ return ProfileNotSupported();
+
+ return EntrypointNotSupported();
+}
+
VAStatus HasEncodeSupport()
{
I965TestEnvironment *env(I965TestEnvironment::instance());
@@ -40,14 +59,16 @@ VAStatus HasEncodeSupport()
struct i965_driver_data *i965(*env);
EXPECT_PTR(i965);
- return HAS_JPEG_ENCODING(i965) ? VA_STATUS_SUCCESS :
- EntrypointNotSupported();
+ if (HAS_JPEG_ENCODING(i965))
+ return VA_STATUS_SUCCESS;
+
+ return NotSupported();
}
static const std::vector<ConfigTestInput> inputs = {
{VAProfileJPEGBaseline, VAEntrypointEncPicture, &HasEncodeSupport},
- {VAProfileJPEGBaseline, VAEntrypointEncSlice, &EntrypointNotSupported},
- {VAProfileJPEGBaseline, VAEntrypointEncSliceLP, &EntrypointNotSupported},
+ {VAProfileJPEGBaseline, VAEntrypointEncSlice, &NotSupported},
+ {VAProfileJPEGBaseline, VAEntrypointEncSliceLP, &NotSupported},
};
INSTANTIATE_TEST_CASE_P(