summaryrefslogtreecommitdiff
path: root/tests/util
AgeCommit message (Collapse)AuthorFilesLines
2016-11-07util: Remove duplicate assignment.Vinson Lee1-1/+1
Fix Coverity evaluation order violation defect. CID: 1374296 Fixes: e0048f4940f7 ("util: Add piglit_delay_ns() api") Signed-off-by: Vinson Lee <vlee@freedesktop.org> Reviewed-by: Brian Paul <brianp@vmware.com>
2016-11-04util: Include time.h on all platforms.Vinson Lee1-1/+1
Fix MinGW build error. piglit-util.c: In function 'piglit_time_is_monotonic': piglit-util.c:583:18: error: storage size of 't' isn't known struct timespec t; ^ Fixes: e0048f4940f7 ("util: Add piglit_delay_ns() api") Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98486 Signed-off-by: Vinson Lee <vlee@freedesktop.org> Reviewed-by: Brian Paul <brianp@vmware.com> Tested-by: Brian Paul <brianp@vmware.com>
2016-10-27util: Add piglit_delay_ns() apiRobert Bragg2-4/+40
Provides a utility for blocking the cpu for a requested time (best effort) and returning the actual duration blocked. This should e.g. be useful for comparing durations measured via arb timer queries vs a monotonic system clock, where it's acceptable if we don't achieve an exact reference delay on the cpu (say due to OS signalling or scheduling conditions) so long as we get told accurately how long the final delay ended up being. Signed-off-by: Robert Bragg <robert@sixbynine.org> Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2016-10-19egl_mesa_platform_surfaceless: Fix build against old EGL headers (v2)Chad Versace1-0/+10
The test required unreleased EGL headers. Oops. Add the needed header extension snippets to piglit-util-egl.h. v2: Move #define snippets to piglit-util-egl.h. Reported-by: Ilia Mirkin <imirkin@alum.mit.edu> Tested-by: Ilia Mirkin <imirkin@alum.mit.edu> (v1) Reported-by: Mark Janes <mark.a.janes@intel.com>
2016-10-18util: Parse -h|--help in piglit_parse_subtest_args()Chad Versace1-1/+19
If the args contain -h or --help, then print some help and exit. The help test describes how to list and run subtests. Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2016-10-18util: Link to gbm if gbm is usedChad Versace1-0/+3
If PIGLIT_HAS_GBM, then add GBM_LDFLAGS to the linker flags. Fixes undefined symbol errors at link time for me, using Arch Linux. Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2016-10-18piglit-util-gl: add piglit_quads_textureNicolai Hähnle2-22/+86
Like checkerboard, but allows specifying different colors for each quadrant of a 2x2 tile block; basically a superset of the checkerboard and rgbw texture functions.
2016-10-14fbo: Ensure power-of-two window size in tests that make textures w/the ↵Ian Romanick1-0/+26
window size Commit 0f163d1 removed the non-default window size from many tests. However, quite a few of these tests had power-of-two window sizes for drivers that do not support GL_ARB_texture_non_power_of_two. Fixes fbo-nodepth-test on NV20 and i865G fbo-nostencil-test on NV20 and i865G fbo-alphatest-formats on i865G fbo-blending-formats on NV20 and i865G Somehow fbo-alphatest-formats was previously passing on NV20. There are still a few failures in fbo-blending-formats on i865G, but the test mostly passes. The remaining failures there are likely legitimate problems. None of the tests were fixed on R200, and both fbo-alphatest-formats and fbo-blending-formats go from FAIL to CRASH. Both hit an assertion: main/format_utils.c:178: _mesa_compute_rgba2base2rgba_component_mapping: Assertion `!&"Unexpected base format"' failed. This should also fix these tests on NV10, NV30, and r100. I suspect r100 will have the same troubles as r200. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Brian Paul <brianp@vmware.com> Cc: Ilia Mirkin <imirkin@alum.mit.edu>
2016-10-07util: move PIGLIT_PATH_SEP to piglit-util.hMarek Olšák2-6/+6
2016-10-07util: rename piglit_gl_reinitialize_extensions->piglit_gl_invalidate_extensionsMarek Olšák3-3/+4
2016-10-07util: always set piglit_is_core_profileMarek Olšák2-3/+6
2016-10-07util: guard against double context destructionMarek Olšák1-0/+4
this no longer crashes: - create context (calls atexit) - teardown context - create context 2 (calls atexit) - exit()
2016-10-03utils: Move DRM_FORMATS defines to piglit_drm_dma_buf.h.Vinson Lee2-15/+17
This patch fixes this build error. transcode-nv12-as-r8-gr88.c: In function ‘create_textures’: transcode-nv12-as-r8-gr88.c:178:7: error: ‘DRM_FORMAT_R8’ undeclared (first use in this function) DRM_FORMAT_R8, r8_pixels); ^ Fixes: 0222f5db00fd ("dmabuf: fix YUV tests for drivers other than intel") Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97951 Signed-off-by: Vinson Lee <vlee@freedesktop.org> Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
2016-09-29utils: define DRM_FORMATS needed by dma_buf testsDylan Baker1-0/+15
If they're not defined by the installed libdrm already. This moves code already defined in transcode-nv12-as-r8-gr88 to the utils level, so that all tests that require these formats get them, and also adds on additional define that wasn't in the mentioned test. bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97951 Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com> Tested-by: Vinson Lee <vlee@freedesktop.org>
2016-09-26dmabuf: fix YUV tests for drivers other than intelRob Clark5-69/+182
Ok, so the basic problem with the YUV tests is that they currently completely ignore driver/hw pitch requirements, since the code that allocates the buffer doesn't know the pixel format, only the 'cpp'. The yuv test creates a small 4x4 yuv eglimage. If, say, the hardware requires the pitch to be aligned to, say, 32pixels, everything is fine for the Y plane, but the subsampled U/V or U+V plane has half as many pixels. (This did help me catch a bug in driver, not rejecting the dmabuf import with invalid pitch, but that doesn't help to get the piglit tests running.) The best approach I could come up with to fix this is to pass the fourcc all the way down to the code that creates the dmabuf (and copies src data into the dmabuf). Unfortunately this makes the patch a bit bigger than I was hoping, and not really sure a good way to split it up. This is tested on i965 (with the intel dma-buf backend) and freedreno (with the gbm dma-buf backend). In the gbm case, it requires new gbm format values for R8 and GR88, which is on mesa master as of this morning. (So I bumped the gbm version dependency to 12.1.) Signed-off-by: Rob Clark <robdclark@gmail.com> Reviewed-by: Eric Anholt <eric@anholt.net> Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2016-09-10cl: Initialize errNo on invalid image type (v2).Vinson Lee1-0/+1
Fixes sometimes-uninitialized warning. piglit-util-cl.c:1052:13: warning: variable 'errNo' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized] } else if (desc->image_type == CL_MEM_OBJECT_IMAGE3D) { ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ piglit-util-cl.c:1062:28: note: uninitialized use occurs here if(!piglit_cl_check_error(errNo, CL_SUCCESS)) { ^~~~~ piglit-util-cl.c:1052:9: note: remove the 'if' if its condition is always true } else if (desc->image_type == CL_MEM_OBJECT_IMAGE3D) { ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ piglit-util-cl.c:1040:14: note: initialize the variable 'errNo' to silence this warning cl_int errNo; ^ = 0 Fixes: 910cd6c222930 ("cl: add image and sampler utility functions") Signed-off-by: Vinson Lee <vlee@freedesktop.org> Acked-by: Jan Vesely <jan.vesely@rutgers.edu> Reviewed-by: Serge Martin <edb+piglit@sigluy.net>
2016-09-10Revert "cl: Initialize errNo on invalid image type."Serge Martin1-1/+0
This reverts commit 5b037e06730fb4d219c3e5f374ad96594e10e3b1. Sorry I pushed the wrong version.
2016-09-10cl: Initialize errNo on invalid image type.Vinson Lee1-0/+1
Fixes sometimes-uninitialized warning. piglit-util-cl.c:1052:13: warning: variable 'errNo' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized] } else if (desc->image_type == CL_MEM_OBJECT_IMAGE3D) { ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ piglit-util-cl.c:1062:28: note: uninitialized use occurs here if(!piglit_cl_check_error(errNo, CL_SUCCESS)) { ^~~~~ piglit-util-cl.c:1052:9: note: remove the 'if' if its condition is always true } else if (desc->image_type == CL_MEM_OBJECT_IMAGE3D) { ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ piglit-util-cl.c:1040:14: note: initialize the variable 'errNo' to silence this warning cl_int errNo; ^ = 0 Fixes: 910cd6c222930 ("cl: add image and sampler utility functions") Signed-off-by: Vinson Lee <vlee@freedesktop.org> Acked-by: Jan Vesely <jan.vesely@rutgers.edu> Reviewed-by: Serge Martin <edb+piglit@sigluy.net>
2016-08-31cmake: Link test utils with "-ldl"Jussi Kukkonen1-0/+2
Without this linking CXX executables (e.g. fbo-blit-stretch) fails with gold linker: | libpiglitutil_gl.so.0: error: undefined reference to 'dlsym' | libpiglitutil_gl.so.0: error: undefined reference to 'dlerror' | libpiglitutil_gl.so.0: error: undefined reference to 'dlopen' Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2016-08-31cmake: Link utils with xcb explicitlyJussi Kukkonen1-0/+2
Linking CXX executables with gold linker leads to: libpiglitutil_gl.so.0: error: undefined reference to 'xcb_connect' libpiglitutil_gl.so.0: error: undefined reference to 'xcb_get_setup' libpiglitutil_gl.so.0: error: undefined reference to 'xcb_setup_roots_iterator' This may have appeared now because xcb-dri2 used to overlink publicly but now does not. Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2016-08-24cl: Use right comparison function for doubleMatt Arsenault1-1/+1
Reviewed-by: Jan Vesely <jan.vesely@rutgers.edu>
2016-08-21util: Add GL 4.4/4.5 to required_gl_version_from_glsl_version.Kenneth Graunke1-0/+2
Fixes glslparsertest with an argument of 4.40 / 4.50. Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
2016-08-18piglit-framework-gl: Use GBM on non-intel for dmabuf creation.Eric Anholt1-0/+101
Previously the dmabuf tests only worked on the intel driver. However, thanks to the new GBM BO mapping interface by Rob Herring, we can make a generic framework for other drivers. Reviewed-by: Rob Clark <robdclark@gmail.com>
2016-08-17cl: Add support for cl_half to program testerJan Vesely2-0/+65
Use explicit conversion from regexp matched array values v2: distance between two half numbers is 8192 single float ulps no need to place converted float in the middle of single precision range Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu> Acked-by: Tom Stellard <thomas.stellard@amd.com>
2016-07-26util/wfl: remove const qualifier from parse_test_configEmil Velikov1-1/+1
Drop the const qualifier from the output variable. Copy/paste mistake introduced with commit 5e78dd43e4b ("util/wfl: fold make_config_attrib_list and make_context_description"). Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97063 Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2016-07-26util/wfl: remove unused default caseEmil Velikov1-4/+0
Since each case of the (enum context_flavor) flavor is handled we can drop the default case. This will resolve a compiler warning caused by earlier refactoring with commit 5e78dd43e4b ("util/wfl: fold make_config_attrib_list and make_context_description") Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97063 Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2016-07-22util/wfl: check for calloc() failureEmil Velikov1-3/+5
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2016-07-22util/wfl: fold make_config_attrib_list and make_context_descriptionEmil Velikov1-102/+50
The latter tends to reverse what was done by the former, in order to produce a human-readable string. Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2016-07-22util/wfl: check if derived context contains fwd compat/debug attributesEmil Velikov1-0/+2
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2016-07-22util/wfl: update make_config_attrib_list() commentEmil Velikov1-3/+4
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2016-07-22util/wfl: print to strerr if we get the wrong GL versionEmil Velikov1-2/+2
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2016-07-22util/gl: remove '#if defined(GL_SYMBOL)' guardsEmil Velikov1-7/+0
Those symbols are part of the ABI/API and cannot change. Just define them locally when needed. v2: Drop the fall-back definitions (Ilia). Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
2016-07-02util: Add u/byte, u/short and half support to [vertex data]Andres Gomez2-82/+234
This allows to set data of u/byte, u/short and half types for attributes with the shader runner. For example: 0/byte/int attname1/ushort/uint attname3/half/float The syntax has been extended so the recommended way has replaced the old COUNT field in the [vertex data] header line with the corresponding GLSL type for the old TYPE field. In any case, the extended syntax is backward compatible so it is still possible to specify a vec3 attribute like: attname/float/3 In addition to the now recommended format: attname/float/vec3 Due to this, the arb_vertex_attrib_64bit input tests generator has been also adapted to the new syntax. Signed-off-by: Andres Gomez <agomez@igalia.com> Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
2016-07-02util/gl: Wrapper to load hex values for half floatsAndres Gomez1-0/+27
For some cases we want to have shaders where we load an exact bit pattern into a half float. Signed-off-by: Andres Gomez <agomez@igalia.com> Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
2016-07-02util: Wrapper to load exact hex patterns for intsAndres Gomez2-1/+25
For some cases we want to have shaders where we load an exact bit pattern into a signed int. If we would just use strtol, the negative values would have to include the sign, as in -0x7fffffff, and not the exact bit pattern, which would be 0x80000000, to avoid an ERANGE out of range errno value on 32-bit systems. Hence, we were using strtoll but that was also causing that we would lose the internal range check performed by strtol. Now, we use an implementation that would accept exact bit patterns, including a proper internal range check and, also, the other alternative formats allowed by strtol. Signed-off-by: Andres Gomez <agomez@igalia.com> Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
2016-06-21util: specify channel sizes for choose_config_attribs()Brian Paul1-7/+21
WAFFLE_RED_SIZE=1 (for example) gets passed to glXChooseFBConfig as GLX_RED_SIZE=1. GLX chooses the deepest pixel format which meets that minimum value so we typically get an 8 bit/channel format. But with wglChoosePixelFormatARB() we may get the shallowest pixel format that meets that value so we may wind up getting a 5/6/5 format. Many piglit tests aren't prepared for that and report failures because the color tolerances are too tight. In any case, we really want to test 8-bit formats. This change tells waffle to first try 8/8/8 color, 24-bit Z. And if that fails, try 5/6/5 with 16-bit Z. Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2016-06-18gl.xml: update and accomodate addition of glsc2Ilia Mirkin2-2/+4
For now we just ignore it rather than trying to teach piglit about it. Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2016-06-15util: Fix piglit-vbo.cpp tautological-compare warning.Vinson Lee1-1/+1
piglit-vbo.cpp:310:26: warning: comparison of unsigned expression < 0 is always false [-Wtautological-compare] if (this->matrix_index < 0 || this->matrix_index > 3) { ~~~~~~~~~~~~~~~~~~ ^ ~ vertex_attrib_description::matrix_index has type size_t. Fixes: 8e71b836e8ea ("util: Add new headed matrix_index header to [vertex data]") Signed-off-by: Vinson Lee <vlee@freedesktop.org> Reviewed-by: Andres Gomez <agomez@igalia.com>
2016-06-08shader_runner: Fix integer vbo attribute parsing on 32-bit systems.Kenneth Graunke1-1/+1
The new ARB_vertex_attrib_64bit tests specify integer vertex attributes with hex values, such as 0xc21620c5. As an integer value, this is beyond LONG_MAX on 32-bit systems. The intent is to parse it as an unsigned hex value and bitcast it. However, we still need to handle parsing values with negative signs. Using strtoll and truncating should work. It breaks the errno-based range validation. We may want to fix that some day. v2: Drop bogus range checking attempt. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Antia Puentes <apuentes@igalia.com> Reviewed-by: Andres Gomez <agomez@igalia.com> Tested-by: Mark Janes <mark.a.janes@intel.com>
2016-05-30cl: declare enum counts as externJan Vesely1-4/+4
The correct symbols are in libpiglitutil_cl.so Reported-by: Jose Luis Cercós <jlcercos@gmail.com> Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu> Reviewed-by: Serge Martin <edb+mesa@sigluy.net>
2016-05-26util: Observe piglit_tolerance in piglit_probe_image_ubyte()Kristian Høgsberg Kristensen1-1/+3
2016-05-23Allow 2d array and 3d textures on OpenGL ES 3.xAnuj Phogat3-2/+16
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
2016-05-23Add texture min/mag filtersAnuj Phogat1-0/+3
2D textures worked fine without defining these filters but 3D textures don't work. Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
2016-05-23Fix the minimum number of faces allowed in a ktx imageAnuj Phogat1-1/+1
For cubemaps and cubemap arrays this should be 6. For non cubemaps this should be 1. Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
2016-05-17util: Suppress OpenCL deprecation warningsDylan Baker1-0/+5
Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com> Reviewed-by: Serge Martin <edb+piglit@sigluy.net>
2016-05-17cl: add support for global offsetJan Vesely2-2/+9
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu> Reviewed-by: Serge Martin <edb+piglit@sigluy.net>
2016-05-17util: Add array_index support to [vertex data] (v2)Andres Gomez1-34/+133
This allows data to be set for arbitrary array sized attributes in shader runner. For example to set mat2x3[2]: attname[0]/mat2x3/3/1 attname[0]/mat2x3/3/2 attname[1]/mat2x3/3/1 attname[1]/mat2x3/3/2 The syntax has been extended so the recommended type to specify in the [vertex data] header line is the GLSL corresponding one, not just "float", "double", "int" or "uint". In any case, the extended syntax is backward compatible so it is still possible to specify a vec3 attribute like: attname/float/3 In addition to the now recommended format: attname/vec3/3 v2: Added more verbose comments and documentation as requested by Alejandro Piñeiro. Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com> Signed-off-by: Andres Gomez <agomez@igalia.com>
2016-05-10util/fbo: Add support for textures with target GL_TEXTURE_2DJason Ekstrand2-7/+15
We used to always use GL_TEXTURE_RECTANGLE which we may not actually want. Signed-off-by: Jason Ekstrand <jason@jlekstrand.net> Reviewed-by: Matt Turner <mattst88@gmail.com>
2016-05-09Fix asprintf warningsMarek Olšák2-4/+4
2016-05-09util: fix warningsMarek Olšák3-1/+8