Commit Graph

112 Commits

Author SHA1 Message Date
Carl Zhang 87fed9002a add version check for VAProfileH264High10
Signed-off-by: Carl Zhang <carl.zhang@intel.com>
2023-03-17 16:14:43 +08:00
jianfeng.zheng ea1d866ef8 test: add VAProfileH264High10
see https://github.com/intel/libva/pull/664

Signed-off-by: jianfeng.zheng <jianfeng.zheng@mthreads.com>
2023-03-17 14:31:31 +08:00
Sil Vilerino ab82f899de win32 compat: Fix setenv/unsetenv return values
The return values did not match the calls to the delegated
functions.

Signed-off-by: Sil Vilerino <sivileri@microsoft.com>
2023-02-15 06:48:45 -08:00
Brian Norris ecd26b3910 test_va_api: Don't assume our DRM node is first
Similar to:

  bfb6b98ed6 exclude vgem node and invalid drm node in vainfo

But adapted to use drmGetDevices2() for more generic handling.

It's possible to have a vgem node at 128, and the VA-API node is at 129,
for example.

Signed-off-by: Brian Norris <briannorris@chromium.org>
2023-02-03 13:50:26 +08:00
Himanshu Nayak c0ed286c0c test/test_va_api_query_config: Changed default initialization value to VAProfileNone
In Vaapi unit test VAAPIQueryConfig, CheckEntrypointsForProfile
the default initialization value chnaged from zero to VAProfileNone
as zero is a valid profile matches with MPEG2Simple and this unit
test misinterpret it as part of return value from vaQueryConfigProfiles

Signed-off-by: Himanshu Nayak <himanshu.nayak@amd.corp-partner.google.com>
2022-11-29 13:04:45 -05:00
Sil Vilerino b587966f8d tests: enable building on Windows
Signed-off-by: Sil Vilerino <sivileri@microsoft.com>
2022-10-23 21:39:00 +08:00
Sil Vilerino 5add628b52 tests: Remove C++20 constructs in tests project targetting C++11
Signed-off-by: Sil Vilerino <sivileri@microsoft.com>
2022-10-23 21:39:00 +08:00
Sil Vilerino 5050d6043f tests: remove non C++ standard constructs
Signed-off-by: Sil Vilerino <sivileri@microsoft.com>
2022-10-23 21:39:00 +08:00
Emma Anholt be95c6b1f0 Use the static test fixture to speed up CreateSurfaces tests.
Reduces test runtime on my radeonsi system by 20%.  Likely a lot of
the improvement here is from being able to userspace recycle the BOs
that are being allocated.

Fixes: #247
2021-11-02 11:26:08 -07:00
Emma Anholt f612385f74 Use a static test fixture to try to speed up some query tests.
I don't love the way I have the fixture usage brought in, and maybe
this should be a subclass or something to get this behavior.  I'm not
great at C++, though.
2021-11-02 11:26:08 -07:00
Emma Anholt 15df97250c Update to googletest 1.11.0.
This is commit e2239ee6043f73722e7aa812a459f54a28552929 from git.
This brings in SetUpTestSuite support.  Note that it required a few
minor updates to the tests mostly to quiet deprecation warnings, and
also to include a header we need that used to be brought in by gtest.
2021-11-02 11:26:08 -07:00
Carl Zhang 42dd2b216e unify the code styles using the style_unify script
use astyle to unify the code style
copy the style_unify script from
https://github.com/intel/libva/blob/master/style_unify

Signed-off-by: Carl Zhang <carl.zhang@intel.com>
2021-09-29 20:59:40 -04:00
Carl Zhang a09593a7d8 remove version check for test vaInitialize_vaTerminate
it is used to fix such issue, version from libva-utils and libva is different.
because older libva-utils should also work with newer libva.

Signed-off-by: Carl Zhang <carl.zhang@intel.com>
2021-06-21 15:09:13 +08:00
Ryan T Huang 5c7c51d49e Enable new caps for VAConfigAttribEncryption 2021-02-19 13:18:46 +08:00
Shawn Li 9b7ab47e87 Enable new caps for rate control
Signed-off-by: Shawn Li <shawn.li@intel.com>
2020-12-14 09:16:14 +08:00
U. Artie Eoff f5a83e630e test: cast VA_STATUS_ERROR_UNKNOWN to VAStatus type
This fixes a GCC 10.0.1 compiler error for the
VA_STATUS_ERROR_UNKNOWN 0xFFFFFFFF conversion from
unsigned to int.

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
2020-05-13 09:45:10 -07:00
U. Artie Eoff 5220b01a7e test/fixture: fix GCC 10.0.1 error with drmDevicePaths
drmDevicePaths is static/constant and only used in one
method (getDisplay).  Thus, it is unnecessary to declare
it as a member variable.  Instead, just declare and
initialize in getDisplay and use proper C++ semantics.

This also fixes a GCC 10.0.1 error due to improper
C++11 constructor list-initialization syntax:

  error: list-initialize for non-class type must not
         be parenthesized.

Fixes #191

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
2020-05-13 09:45:10 -07:00
shawnli2 bbe6788f0a Add 10/12bit RT format check
Fix VaCreatconfig attribute check fail issue caused by missing some 10/12bit RT format

Signed-off-by: Shawn Li <shawn.li@intel.com>
2020-04-01 21:25:15 +08:00
U. Artie Eoff ab0806b440 test/createsurfaces: add some scoped traces
Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
2019-12-13 21:01:36 +08:00
U. Artie Eoff 641735b586 test/streamable: add VAConfigAttrib and VASurfaceAttrib
Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
2019-12-13 21:01:36 +08:00
shawnli2 0e012b1794 Align libva attribute check
Fix VaCreatconfig attribute check fail issue caused by missing two ratecontrol bitmasks.

Signed-off-by: Shawn Li shawn.li@intel.com
2019-12-03 10:00:25 +08:00
U. Artie Eoff a236e34e64 test: update vaInitialize_vaTerminate_Bad_vaSetDriverName
Since intel/libva#250, driver names are no longer restricted
to a whitelist.  Thus, any driver name is legal except for
a few corner cases (i.e. empty name and name > 255 chars).

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
2019-05-08 20:47:02 +08:00
U. Artie Eoff 8a6ef9ed90 test: remove i965 driver specific cases
Conformance tests should be as generic as possible and
not assume availability of any specific driver.

Fixes #93
Fixes #94
Fixes #95

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
2018-05-30 11:18:10 -07:00
Lionel Landwerlin 5b10b33025 add meson build
v2: remove gtest meson file

v3: install binaries
    respect disabled libraries
    apply cpp_args to all test files
    add full version

v4: define HAVE_* macros

v5: Downgrade meson requirement to 0.42.0
2018-03-21 08:34:47 +08:00
U. Artie Eoff bdc5f94758 test/get_create_config: test for packed headers special case
Driver should allow 0x0 (i.e. VA_ENC_PACKED_HEADER_NONE) value
for the VAConfigAttribEncPackedHeaders attribute during
vaCreateConfig when the attribute is supported.

This test supercedes intel/intel-vaapi-driver#361

Also see intel/intel-vaapi-driver#358 and intel/libva#178

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
2018-03-19 09:47:02 +08:00
U. Artie Eoff 46226d7722 test: abort test if vaapi initialization fails
If doInitialize() fails, then abort the test early to
avoid segmentation faults.

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
2018-01-30 11:09:42 -08:00
U. Artie Eoff a2eb0525a1 test/display_attribs: handle unimplemented display attribs
Drivers aren't required to implement display attribute
support.  Thus, handle and validate paths where this
is the case.

Fixes #96

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
2018-01-30 11:09:42 -08:00
U. Artie Eoff 3356f4178c test: refactor skip test semantics
Allow custom skip test message.

Basic checks to determine whether a test should be
skipped could fail (e.g. query profiles/entrypoints
to determine if test should be skipped).  Thus, don't
log test as skipped if there are any failures before
the test fixture destructs.

Fixes #99

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
2018-01-30 11:09:42 -08:00
U. Artie Eoff 3dd134f678 test/createbuffer: fix bugs in createbuffer tests
vaCreateBuffer needs the sizeof the actual buffer
data structure associated with the buffer type, which
could be profile specific.

Previous test logic was passing the sizeof the
buffer "type" enum, which is wrong.

Fix the tests so that the correct buffer size is
calculated based on profile specific buffer types.

Several buffer types were removed from the previous test
parameters since their size may be application specific,
arbitrary, and/or require additional setup beyond the
capabilities of the current buffer test cases.  These
rules will need to be fleshed-out and tests for them
added later on.

Fixes #89

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
2018-01-30 11:09:42 -08:00
U. Artie Eoff c372f8bcfe test/data: define separate profile lists per codec
Add definitions to group together common profiles
based on codec.

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
2018-01-30 11:09:42 -08:00
U. Artie Eoff e55d151580 test/fixture: remove legacy profile/entrypoint methods
No more tests are using the legacy profile/entrypoint
methods.  So remove them.

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
2018-01-29 13:35:50 +08:00
U. Artie Eoff 92b640059e test/get_create_config: use new profile/entrypoint fixture methods
Use new profile/entrypoint fixture methods and refactor
to simplify logic.

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
2018-01-29 13:35:50 +08:00
U. Artie Eoff c3364439d6 test/createsurfaces: use new profile/entrypoint fixture methods
Use new profile/entrypoint fixture methods and refactor
to simplify logic.

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
2018-01-29 13:35:50 +08:00
U. Artie Eoff 558055cf0d test/createcontext: use new profile/entrypoint fixture methods
Use new profile/entrypoint fixture methods and refactor
to simplify logic.

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
2018-01-29 13:35:50 +08:00
U. Artie Eoff b489e134ef test/createbuffer: use new profile/entrypoint fixture methods
Use new profile/entrypoint fixture methods and refactor
to simplify logic.

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
2018-01-29 13:35:50 +08:00
U. Artie Eoff ef9b0c8ba5 test/config_attribs: use new profile/entrypoint fixture methods
Use new profile/entrypoint fixture methods and refactor
to simplify logic.

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
2018-01-29 13:35:50 +08:00
U. Artie Eoff b570a28ea4 test/fixture: remove doGetMaxNumConfigAttribs
The result of doGetMaxNumConfigAttribs is only needed
by queryConfigAttributes.  Thus, just call
vaMaxNumConfigAttributes in queryConfigAttributes when
necessary (it should have low call overhead).  This
also removes the need to use a member state variable.

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
2018-01-29 13:35:50 +08:00
U. Artie Eoff 15fb08bd93 test/fixture: add new profile/entrypoint methods
Existing profile/entrypoint methods require too
much state overhead in the fixture and force tests
to make multiple calls to different methods to get
the information they need.  Thus, add new methods
for profile/entrypoint queries so tests can regain
more control and simplicity.  These new methods
also do not require member variables to operate.

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
2018-01-29 13:35:50 +08:00
Pengfei Qu be2cdc7b35 fix the regression of unit test
this add the minium resolution check in the unit test

Signed-off-by: Pengfei Qu <Pengfei.Qu@intel.com>
2018-01-23 09:22:53 -08:00
U. Artie Eoff 7eab433e0e test/data: define more bitmask data for config attributes
Define valid bitmasks for remaining read/write config
attributes...

  VAConfigAttribEncPackedHeaders
  VAConfigAttribEncInterlaced
  VAConfigAttribFEIFunctionType

This will ensure VAAPIGetCreateConfig/CreateConfigWithAttributes
test cases only use one bitmask for each supported value when
calling vaCreateConfig for these bitfield config attributes.

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
2018-01-22 09:43:28 -08:00
U. Artie Eoff 3185565776 test/fixture: remove legacy config and surface methods
These fixture methods have been replaced with consolidated
and more flexible methods and are no longer used.

Also, remove associated legacy member variables.

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
2018-01-22 09:43:28 -08:00
U. Artie Eoff 258f28b122 test/createcontext: use new getMinMaxSurfaceResolution method
The min/max resolution query was consolidated in the fixture.

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
2018-01-22 09:43:28 -08:00
U. Artie Eoff db37306549 test/createsurfaces: refactor and fix test bugs
Take into account bitfield attributes when creating
config and surfaces.

Use new fixture methods for greater control in test
cases.

Fixes #91
Fixes #92

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
2018-01-22 09:43:28 -08:00
U. Artie Eoff 8233c42170 test/data: define bitmask data for surface attributes
Add definitions for the VASurfaceAttribMemoryType bitmask
surface attribute.

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
2018-01-22 09:43:28 -08:00
U. Artie Eoff dfec7ba7d9 test/fixture: consolidate surface methods
Consolidate surface methods with refactored logic to allow
tests to take more control of parameters.  Also, the
existing doCreateSurfaces suffers from a surface format
logic bug.  The new consolidated createSurfaces does not
suffer from this bug.

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
2018-01-22 09:43:28 -08:00
U. Artie Eoff cde70e171e test/get_create_config: fix test cases
Use the new config methods from fixture.

Also, properly handle config attributes that use bitfields.
That is, some attributes require only one bitmask/value
for vaCreateConfig, therefore we cannot directly use
the attribute returned from vaGetConfigAttributes since
those bitfield attributes will return a bitfield value with
"all" OR'd supported bitmask choices.

Fixes #86

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
2018-01-22 09:43:28 -08:00
U. Artie Eoff d663ed8a0f test/data: define config attribute BitMask map
Add typedef for BitMasks and define a config attrib map
for specific bit mask values.

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
2018-01-22 09:43:28 -08:00
U. Artie Eoff eb91e3ca70 test/createcontext: use new fixture config methods
Use the new config methods from the test fixture.

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
2018-01-22 09:43:28 -08:00
U. Artie Eoff 4dc43077ef test/create_buffer: use new fixture config methods
Use the new config methods in the test fixture and
refactor some variables.

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
2018-01-22 09:43:28 -08:00
U. Artie Eoff b66e14ff98 test/config_attribs: use new fixture config methods
Use the new config methods in the test fixture and
validate bitfield config attributes.

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
2018-01-22 09:43:28 -08:00