summaryrefslogtreecommitdiff
path: root/tests/i915/gem_pread.c
AgeCommit message (Collapse)Author
2021-05-27lib/i915/gem_create: Add gem_create_extAndrzej Turko
Add a wrapper for gem_create_ext ioctl (a version of gem_create that accepts extensions). In preparation for the driver change implementing it, a local definition of its id and necessary structs have been added, which are to be erased as soon as those definitions appear in the i915_drm.h file. The new ioctl wrapper is added to a separate file. For consistency the wrapper of the old ioctl, gem_create is moved from ioctl_wrappers to gem_create. Signed-off-by: Andrzej Turko <andrzej.turko@linux.intel.com> Cc: Zbigniew Kempczynski <zbigniew.kempczynski@intel.com> Cc: Dominik Grzegorzek <dominik.grzegorzek@intel.com> Cc: Petri Latvala <petri.latvala@intel.com> Cc: Chris P Wilson <chris.p.wilson@intel.com> Signed-off-by: Matthew Auld <matthew.auld@intel.com> Acked-by: Petri Latvala <petri.latvala@intel.com>
2021-03-17lib/ioctl_wrappers: Keep IGT working without pread/pwrite ioctlsAshutosh Dixit
The general direction at this time is to phase out pread/write ioctls and not support them in future products. This means IGT must handle the absence of these ioctls. This patch does this by modifying gem_read() and gem_write() to do the read/write using the pread/pwrite ioctls first but when these ioctls are unavailable fall back to doing the read/write using a combination of mmap and memcpy. Callers who must absolutely use the pread/pwrite ioctls (such as tests which test these ioctls or must otherwise only use the pread/pwrite ioctls) must use gem_require_pread_pwrite() to skip when these ioctls are not available. v1: Removed __gem_pread, gem_pread, __gem_pwrite and gem_pwrite introduced previously since they are not necessary, gem_require_pread_pwrite is sufficient v2: Fix CI failures in gem_advise and gen9_exec_parse by introducing gem_require_pread_pwrite v3: Skip mmap for 0 length read/write's v4: Remove redundant igt_assert's v5: Re-run v6: s/EOPNOTSUPP/-EOPNOTSUPP/ v7: Rebase on latest master, skip gem_exec_parallel@userptr with gem_require_pread_pwrite v8: Re-run v9: Rebase Acked-by: Dave Airlie <airlied@redhat.com> Acked-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Reviewed-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com> Signed-off-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
2021-01-11lib/i915: Split gem_create.c from ioctl_wrappers.cAndrzej Turko
In preparation for a variation on the exisiting GEM_CREATE API, split the ioctl from out of the large ioctl_wrappers.c Signed-off-by: Andrzej Turko <andrzej.turko@linux.intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2020-11-10i915: Drop superfluous UFFD_API_RANGE_IOCTLS assertChris Wilson
We only require the minimum set of userfaultfd API (wake, copy) so we can remove the overzealous assert that we have the full range. The full range is not available if the vma contains a huge page, for example. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Acked-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
2020-11-07i915/gem_pread: Set threads = NULL before reallocChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Acked-by: Matthew Auld <matthew.auld@intel.com>
2020-11-06i915/gem_pread,gem_pwrite: Exercise exhaustionChris Wilson
Use userfault to arbitrarily delay the completion of copy_from_user() in order to trap many, many threads inside the core of gem_pread/gem_pwrite. This allows us to exhaust the preferred paths and potentially trip over unexpected fallback paths. Suggested-by: Matthew Auld <matthew.auld@intel.com> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Matthew Auld <matthew.auld@intel.com>
2020-06-03i915: purge i915_gem_create_v2Matthew Auld
The gem_create_v2 uapi was never merged, which would have been a nice addition to allow userspace to utilise stolen memory. Since it can only get in the way at this point, let's just remove it. Signed-off-by: Matthew Auld <matthew.auld@intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2019-11-14i915/gem_pread/pwrite: Skip gtt test on self for missing mappable gttZbigniew Kempczyński
Some tests are designed to use GGTT API which should be skipped when HW doesn't support mappable aperture. Gem pread / pwrite "self" test is one of them. Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2019-06-27i915/gem_pread/pwrite: Rename "basic"Chris Wilson
The "basic" subtests perform no verification that the read/write work, only function as mere API exercisers and loose benchmarks. Rename them to reflect that they are poor benchmarks instead. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2019-05-27i915/gem_pread: Nuke custom main functionPetri Latvala
The object size parameter, previously gotten from argv[1], is now the parameter -s. Signed-off-by: Petri Latvala <petri.latvala@intel.com> Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
2019-04-02i915/gem_pread,gem_pwrite: Exercise using ourselves as the bufferChris Wilson
If we caused a fault on a GEM buffer while in the middle of trying to write/read into that buffer, we could conceivably deadlock (e.g. recursing on struct_mutex if we are not careful). Exercise these cases by supplying a fresh mmap to pread/pwrite in both non-overlapping and overlapping copies. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Matthew Auld <matthew.auld@intel.com>
2018-10-23tests: Introduce i915 directoryArkadiusz Hiler
We can already move all the tests with distinct prefixes: gem_, gen3_ and i915_. pm_ and drv_ tests will follow in batches, so we can do the adjustments in the reporting/filtering layer of the CI system. v2: Fix test-list.txt generation with meson v3: Fix docs build (Petri) Cc: Chris Wilson <chris@chris-wilson.co.uk> Cc: Petri Latvala <petri.latvala@intel.com> Cc: Martin Peres <martin.peres@linux.intel.com> Signed-off-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Reviewed-by: Petri Latvala <petri.latvala@intel.com> Tested-by: Petri Latvala <petri.latvala@intel.com> Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch> Acked-by: Chris Wilson <chris@chris-wilson.co.uk>