Commit Graph

166 Commits

Author SHA1 Message Date
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
U. Artie Eoff 7123066703 test/data: add rate control and decode slice mode values
Add definitions for valid VA rate controls and decode
slice mode values that can be used by test cases.

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
2018-01-22 09:43:28 -08:00
U. Artie Eoff c17bbc0820 test/fixture: consolidate config methods
Define 4 new config methods that provide the functionality
of the existing 11 similar methods.  The usage of the existing
methods will be replaced by the new methods in successive
commits.

These new methods will also give control back to the test
cases to handle config attributes depending on need/use-case
and reduce the number fixture member variables needed.

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
2018-01-22 09:43:28 -08:00
U. Artie Eoff ebe0e519d5 test/data: use g_ prefix for global vars, not m_
The m_ prefix for a variable indicates it's a member
variable.  The g_ prefix indicates it's a global variable.

Use the correct prefix in test_data.h for global variables
and update usage accordingly.

Also, cleanup test_data.h formatting.

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
2018-01-22 09:43:28 -08:00
U. Artie Eoff 71abeb23a5 test/data: add new VA_RT_FORMAT_RGB32_BPP
The list was missing the recently added
VA_RT_FORMAT_RGB32_BPP format.  So add it.

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
2018-01-22 09:43:28 -08:00
Jayesh Kumar Tank 7b85ff442d test/query_config: cleanup test cases
Use const and references appropriately.

Streamline logic, variable names and code formatting

Signed-off-by: Jayesh Kumar Tank <jayesh.kumarx.tank@intel.com>
2018-01-12 08:35:10 +08:00
Jayesh Kumar Tank 712ed54a8e test/queryvendor: cleanup test cases
Streamline logic and code formatting.

Signed-off-by: Jayesh Kumar Tank <jayesh.kumarx.tank@intel.com>
2018-01-12 08:35:10 +08:00
U. Artie Eoff 7a08da06dd test/init_terminate: cleanup test cases
Streamline logic, variable names and code formatting

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
2018-01-12 08:35:10 +08:00
U. Artie Eoff 39e9331fbe test/get_max_values: cleanup test cases
Streamline logic and code formatting.

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
2018-01-12 08:35:10 +08:00
U. Artie Eoff 79e14c92ed test/get_create_config: cleanup test cases
Use const and references appropriately.

Streamline logic, variable names and code formatting

Also remove useless test.

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
2018-01-12 08:35:10 +08:00
U. Artie Eoff d7ccf14a33 test/display_attribs: cleanup test cases
Use const and references appropriately.

Streamline logic, variable names and code formatting.

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
2018-01-12 08:35:10 +08:00
U. Artie Eoff 75a94e7fec test/createsurfaces: cleanup test cases
Use const and references appropriately.

Streamline logic, variable names and code formatting.

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
2018-01-12 08:35:10 +08:00
U. Artie Eoff 91f13b3deb test/createcontext: cleanup test cases
Use const and references appropriately.

Streamline logic, variable names and code formatting.

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
2018-01-12 08:35:10 +08:00
U. Artie Eoff 1c9d266188 test/createbuffer: cleanup test cases
Use const and references appropriately.

Streamline logic, variable names and code formatting.

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
2018-01-12 08:35:10 +08:00
U. Artie Eoff 62028d2bac test/config_attribs: cleanup test cases
Use const and references appropriately.

Streamline logic, variable names and code formatting.

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
2018-01-12 08:35:10 +08:00
U. Artie Eoff c0ab3b99fc test/fixture: const and var reference corrections
Various const corrections for member functions/params and
pass-by-ref instead of pass-by-val.

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
2018-01-12 08:35:10 +08:00
U. Artie Eoff ff0d21efcd test: use common typedefs
Use the new typedefs in tests.

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
2018-01-12 08:35:10 +08:00
U. Artie Eoff 27e027ff5f test: add some common typedefs
Add typedefs for some commonly used data types.

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
2018-01-12 08:35:10 +08:00
U. Artie Eoff a95be999a7 test: remove local va_version.h.in
The locally generated va_version.h was erroneous and
not even being used in the tests.  This is because
va/va.h already includes the "real" va/va_version.h.

Thus, remove local va_version.h.in.

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
2018-01-12 08:35:10 +08:00
U. Artie Eoff 57bd8dbe97 test/fixture: remove shadow variable
m_querySurfaceAttribList was redefined in
doQuerySurfacesWithConfigAttribs which shadows the member
variable of the same name.  Removing the redefinition does
not break tests, so remove it.

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
2018-01-12 08:35:10 +08:00
Jun Zhao 9cf3c47d92 decode/loadjpeg: Add return value check for fread.
Check the return value to fix build warning.

Signed-off-by: Jun Zhao <jun.zhao@intel.com>
2018-01-11 08:34:21 +08:00
Xiang, Haihao aa563e23a6 vp9enc: set a reasonable bitrate for VBR when the max bitrate isn't specified
Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
2018-01-09 16:19:53 +08:00
Xiang, Haihao 6da04bc3eb vp9enc: Add an option to specify whether low power mode is used
--low_power <mode>>
0: Normal mode
1: Low power mode
others: Auto mode

Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
2018-01-09 16:19:53 +08:00
Xiang, Haihao b9d60da862 vp9enc: try low power mode if non-low power mode isn't supported
Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
2018-01-09 16:19:53 +08:00
U. Artie Eoff dbdcc10a62 test/createcontext: check min surface resolution
The minimum surface resolution needs to be considered
when creating a context in CreateContext test.

Fixes #83

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
2018-01-05 08:41:33 -08:00
U. Artie Eoff e6a5bc0f2f test/fixture: add doGetMinSurfaceResolution
Add method to get minimum allowed surface resolution.
If driver does not specify, then assume 1x1 is min.

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
2018-01-05 08:41:33 -08:00
U. Artie Eoff dfc6ff4d29 test/fixture: set default max surface resolution
If driver does not specify the max surface resolution,
then assume "any" max is allowed (up to numeric_limits).

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
2018-01-05 08:41:33 -08:00
U. Artie Eoff 2db00b120f test: use Resolution struct instead of std::pair
Use the a Resolution object in tests.

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
2018-01-05 08:41:33 -08:00
U. Artie Eoff f0a5963ab9 test/internal: add interal test for Resolution definition
Add test_internal.cpp to test Resolution logic.

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
2018-01-05 08:41:33 -08:00
U. Artie Eoff 9973b64985 test/utils: define Resolution structure
Add test_utils header with Resolution structure definition
for use in tests.

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
2018-01-05 08:41:33 -08:00
U. Artie Eoff 0c43cd0418 test: fix header guards
Ensure all test headers have a header guard and that
each guard is unique.

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
2018-01-02 11:20:10 -08:00
U. Artie Eoff b1f2c831d3 test/VAAPIQueryVendor: combine .h and .cpp contents
The header is only needed in one compilation unit.
Thus, move it's contents to the compilation unit to
reduce unnecessary complexity and maintenance.

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
2018-01-02 11:19:31 -08:00
U. Artie Eoff bf6d91af63 test/VAAPIQueryConfig: combine .h and .cpp contents
The header is only needed in one compilation unit.
Thus, move it's contents to the compilation unit to
reduce unnecessary complexity and maintenance.

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
2018-01-02 11:19:31 -08:00
U. Artie Eoff ea2e00239c test/VAAPIInitTerminate: combine .h and .cpp contents
The header is only needed in one compilation unit.
Thus, move it's contents to the compilation unit to
reduce unnecessary complexity and maintenance.

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
2018-01-02 11:19:31 -08:00
U. Artie Eoff e2b5fecb57 test/VAAPIGetMaxValues: combine .h and .cpp contents
The header is only needed in one compilation unit.
Thus, move its contents to the compilation unit to
reduce unnecessary complexity and maintenance.

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
2018-01-02 11:19:31 -08:00
U. Artie Eoff fd34b321f1 test/VAAPIDisplayAttribs: combine .h and .cpp contents
The header is only needed in one compilation unit.
Thus, move its contents to the compilation unit to
reduce unnecessary complexity and maintenance.

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
2018-01-02 11:19:31 -08:00
U. Artie Eoff 090bd84a5b test/VAAPICreateBuffer: combine .h and .cpp contents
The header is only needed in one compilation unit.
Thus, move its contents to the compilation unit to
reduce unnecessary complexity and maintenance.

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
2018-01-02 11:19:31 -08:00
U. Artie Eoff 4c5e42aeb3 test/VAAPICreateContext: combine .h and .cpp contents
The header is only needed in one compilation unit.
Thus, move its contents to the compilation unit to
reduce unnecessary complexity and maintenance.

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
2018-01-02 11:19:31 -08:00
U. Artie Eoff 8fe96acd56 test/VAAPIQuery/CreateSurfaces: combine .h and .cpp contents
The header is only needed in one compilation unit.
Thus, move its contents to the compilation unit to
reduce unnecessary complexity and maintenance.

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
2018-01-02 11:19:31 -08:00
U. Artie Eoff 380cb1e45a test/VAAPIConfigAttribs: combine .h and .cpp contents
The header is only needed in one compilation unit.
Thus, move its contents to the compilation unit to
reduce unnecessary complexity and maintenance.

Also remove unused function declaration and unused
member variables.

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
2018-01-02 11:19:31 -08:00
U. Artie Eoff cce43a4f1c test/VAAPIGetCreateConfig: combine .h and .cpp contents
The header is only needed in one compilation unit.
Thus, move its contents to the compilation unit to
reduce unnecessary complexity and maintenance.

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
2018-01-02 11:19:31 -08:00
Xiang, Haihao 7b4827ed5e vavpp: read / write RGB32 surface
Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
2017-12-19 12:30:08 -08:00
Victor Toso 61a21b9149 test: Fix leak on getDisplay test
880 (360 direct, 520 indirect) bytes in 1 blocks are definitely lost in loss record 12 of 15
   at 0x4C2EF35: calloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
   by 0x503FED9: va_newDisplayContext (in /usr/lib/libva.so.2.0.0)
   by 0x4E39F32: vaGetDisplayDRM (in /usr/lib/libva-drm.so.2.0.0)
   by 0x11ADD1: VAAPI::VAAPIFixture::getDisplay() (test_va_api_fixture.cpp:80)
   by 0x11AE2E: VAAPI::VAAPIFixture_getDisplay_Test::TestBody() (test_va_api_fixture.cpp:527)

Signed-off-by: Victor Toso <victortoso@redhat.com>
2017-12-19 10:30:02 -08:00
Victor Toso 3c45590f61 test: Fix leak on bad vaSetDriverName() test
880 (480 direct, 400 indirect) bytes in 1 blocks are definitely lost in loss
record 13 of 15
   at 0x4C2EF35: calloc
   by 0x503FF12: va_newDriverContext (in /usr/lib/libva.so.2.0.0)
   by 0x4E39F63: vaGetDisplayDRM (in /usr/lib/libva-drm.so.2.0.0)
   by 0x11ADD1: VAAPI::VAAPIFixture::getDisplay() (test_va_api_fixture.cpp:80)
   by 0x15133E: VAAPI::VAAPIInitTerminate_vaInitialize_vaTerminate_Bad_vaSetDriverName_Test::TestBody()

Signed-off-by: Victor Toso <victortoso@redhat.com>
2017-12-19 10:30:02 -08:00
Victor Toso a2cc4901a0 wayland: Fix small leak of wl_registry on VADisplay
The struct wl_registry is created with wl_proxy_marshal_constructor()
while calling wl_display_get_registry() and must be freed wtih
wl_proxy_destroy() by calling wl_registry_destroy().

72 bytes in 1 blocks are definitely lost in loss record 6 of 10
   at 0x4C2EF35: calloc (in vgpreload_memcheck-amd64-linux.so)
   by 0x5FD7503: ??? (in libwayland-client.so.0.3.0)
   by 0x5FD7A26: wl_proxy_marshal_array_constructor_versioned
   by 0x5FD7D7B: wl_proxy_marshal_constructor
   by 0x10B096: wl_display_get_registry (wayland-client-protocol.h:966)
   by 0x10AD72: va_open_display_wayland (va_display_wayland.c:91)
   by 0x10A43B: va_open_display (va_display.c:154)
   by 0x109B0A: main (vainfo.c:107)

Signed-off-by: Victor Toso <victortoso@redhat.com>
2017-12-19 10:30:02 -08:00
U. Artie Eoff f007a4fed6 test: improve create_buffer test logging
Split each buffer type into it's own test and
make the test params streamable so that test logs
are more useful.

Before:

  CreateBufferWithOutData/0  # GetParam() = 32-byte object <...
  ...

After:

  CreateBufferWithOutData/0  # GetParam() =
   0:VAProfileMPEG2Simple,1:VAEntrypointVLD,
   0:VAPictureParameterBufferType
  ...

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
2017-12-18 12:27:44 -08:00