summaryrefslogtreecommitdiff
path: root/tests/i915/gem_mmap.c
AgeCommit message (Collapse)Author
2022-05-31igt: Promote/rename OS helpersRob Clark
Promote intel_os.c helpers to igt_os.c, so that I can re-use them for some additional msm tests. Just big churny rename, no functional change. Signed-off-by: Rob Clark <robdclark@chromium.org> Reviewed-by: Petri Latvala <petri.latvala@intel.com>
2022-03-09i915/gem_mmap: Added test description for test caseApoorva Singh
Added tests descriptions to all the available subtests. v2: Modified few descriptions to be more specific v3: Rebase v4: Incorporated minor changes as suggested in feedback v5: Minor alignment adjustments Signed-off-by: Apoorva Singh <apoorva1.singh@intel.com> Cc: Kamil Konieczny <kamil.konieczny@linux.intel.com> Cc: Arjun Melkaveri <arjun.melkaveri@intel.com> Reviewed-by: Kamil Konieczny <kamil.konieczny@linux.intel.com>
2021-08-10tests/gem_mmap: Add allocator supportCh Sai Gowtham
When relocations are not available tests must assign addresses to objects by themselves instead of relying on the driver. We use allocator for that purpose. Signed-off-by: Ch Sai Gowtham <sai.gowtham.ch@intel.com> Cc: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com> Cc: Petri Latvala <petri.latvala@intel.com> Cc: Ashutosh Dixit <ashutosh.dixit@intel.com> Reviewed-by: Zbigniew Kempczyński <zbigniew.kempczynski@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-12lib: Pass device fd to gem_mmappable_aperture_size()Chris Wilson
In order to find the correct aperture size for the test, we want to pass the test's device into the query. Reported-by: Bruce Chang <yu.bruce.chang@intel.com> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Bruce Chang <yu.bruce.chang@intel.com> Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
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>
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-29Revert "lib/igt_device: Move intel_get_pci_device under igt_device"Ville Syrjälä
One significant usecase for intel_reg/etc. is to be able to examine the hardware state *before* loading the driver. If the tool forces the driver to load we've totally lost that capability. This reverts commit 8ae86621d6fff60b6e20c6b0f9b336785c935b0f. Cc: Michał Winiarski <michal.winiarski@intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Acked-by: Jani Nikula <jani.nikula@intel.com> Acked-by: Michał Winiarski <michal.winiarski@intel.com>
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-20lib/igt_device: Move intel_get_pci_device under igt_deviceMichał Winiarski
It allows us to make things a little bit more generic. Also, we now require fd rather than doing guesswork when it comes to pci address. v2: Use readlinkat rather than string concat, move stuff around, provide a version that does not assert. (Chris) v3: Print addr on failure, avoid assignment in conditionals. (Chris) Signed-off-by: Michał Winiarski <michal.winiarski@intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2019-03-19tests/i915/gem_mmap: Add invalid parameters testsChris Wilson
Add a couple of tests that supply invalid parameters to the mmap IOCTL. 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>
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>