From 55a538c80e0428e9837a6d4bf11a1539541a0aad Mon Sep 17 00:00:00 2001 From: Daniel Charles Date: Thu, 10 Nov 2016 15:08:20 -0800 Subject: 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 Reviewed-by: U. Artie Eoff --- test/i965_avcd_config_test.cpp | 71 +++++++++++++++++++++++++++++-------- test/i965_avce_config_test.cpp | 78 ++++++++++++++++++++++++++++++++++------- test/i965_jpegd_config_test.cpp | 29 +++++++++++++-- test/i965_jpege_config_test.cpp | 29 ++++++++++++--- 4 files changed, 174 insertions(+), 33 deletions(-) diff --git a/test/i965_avcd_config_test.cpp b/test/i965_avcd_config_test.cpp index 851e86e8..8bc5e3cc 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 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 b30abbc3..4830af9d 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 inputs = { @@ -83,23 +135,23 @@ static const std::vector 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 4e2216ce..371b8278 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 inputs = { diff --git a/test/i965_jpege_config_test.cpp b/test/i965_jpege_config_test.cpp index 924eccb4..eb5931d1 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 inputs = { {VAProfileJPEGBaseline, VAEntrypointEncPicture, &HasEncodeSupport}, - {VAProfileJPEGBaseline, VAEntrypointEncSlice, &EntrypointNotSupported}, - {VAProfileJPEGBaseline, VAEntrypointEncSliceLP, &EntrypointNotSupported}, + {VAProfileJPEGBaseline, VAEntrypointEncSlice, &NotSupported}, + {VAProfileJPEGBaseline, VAEntrypointEncSliceLP, &NotSupported}, }; INSTANTIATE_TEST_CASE_P( -- cgit v1.2.1