Discussion:
[PATCH 0/2][libva-intel-driver] report unsupported profile
(too old to reply)
Daniel Charles
2016-10-25 16:18:52 UTC
Permalink
This is a re-send of patch 1/2 and a new patch that modifies the current
unittests to properly test the unsupported profile condition.

As mentioned in the commit messages, UNSUPPORTED_PROFILE will be returned
when a queried profile is not supported by any entrypoint.

If squashing the patches is preferred, let me know and I'll resubmit.

Daniel Charles (2):
i965_validate_config: return unsupported profile
i965_test_config: return properly unsupported profile

src/i965_drv_video.c | 49 +++++++++++++++++++++++++++++++++--------
test/i965_avce_config_test.cpp | 27 ++++++++++++++++-------
test/i965_jpege_config_test.cpp | 17 +++++++-------
3 files changed, 67 insertions(+), 26 deletions(-)
--
2.5.5
Daniel Charles
2016-10-25 16:18:53 UTC
Permalink
When all the profiles are not supported return
VA_STATUS_ERROR_UNSUPPORTED_PROFILE instead of
VA_STATUS_ERROR_UNSUPPORTED_ENTRYPOINT.

Also change the style on the code modified to be common
on all cases

Signed-off-by: Daniel Charles <***@intel.com>
---
src/i965_drv_video.c | 49 ++++++++++++++++++++++++++++++++++++++++---------
1 file changed, 40 insertions(+), 9 deletions(-)

diff --git a/src/i965_drv_video.c b/src/i965_drv_video.c
index 7f2146e..e17c295 100644
--- a/src/i965_drv_video.c
+++ b/src/i965_drv_video.c
@@ -711,6 +711,8 @@ i965_validate_config(VADriverContextP ctx, VAProfile profile,
if ((HAS_MPEG2_DECODING(i965) && entrypoint == VAEntrypointVLD) ||
(HAS_MPEG2_ENCODING(i965) && entrypoint == VAEntrypointEncSlice)) {
va_status = VA_STATUS_SUCCESS;
+ } else if (!HAS_MPEG2_DECODING(i965) && !HAS_MPEG2_ENCODING(i965)){
+ va_status = VA_STATUS_ERROR_UNSUPPORTED_PROFILE;
} else {
va_status = VA_STATUS_ERROR_UNSUPPORTED_ENTRYPOINT;
}
@@ -723,6 +725,9 @@ i965_validate_config(VADriverContextP ctx, VAProfile profile,
(HAS_H264_ENCODING(i965) && entrypoint == VAEntrypointEncSlice) ||
(HAS_LP_H264_ENCODING(i965) && entrypoint == VAEntrypointEncSliceLP)) {
va_status = VA_STATUS_SUCCESS;
+ } else if (!HAS_H264_DECODING(i965) && !HAS_H264_ENCODING(i965) &&
+ !HAS_LP_H264_ENCODING(i965)){
+ va_status = VA_STATUS_ERROR_UNSUPPORTED_PROFILE;
} else {
va_status = VA_STATUS_ERROR_UNSUPPORTED_ENTRYPOINT;
}
@@ -733,6 +738,8 @@ i965_validate_config(VADriverContextP ctx, VAProfile profile,
case VAProfileVC1Advanced:
if (HAS_VC1_DECODING(i965) && entrypoint == VAEntrypointVLD) {
va_status = VA_STATUS_SUCCESS;
+ } else if (!HAS_VC1_DECODING(i965)) {
+ va_status = VA_STATUS_ERROR_UNSUPPORTED_PROFILE;
} else {
va_status = VA_STATUS_ERROR_UNSUPPORTED_ENTRYPOINT;
}
@@ -741,6 +748,8 @@ i965_validate_config(VADriverContextP ctx, VAProfile profile,
case VAProfileNone:
if (HAS_VPP(i965) && VAEntrypointVideoProc == entrypoint) {
va_status = VA_STATUS_SUCCESS;
+ } else if (!HAS_VPP(i965)){
+ va_status = VA_STATUS_ERROR_UNSUPPORTED_PROFILE;
} else {
va_status = VA_STATUS_ERROR_UNSUPPORTED_ENTRYPOINT;
}
@@ -750,6 +759,8 @@ i965_validate_config(VADriverContextP ctx, VAProfile profile,
if ((HAS_JPEG_DECODING(i965) && entrypoint == VAEntrypointVLD) ||
(HAS_JPEG_ENCODING(i965) && entrypoint == VAEntrypointEncPicture)) {
va_status = VA_STATUS_SUCCESS;
+ } else if (!HAS_JPEG_DECODING(i965) && !HAS_JPEG_ENCODING(i965)){
+ va_status = VA_STATUS_ERROR_UNSUPPORTED_PROFILE;
} else {
va_status = VA_STATUS_ERROR_UNSUPPORTED_ENTRYPOINT;
}
@@ -759,6 +770,8 @@ i965_validate_config(VADriverContextP ctx, VAProfile profile,
if ((HAS_VP8_DECODING(i965) && entrypoint == VAEntrypointVLD) ||
(HAS_VP8_ENCODING(i965) && entrypoint == VAEntrypointEncSlice)) {
va_status = VA_STATUS_SUCCESS;
+ } else if (!HAS_VP8_DECODING(i965) && !HAS_VP8_ENCODING(i965)){
+ va_status = VA_STATUS_ERROR_UNSUPPORTED_PROFILE;
} else {
va_status = VA_STATUS_ERROR_UNSUPPORTED_ENTRYPOINT;
}
@@ -768,8 +781,12 @@ i965_validate_config(VADriverContextP ctx, VAProfile profile,
case VAProfileH264StereoHigh:
if ((HAS_H264_MVC_DECODING_PROFILE(i965, profile) &&
entrypoint == VAEntrypointVLD) ||
- (HAS_H264_MVC_ENCODING(i965) && entrypoint == VAEntrypointEncSlice)) {
+ (HAS_H264_MVC_ENCODING(i965) &&
+ entrypoint == VAEntrypointEncSlice)) {
va_status = VA_STATUS_SUCCESS;
+ } else if(!HAS_H264_MVC_DECODING_PROFILE(i965, profile) &&
+ !HAS_H264_MVC_ENCODING(i965)) {
+ va_status = VA_STATUS_ERROR_UNSUPPORTED_PROFILE;
} else {
va_status = VA_STATUS_ERROR_UNSUPPORTED_ENTRYPOINT;
}
@@ -778,32 +795,46 @@ i965_validate_config(VADriverContextP ctx, VAProfile profile,

case VAProfileHEVCMain:
if ((HAS_HEVC_DECODING(i965) && (entrypoint == VAEntrypointVLD))||
- (HAS_HEVC_ENCODING(i965) && (entrypoint == VAEntrypointEncSlice)))
+ (HAS_HEVC_ENCODING(i965) && (entrypoint == VAEntrypointEncSlice))) {
va_status = VA_STATUS_SUCCESS;
- else
+ } else if (!HAS_HEVC_DECODING(i965) && !HAS_HEVC_ENCODING(i965)) {
+ va_status = VA_STATUS_ERROR_UNSUPPORTED_PROFILE;
+ } else {
va_status = VA_STATUS_ERROR_UNSUPPORTED_ENTRYPOINT;
+ }

break;

case VAProfileHEVCMain10:
if ((HAS_HEVC10_DECODING(i965) && (entrypoint == VAEntrypointVLD))||
- (HAS_HEVC10_ENCODING(i965) && (entrypoint == VAEntrypointEncSlice)))
+ (HAS_HEVC10_ENCODING(i965) &&
+ (entrypoint == VAEntrypointEncSlice))) {
va_status = VA_STATUS_SUCCESS;
- else
+ } else if (!HAS_HEVC10_DECODING(i965) && !HAS_HEVC10_ENCODING(i965)) {
+ va_status = VA_STATUS_ERROR_UNSUPPORTED_PROFILE;
+ } else {
va_status = VA_STATUS_ERROR_UNSUPPORTED_ENTRYPOINT;
+ }

break;

case VAProfileVP9Profile0:
case VAProfileVP9Profile2:
- if ((HAS_VP9_DECODING_PROFILE(i965, profile)) && (entrypoint == VAEntrypointVLD))
+ if ((HAS_VP9_DECODING_PROFILE(i965, profile)) &&
+ (entrypoint == VAEntrypointVLD)) {
va_status = VA_STATUS_SUCCESS;
- else if ((HAS_VP9_ENCODING(i965)) && (entrypoint == VAEntrypointEncSlice))
+ } else if ((HAS_VP9_ENCODING(i965)) &&
+ (entrypoint == VAEntrypointEncSlice)) {
va_status = VA_STATUS_SUCCESS;
- else if ((profile == VAProfileVP9Profile0) && i965->wrapper_pdrvctx)
+ } else if (profile == VAProfileVP9Profile0 && i965->wrapper_pdrvctx) {
va_status = VA_STATUS_SUCCESS;
- else
+ } else if(!HAS_VP9_DECODING_PROFILE(i965, profile) &&
+ !HAS_VP9_ENCODING(i965) && !i965->wrapper_pdrvctx) {
+ va_status = VA_STATUS_ERROR_UNSUPPORTED_PROFILE;
+ } else {
va_status = VA_STATUS_ERROR_UNSUPPORTED_ENTRYPOINT;
+ }
+
break;

default:
--
2.5.5
Daniel Charles
2016-10-25 16:18:54 UTC
Permalink
jpege and avce 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 <***@intel.com>
---
test/i965_avce_config_test.cpp | 27 +++++++++++++++++++--------
test/i965_jpege_config_test.cpp | 17 ++++++++---------
2 files changed, 27 insertions(+), 17 deletions(-)

diff --git a/test/i965_avce_config_test.cpp b/test/i965_avce_config_test.cpp
index b30abbc..605c6a7 100644
--- a/test/i965_avce_config_test.cpp
+++ b/test/i965_avce_config_test.cpp
@@ -45,8 +45,13 @@ 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;
+ else if (!HAS_H264_ENCODING(i965) && !HAS_H264_DECODING(i965)
+ && !HAS_LP_H264_ENCODING(i965))
+ return ProfileNotSupported();
+ else
+ return EntrypointNotSupported();
}

VAStatus HasLPEncodeSupport()
@@ -57,11 +62,13 @@ VAStatus HasLPEncodeSupport()
struct i965_driver_data *i965(*env);
EXPECT_PTR(i965);

- if (IS_SKL(i965->intel.device_info))
+ if (HAS_LP_H264_ENCODING(i965))
return VA_STATUS_SUCCESS;
-
- return HAS_LP_H264_ENCODING(i965) ? VA_STATUS_SUCCESS :
- EntrypointNotSupported();
+ else if (!HAS_H264_ENCODING(i965) && !HAS_H264_DECODING(i965)
+ && !HAS_LP_H264_ENCODING(i965))
+ return ProfileNotSupported();
+ else
+ return EntrypointNotSupported();
}

VAStatus HasMVCEncodeSupport()
@@ -72,8 +79,12 @@ 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;
+ else if (!HAS_H264_MVC_ENCODING(i965) && !HAS_H264_MVC_DECODING(i965))
+ return ProfileNotSupported();
+ else
+ return EntrypointNotSupported();
}

static const std::vector<ConfigTestInput> inputs = {
diff --git a/test/i965_jpege_config_test.cpp b/test/i965_jpege_config_test.cpp
index 924eccb..fdf98b6 100644
--- a/test/i965_jpege_config_test.cpp
+++ b/test/i965_jpege_config_test.cpp
@@ -27,11 +27,6 @@
namespace JPEG {
namespace Encode {

-VAStatus EntrypointNotSupported()
-{
- return VA_STATUS_ERROR_UNSUPPORTED_ENTRYPOINT;
-}
-
VAStatus HasEncodeSupport()
{
I965TestEnvironment *env(I965TestEnvironment::instance());
@@ -40,14 +35,18 @@ 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;
+ else if (!HAS_JPEG_ENCODING(i965) && !HAS_JPEG_DECODING(i965))
+ return VA_STATUS_ERROR_UNSUPPORTED_PROFILE;
+ else
+ return VA_STATUS_ERROR_UNSUPPORTED_ENTRYPOINT;
}

static const std::vector<ConfigTestInput> inputs = {
{VAProfileJPEGBaseline, VAEntrypointEncPicture, &HasEncodeSupport},
- {VAProfileJPEGBaseline, VAEntrypointEncSlice, &EntrypointNotSupported},
- {VAProfileJPEGBaseline, VAEntrypointEncSliceLP, &EntrypointNotSupported},
+ {VAProfileJPEGBaseline, VAEntrypointEncSlice, &HasEncodeSupport},
+ {VAProfileJPEGBaseline, VAEntrypointEncSliceLP, &HasEncodeSupport},
};

INSTANTIATE_TEST_CASE_P(
--
2.5.5
Eoff, Ullysses A
2016-10-26 20:46:24 UTC
Permalink
-----Original Message-----
Sent: Tuesday, October 25, 2016 9:19 AM
Subject: [Libva] [PATCH 2/2][libva-intel-driver] i965_test_config: return properly unsupported profile
jpege and avce 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
---
test/i965_avce_config_test.cpp | 27 +++++++++++++++++++--------
test/i965_jpege_config_test.cpp | 17 ++++++++---------
2 files changed, 27 insertions(+), 17 deletions(-)
diff --git a/test/i965_avce_config_test.cpp b/test/i965_avce_config_test.cpp
index b30abbc..605c6a7 100644
--- a/test/i965_avce_config_test.cpp
+++ b/test/i965_avce_config_test.cpp
@@ -45,8 +45,13 @@ VAStatus HasEncodeSupport()
struct i965_driver_data *i965(*env);
EXPECT_PTR(i965);
- EntrypointNotSupported();
+ if (HAS_H264_ENCODING(i965))
+ return VA_STATUS_SUCCESS;
+ else if (!HAS_H264_ENCODING(i965) && !HAS_H264_DECODING(i965)
+ && !HAS_LP_H264_ENCODING(i965))
+ return ProfileNotSupported();
+ else
+ return EntrypointNotSupported();
}
VAStatus HasLPEncodeSupport()
@@ -57,11 +62,13 @@ VAStatus HasLPEncodeSupport()
struct i965_driver_data *i965(*env);
EXPECT_PTR(i965);
- if (IS_SKL(i965->intel.device_info))
+ if (HAS_LP_H264_ENCODING(i965))
Please don't change this line... from the testing perspective, if the HW
is SKL, we want the expectation to be that avce is supported. This is
why we've redefined our own checks for codec support in the test suite
so we can make these types of assumptions. Otherwise, we would've
just used the driver's i965_validate_config instead. Later, we might add
more assumptions like this for other HW.
return VA_STATUS_SUCCESS;
-
- EntrypointNotSupported();
+ else if (!HAS_H264_ENCODING(i965) && !HAS_H264_DECODING(i965)
+ && !HAS_LP_H264_ENCODING(i965))
+ return ProfileNotSupported();
+ else
+ return EntrypointNotSupported();
}
VAStatus HasMVCEncodeSupport()
@@ -72,8 +79,12 @@ VAStatus HasMVCEncodeSupport()
struct i965_driver_data *i965(*env);
EXPECT_PTR(i965);
- EntrypointNotSupported();
+ if (HAS_H264_MVC_ENCODING(i965))
+ return VA_STATUS_SUCCESS;
+ else if (!HAS_H264_MVC_ENCODING(i965) && !HAS_H264_MVC_DECODING(i965))
+ return ProfileNotSupported();
+ else
+ return EntrypointNotSupported();
}
static const std::vector<ConfigTestInput> inputs = {
diff --git a/test/i965_jpege_config_test.cpp b/test/i965_jpege_config_test.cpp
index 924eccb..fdf98b6 100644
--- a/test/i965_jpege_config_test.cpp
+++ b/test/i965_jpege_config_test.cpp
@@ -27,11 +27,6 @@
namespace JPEG {
namespace Encode {
-VAStatus EntrypointNotSupported()
-{
- return VA_STATUS_ERROR_UNSUPPORTED_ENTRYPOINT;
-}
-
VAStatus HasEncodeSupport()
{
I965TestEnvironment *env(I965TestEnvironment::instance());
@@ -40,14 +35,18 @@ VAStatus HasEncodeSupport()
struct i965_driver_data *i965(*env);
EXPECT_PTR(i965);
- EntrypointNotSupported();
+ if (HAS_JPEG_ENCODING(i965))
+ return VA_STATUS_SUCCESS;
+ else if (!HAS_JPEG_ENCODING(i965) && !HAS_JPEG_DECODING(i965))
+ return VA_STATUS_ERROR_UNSUPPORTED_PROFILE;
+ else
+ return VA_STATUS_ERROR_UNSUPPORTED_ENTRYPOINT;
}
static const std::vector<ConfigTestInput> inputs = {
{VAProfileJPEGBaseline, VAEntrypointEncPicture, &HasEncodeSupport},
- {VAProfileJPEGBaseline, VAEntrypointEncSlice, &EntrypointNotSupported},
- {VAProfileJPEGBaseline, VAEntrypointEncSliceLP, &EntrypointNotSupported},
+ {VAProfileJPEGBaseline, VAEntrypointEncSlice, &HasEncodeSupport},
+ {VAProfileJPEGBaseline, VAEntrypointEncSliceLP, &HasEncodeSupport},
};
INSTANTIATE_TEST_CASE_P(
--
2.5.5
_______________________________________________
Libva mailing list
https://lists.freedesktop.org/mailman/listinfo/libva
Loading...