summaryrefslogtreecommitdiff
path: root/tests/i915/gem_mmap_wc.c
AgeCommit message (Collapse)Author
2021-08-10tests/gem_mmap_wc: Adopt to use allocatorZbigniew Kempczyński
For newer gens we're not able to rely on relocations. Adopt to use offsets acquired from the allocator. Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com> Cc: Petri Latvala <petri.latvala@intel.com> Cc: Ashutosh Dixit <ashutosh.dixit@intel.com> Reviewed-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
2021-07-15tests/i915/gem_mmap_wc: drop LOCAL_IOCTL_I915_GEM_MMAP_v2Lucas De Marchi
LOCAL_IOCTL_I915_GEM_MMAP_v2 is not really a different ioctl, it's just DRM_IOCTL_I915_GEM_MMAP and a check for version/ Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com> Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch> Reviewed-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
2021-06-24i915: Handle the case where legacy mmap is not available, v2.Maarten Lankhorst
We will remove support for the legacy mmap ioctl, so handle that case without rewriting all tests. When the gem_mmap ioctl is not available, transparently fallback to mmap_offset. Changes since v1: - Skip gem_tiled_wc too, as it requires on legacy mmap behavior. (Ashutosh) - Remove fallback for __gem_mmap__gtt, it's already mmap_offset. (Ashutosh) Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reviewed-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
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-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-12-22i915/gem_mmap_wc.c: set-cache-level runs only with displayCaz Yokoyama
The subtest, set-cache-level calls do_ioctl() with DRM_IOCTL_MODE_GETRESOURCES, DRM_IOCTL_MODE_GETCRTC and DRM_IOCTL_MODE_CURSOR. They are display related IOCTL. Therefore, set-cache-level is skipped on the platforms which do not have display. Cc: Chris Wilson <chris.p.wilson@intel.com> Cc: James Ausmus <james.ausmus@intel.com> Cc: Petri Latvala <petri.latvala@intel.com> Reviewed-by: Ashutosh Dixit <ashutosh.dixit@intel.com> Signed-off-by: Caz Yokoyama <caz.yokoyama@intel.com> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2020-10-05i915/gem_mmap_wc: Align subtests with correct function callsApoorva Singh
- Fix the name of subtest "write-gtt-read-gtt" - Fix subtests "write-wc-read-gtt" and "write-gtt-read-gtt" to call correct fucntions Cc: Chris Wilson <chris@chris-wilson.co.uk> Cc: Melkaveri, Arjun <arjun.melkaveri@intel.com> Signed-off-by: Apoorva Singh <apoorva1.singh@intel.com> Reviewed-by: Ashutosh Dixit <ashutosh.dixit@intel.com> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2020-09-16i915/gem_mmap: Modified offset in subtest "bad-size"Apoorva Singh
Subtest "bad-size" should keep valid/good offset corresponding to buffer object being mapped. Currently, subtest will pass for any value of size provided as the offset value itself will not allow to map any size of memory which defies the purpose of this subtest. The subtest should not pass due to bad offset value while it should pass only due to bad size provided. v2: Added new offset. Updated the same changes in "bad-size" subtest of gem_mmap_wc too. Signed-off-by: Apoorva Singh <apoorva1.singh@intel.com> Cc: Melkaveri, Arjun <arjun.melkaveri@intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Cc: Priyanka Dandamudi <priyanka.dandamudi@intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2020-01-27tests/i915/gem_mmap_wc: Skip gtt test if aperture is missingVinay Belgaumkar
Skip subtest on platforms that do not have mappable aperture. v2: Skip the test_write_gtt as well when there is no aperture. It seems like the purpose of this test was to mmap the buffer in gtt even though it uses the incorrect mapping call. Until this can be fixed, might be better to skip it. Also remove all subtests that use run_without_prefault, since this debugfs is being removed. Signed-off-by: Vinay Belgaumkar <vinay.belgaumkar@intel.com> Cc: Antonio Argenziano <antonio.argenziano@intel.com> Cc: Ashutosh Dixit <ashutosh.dixit@intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk>
2019-07-17tests/i915/gem_mmap_wc: Tweak close subtestLukasz Kalamarz
Small change that allow user to lower OBJECT_SIZE without false negative. Signed-off-by: Lukasz Kalamarz <lukasz.kalamarz@intel.com> Cc: Antonio Argenziano <antonio.argenziano@intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Cc: Michal Winiarski <michal.winiarski@intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2019-06-06tests/i915/gem_mmap: fix bad-object tests error valueSimon Ser
These tests checked for EINVAL, but the correct error value is ENOENT, as pointed out by Chris Wilson: commit bf79cb914dbfe848add8bb76cbb8ff89110d29ff Author: Chris Wilson <chris@chris-wilson.co.uk> Date: Wed Aug 4 14:19:46 2010 +0100 drm: Use ENOENT consistently for the error return for an unmatched handle. This is consistent with trying to access a filename that not exist within a directory which is a good analogy here. The main reason for the change is that it is easy to confuse the error code of EBADF as an performing an ioctl on an invalid file descriptor (rather than an unknown object). Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Dave Airlie <airlied@redhat.com> This commit fixes the two bad tests (the gem_mmap_gtt test already checks for ENOENT). Signed-off-by: Simon Ser <simon.ser@intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
2019-06-06tests/i915/gen_mmap: fix no-op loopsSimon Ser
The loop condition is never satisfied, since after filling the array i > 0. For this reason the loop is always a no-op. Use a more conventional loop instead. Fixes: 964e39159c64 ("tests/i915/gem_mmap: Add invalid parameters tests") Signed-off-by: Simon Ser <simon.ser@intel.com> Acked-by: Antonio Argenziano <antonio.argenziano@intel.com> Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
2019-04-18lib/igt_dummyload: Get rid of 'batch' on spinner accessorsMika Kuoppala
There is no guarantee that spinners are and will be implemented using batches. As we have igt_spin_t, manipulate it through igt_spin_* functions consistently and hide the batch nature. Cc: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Mika Kuoppala <mika.kuoppala@linux.intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2019-03-21i915/gem_mmap_gtt: Check that the initial pagefault is non-blockingChris Wilson
Historically, the GTT pagefault invoked set-domain(GTT) to transparently handle swapin. However, this implied that the GTT faults were synchronous with GPU rendering, which was not the desired ABI, as synchronisation is explicit via calls to GEM_WAIT or GEM_SET_DOMAIN. In MMAP_GTT_VERSION, this accidental ABI is removed and so we test it is gone and does not come back. For completeness, we verify that the other mmap paths didn't block on initial pagefaulting. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Matthew Auld <matthew.auld@intel.com>
2019-03-19tests/i915/gem_mmap_wc: Add invalid params testsAntonio Argenziano
Add some invalid parameters tests for the MMAP IOCTL when the MMAP_WC flag is supplied. v2: - Expand test space. (Chris) Signed-off-by: Antonio Argenziano <antonio.argenziano@intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2019-02-25tests/i915/gem_mmap_wc: Add local MMAP wrapperAntonio Argenziano
Incoming patches for the common library wrappers will try mapping through the MMAP_OFFSET IOCTL first. Since the tests in gem_mmap_wc are targeted at the GEM_MMAP IOCTL, add a local wrapper. Signed-off-by: Antonio Argenziano <antonio.argenziano@intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
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>