2 * Copyright (C) 2016 Intel Corporation. All Rights Reserved.
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the
6 * "Software"), to deal in the Software without restriction, including
7 * without limitation the rights to use, copy, modify, merge, publish,
8 * distribute, sub license, and/or sell copies of the Software, and to
9 * permit persons to whom the Software is furnished to do so, subject to
10 * the following conditions:
12 * The above copyright notice and this permission notice (including the
13 * next paragraph) shall be included in all copies or substantial portions
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
17 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
19 * IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
20 * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
21 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25 #include "i965_config_test.h"
30 VAStatus ProfileNotSupported()
32 return VA_STATUS_ERROR_UNSUPPORTED_PROFILE;
35 VAStatus EntrypointNotSupported()
37 return VA_STATUS_ERROR_UNSUPPORTED_ENTRYPOINT;
40 //H264*NotSupported functions report properly if profile is not supported or
41 //only entrypoint is not supported
42 VAStatus H264NotSupported()
44 I965TestEnvironment *env(I965TestEnvironment::instance());
47 struct i965_driver_data *i965(*env);
50 if (!HAS_H264_DECODING(i965)
51 && !HAS_LP_H264_ENCODING(i965))
52 return ProfileNotSupported();
54 return EntrypointNotSupported();
57 VAStatus H264LPNotSupported()
59 I965TestEnvironment *env(I965TestEnvironment::instance());
62 struct i965_driver_data *i965(*env);
65 if (!HAS_H264_DECODING(i965)
66 && !HAS_H264_ENCODING(i965))
67 return ProfileNotSupported();
69 return EntrypointNotSupported();
72 VAStatus H264MVCNotSupported()
74 I965TestEnvironment *env(I965TestEnvironment::instance());
77 struct i965_driver_data *i965(*env);
80 if (!HAS_H264_MVC_DECODING(i965))
81 return ProfileNotSupported();
83 return EntrypointNotSupported();
86 VAStatus HasEncodeSupport()
88 I965TestEnvironment *env(I965TestEnvironment::instance());
91 struct i965_driver_data *i965(*env);
94 if (HAS_H264_ENCODING(i965))
95 return VA_STATUS_SUCCESS;
97 return H264NotSupported();
100 VAStatus HasLPEncodeSupport()
102 I965TestEnvironment *env(I965TestEnvironment::instance());
105 struct i965_driver_data *i965(*env);
108 if (IS_SKL(i965->intel.device_info))
109 return VA_STATUS_SUCCESS;
111 if (HAS_LP_H264_ENCODING(i965))
112 return VA_STATUS_SUCCESS;
114 return H264LPNotSupported();
117 VAStatus HasMVCEncodeSupport()
119 I965TestEnvironment *env(I965TestEnvironment::instance());
122 struct i965_driver_data *i965(*env);
125 if (HAS_H264_MVC_ENCODING(i965))
126 return VA_STATUS_SUCCESS;
128 return H264MVCNotSupported();
131 static const std::vector<ConfigTestInput> inputs = {
132 {VAProfileH264Baseline, VAEntrypointEncSlice, &ProfileNotSupported},
133 {VAProfileH264Baseline, VAEntrypointEncSliceLP, &ProfileNotSupported},
134 {VAProfileH264Baseline, VAEntrypointEncPicture, &ProfileNotSupported},
136 {VAProfileH264ConstrainedBaseline, VAEntrypointEncSlice, &HasEncodeSupport},
137 {VAProfileH264ConstrainedBaseline, VAEntrypointEncSliceLP, &HasLPEncodeSupport},
138 {VAProfileH264ConstrainedBaseline, VAEntrypointEncPicture, &H264NotSupported},
140 {VAProfileH264Main, VAEntrypointEncSlice, &HasEncodeSupport},
141 {VAProfileH264Main, VAEntrypointEncSliceLP, &HasLPEncodeSupport},
142 {VAProfileH264Main, VAEntrypointEncPicture, &H264NotSupported},
144 {VAProfileH264High, VAEntrypointEncSlice, &HasEncodeSupport},
145 {VAProfileH264High, VAEntrypointEncSliceLP, &HasLPEncodeSupport},
146 {VAProfileH264High, VAEntrypointEncPicture, &H264NotSupported},
148 {VAProfileH264MultiviewHigh, VAEntrypointEncSlice, &HasMVCEncodeSupport},
149 {VAProfileH264MultiviewHigh, VAEntrypointEncSliceLP, &H264MVCNotSupported},
150 {VAProfileH264MultiviewHigh, VAEntrypointEncPicture, &H264MVCNotSupported},
152 {VAProfileH264StereoHigh, VAEntrypointEncSlice, &HasMVCEncodeSupport},
153 {VAProfileH264StereoHigh, VAEntrypointEncSliceLP, &H264MVCNotSupported},
154 {VAProfileH264StereoHigh, VAEntrypointEncPicture, &H264MVCNotSupported},
157 INSTANTIATE_TEST_CASE_P(
158 AVCEncode, I965ConfigTest, ::testing::ValuesIn(inputs));
160 } // namespace Encode