summaryrefslogtreecommitdiff
path: root/tests/gem_reloc_overflow.c
AgeCommit message (Collapse)Author
2016-03-10igt/gem_reloc_overflow: 32bit compilation warningChris Wilson
gem_reloc_overflow.c: In function ‘__real_main365’: gem_reloc_overflow.c:384:3: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 6 has type ‘size_t’ [-Wformat=] igt_require_f(mlock(reloc, reloc_size) == 0, ^ Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-09tests/gem_reloc_overflow: Add missing igt_fixtureDaniel Vetter
Boom when running with --list on non-intel machines or as non-root. Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2016-03-08igt/gem_reloc_overflow: Fix errno tests for "overflow"Chris Wilson
The execbuffer2 ABI is not strictly limited to a total of UINT32_MAX entries, rather each object can have a maximum of UINT32_MAX relocation entries and the current implementation imposes that the total must be allocable in a contiguous buffer when necessary (i.e as large as the kernel can conceivably allocate). This is not an ABI constraint per-se, just an implementation issue. Whilst updating the limits for 64bit kernels, review usable of ioctl-wrappers (i.e. use __gem_execbuf now available) and include a batch of more tests to explore the boundary conditions of the maximum relocation size. Note that rather than guess the reloc-max, it would be better if we queried it. Also it is of vital importance that when constructing a test to fail in a particular fashion, it must not include any other error (e.g. we were passing in relocation arrays with invalid target handle and domains when looking for a potential overflow across multiple objects). Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-10-09Make gem_mmap__{cpu,gtt,wc}() assert on failureVille Syrjälä
Rename the current gem_mmap__{cpu,gtt,wc}() functions into __gem_mmap__{cpu,gtt,wc}(), and add back wrappers with the original name that assert that the pointer is valid. Most callers will expect a valid pointer and shouldn't have to bother with failures. To avoid changing anything (yet), sed 's/gem_mmap__/__gem_mmap__/g' over the entire codebase. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Stochastically-reviwewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-10-09s/gem_mmap/gem_mmap__gtt/Ville Syrjälä
Get rid of the gem_mmap() alias of gem_mmap__gtt(). I don't see any point in having it. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Stochastically-reviwewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-09-11convert drm_open_any*() calls to drm_open_driver*(DRIVER_INTEL) calls with cocciMicah Fedke
Apply the new API to all call sites within the test suite using the following semantic patch: // Semantic patch for replacing drm_open_any* with arch-specific drm_open_driver* calls @@ identifier i =~ "\bdrm_open_any\b"; @@ - i() + drm_open_driver(DRIVER_INTEL) @@ identifier i =~ "\bdrm_open_any_master\b"; @@ - i() + drm_open_driver_master(DRIVER_INTEL) @@ identifier i =~ "\bdrm_open_any_render\b"; @@ - i() + drm_open_driver_render(DRIVER_INTEL) @@ identifier i =~ "\b__drm_open_any\b"; @@ - i() + __drm_open_driver(DRIVER_INTEL) Signed-off-by: Micah Fedke <micah.fedke@collabora.co.uk> Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-08-21lib: add a single include headerThomas Wood
Add a header that includes all the headers for the library. This allows reorganisation of the library without affecting programs using it and also simplifies the headers that need to be included to use the library. Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2014-12-04tests: add more test descriptionsThomas Wood
Add more test descriptions based on exiting comments. Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2014-03-22lib: rename intel_gpu_tools.h to intel_io.hDaniel Vetter
With the header cleanup we can now give this header a suitable name, since it now really only contains register access and other I/O functions and assorted definitions. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-03-22lib: unnecessary header removal for drmtest.h, part 1Daniel Vetter
Brought a few missing headers to light in ioctl_wrappers.h, too. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-11-07tests/gem_overflow_reloc: Rework subtest enumerationDaniel Vetter
Subtest names must be stable across all platforms for easier tracking. Hence move the gen8+ check into the subtests, using igt_require. This will auto-skip the tests on platforms where a given test doesn't apply. Also move the assignment of the relocation_type var outside of the fixture block. Fixtures aren't run when enumerating subtests (so that subtests can be enumerated on any platform, even without an intel gpu). So gcc has indeed been right with it's "potentially uninitialized" var warning after all ... Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-11-07tests/gem_reloc_overflow: Polish after Rafael's patchDaniel Vetter
- use void* for generic pointer. - Fix const usage. - Shut up gcc about uninitizialized var. - Be paranoid about the moved tests and make double-sure that the batch would indeed work safe for the condition being tested. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-11-07tests/gem_reloc_overflow: Add gen8+ specifc testsRafael Barbalho
Broadwell introduces 64-bit relocation addresses which add extra corner cases. The test was refactored slightly with some tests that were in the source offset tests were moved to the more generic reloc test area. The source offset tests are now gen aware and called twice to test both cpu & gtt relocation paths. In addition 2 new gen8+ test were added to the test: * Relocation straddling page a page * Insufficient space for a relocation at the end of the buffer. Signed-off-by: Rafael Barbalho <rafael.barbalho@intel.com> Conflicts: tests/gem_reloc_overflow.c Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-11-01lib: add igt_main macroDaniel Vetter
In the past new testcases with subtest often forgot to add the call to igt_exit at the end of their main() function. That is now caught with a bit more obnoxious asserts, but it's still a nuissance. This little igt_main macro takes care of that (and also of calling the subtest machinery initialization code correctly). If no one objects I'll roll this out for all the simple cases (i.e. those tests that don't have additional argv parsing on top of the subtest machinery). v2: Roll it out across the board. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-09-19tests/gem_reloc_overflow: New subtest for overflowing buffer_countDaniel Vetter
Luckily everything seems to be fine. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-09-19tests/gem_reloc_overflow: Extract reloc_testsDaniel Vetter
I'll be adding more stuff soon ;-) Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-09-04tests/gem_reloc_overflow: Add more checksDaniel Vetter
For reloc offsets and batch start/len. Doesn't quite fit into the test subject at hand here, but meh. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-09-04tests/gem_reloc_overflow: convert to subtestsDaniel Vetter
More will come! Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-09-03lib/drmtest: include sys/mman.h from drmtest.hDaniel Vetter
We need it for mmapping to get at PROT_READ|WRITE anyway. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-08-13tests: s/assert/igt_assertDaniel Vetter
Just a wholesale rollout for now, we can refine later on. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-03-22tests: add gem_reloc_overflow to check wrappingKees Cook
This adds a test to make sure that the execbuffer validation routine is checking for invalid addresses, single entry overflow, and multi-entry wrapping overflow. Signed-off-by: Kees Cook <keescook@chromium.org> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>