summaryrefslogtreecommitdiff
path: root/tests/gem_mmap_wc.c
AgeCommit message (Collapse)Author
2016-01-19igt/gem_mmap_wc: Test cpu mmap vs wc mmap coherencyChris Wilson
Similar to the cpu mmap vs gtt mmap coherency test. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-10-12Replace __gem_mmap__{cpu,gtt,wc}() + igt_assert() with gem_mmap__{cpu,gtt,wc}()Ville Syrjälä
gem_mmap__{cpu,gtt,wc}() already has the assert built in, so replace __gem_mmap__{cpu,gtt,wc}() + igt_assert() with it. Mostly done with coccinelle, with some manual help: @@ identifier I; expression E1, E2, E3, E4, E5, E6; @@ ( - I = __gem_mmap__gtt(E1, E2, E3, E4); + I = gem_mmap__gtt(E1, E2, E3, E4); ... - igt_assert(I); | - I = __gem_mmap__cpu(E1, E2, E3, E4, E5); + I = gem_mmap__cpu(E1, E2, E3, E4, E5); ... - igt_assert(I); | - I = __gem_mmap__wc(E1, E2, E3, E4, E5); + I = gem_mmap__wc(E1, E2, E3, E4, E5); ... - igt_assert(I); ) Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Stochastically-reviwewed-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-09Remove gem_mmap__{cpu,gtt,wc} return value MAP_FAILED assertsVille Syrjälä
gem_mmap__{cpu,gtt,wc} never return MAP_FAILED, it gets converted to NULL internally. So don't go asserting that the returned value is not MAP_FAILED. Done with coccinelle: @@ type T; identifier I; @@ ( I = gem_mmap__gtt(...); | I = gem_mmap__cpu(...); | I = gem_mmap__wc(...); ) ... ( - igt_assert(I != MAP_FAILED); + igt_assert(I); | - igt_assert(I && I != MAP_FAILED); + igt_assert(I); | - igt_assert(I != (T *) MAP_FAILED); + igt_assert(I); | - igt_assert(I != NULL); + igt_assert(I); ) 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>
2015-08-05tests/gem_mmap_wc: don't fail if the Kernel is too old for the getparam flagPaulo Zanoni
Just don't check the drmIoctl() return code: the "if (val)" should be enough to prevent any problems. v2: Don't SKIP, just proceed (Chris). Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89739 Cc: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2015-04-10igt/gem_mmap_wc: Explicitly check for use-after-closeChris Wilson
We already rely on the mmap(object) surviving close(), but make the test explicit and early. Secondly, we don't technically need to call set_domain after writing through the CPU then reading through WC, since the CPU cache is consistent for those two paths. Test it. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-02-13lib/ioctl: gem_ prefix for igt_require_mmap_wcDaniel Vetter
We stick to the overall prefix even for magic require functions. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-01-22tests/gem_concurrent_blt: Adjust subtest namingDaniel Vetter
Our tooling doesn't cope with () in the testnames (piglit becomes all confused apparently) and the naming convention says to use "blt" and "render". Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=88220 Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=88349 Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2015-01-15igt/gem_mmap_wc/set-cache-level: Exercise set-cache-level WARNingChris Wilson
With the introduction of mmap(wc) and its unbound GTT write domain, we can now hit the warning inside set-cache-level, complaining about the failure to do correct cpu cache tracking. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-01-13igt/gem_mmap_wc: Reorder gem_close()Chris Wilson
Unlike a GTT mmap, a WC mmap does not have a direct reference to the object, only to the backing storage. If we want to control the domain correctly for mmap(wc), we have to keep the bo reference around. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=88356 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-01-06igt/gem_mmap_wc: Add the invalid flags subtestAkash Goel
A new subtest added to validate the new version of gem_mmap ioctl, for creating the wc mappings, on yet to be supported flags. v2: Removed the flags checking for older kernels (Daniel) Signed-off-by: Akash Goel <akash.goel@intel.com> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-01-06igt/gem_mmap_wc: Exercise mmap(wc) interfaceChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>