summaryrefslogtreecommitdiff
path: root/tests/i915/gem_mmap_gtt.c
AgeCommit message (Collapse)Author
2022-06-28i915/gem_mmap_gtt: added description for test casePriyanka Dandamudi
Added global description and subtest descriptions. v2:Minor corrections. v3: Added descriptions to copy subtests. Cc: Kamil Konieczny <kamil.konieczny@linux.intel.com> Signed-off-by: Priyanka Dandamudi <priyanka.dandamudi@intel.com> Reviewed-by: Kamil Konieczny <kamil.konieczny@linux.intel.com>
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>
2021-08-10tests/gem_mmap_gtt: 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-07-08tests/i915/gem_mmap_gtt: Convert to intel_ctx_t (v2)Jason Ekstrand
v2 (Ashutosh Dixit): - Split the i915_query changes into their own patch Signed-off-by: Jason Ekstrand <jason@jlekstrand.net> Reviewed-by: Ashutosh Dixit <ashutosh.dixit@intel.com> Acked-by: Maarten Lankhorst <maarten.lankhorst@linux.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>
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-12-10i915/gem_mmap_gtt: Replace gem_threaded_access_tiledChris Wilson
Concurrent access to a mmap is covered by gem_mmap_gtt/concurrent, if we add tiled access to it, we make gem_threaded_access_tiled entirely redundant. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com> Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
2020-11-24Cast negative debugfs values to u64Chris Wilson
Since commit 488dac0c9237647e9b8f788b6a342595bfa40bda Author: Yicong Yang <yangyicong@hisilicon.com> Date: Sat Nov 21 22:17:19 2020 -0800 libfs: fix error cast of negative value in simple_attr_write() the kernel now rejects any negative values written to debugfs, rather than casting them to u64. Since we are accustomed to having the -1 mean U64_MAX, perform that conversion ourselves. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com> Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
2020-11-13i915/gem_mmap_gtt: Mix a busy hang with GTT and userptrChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Acked-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
2020-11-13i915/gem_mmap_gtt: Reset a busy mmaped objectChris Wilson
Exercise the gtt mmap revocation for a reset on a busy object. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Acked-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
2020-10-23i915/gem_mmap_gtt: Trim object size for ptracingChris Wilson
For verifying vm_ops.access we only need a page or two to check we both advance across a page boundary and find the right offset within a page. 16MiB is overkill for the slow uncached reads through the slow ptrace interface, so reduce the object size by a couple of orders of magnitude. Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/2425 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
2020-06-12i915/gem_mmap_gtt: Increase concurrent stressChris Wilson
Rather than just try to look at the first fault of each mmap in each thread, keep the threads running for the test duration and watch for refaults. References: https://gitlab.freedesktop.org/drm/intel/-/issues/2012 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Acked-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
2020-05-08lib/params: start renaming functions igt_params_*Juha-Pekka Heikkila
Signed-off-by: Jani Nikula <jani.nikula@intel.com> Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com> Reviewed-by: Petri Latvala <petri.latvala@intel.com>
2020-05-07lib/i915: Split igt_require_gem() into i915/Chris Wilson
igt_require_gem() is a pecularity of i915/, move it out of the core. Similar opportunistic move of gem_reopen_driver() and gem_quiescent_gpu(). Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2020-05-01i915/gem_mmap_gtt: Simulate gdb inspecting a GTT mmap using ptrace()Chris Wilson
gdb uses ptrace() to peek and poke bytes of the target's address space. The kernel must implement an vm_ops->access() handler or else gdb will be unable to inspect the pointer and report it as out-of-bounds. Worse than useless as it causes immediate suspicion of the valid GTT pointer. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Acked-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
2020-01-29i915: Drop prefault controlsChris Wilson
They haven't been effective for a long time; so drop them. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Acked-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
2019-12-08i915/gem_mmap_gtt: Reduce RSS for fault-concurrentChris Wilson
The intent of exercising parallel page fault is not necessarily to exercise parallel swap-in (we can safely rely on that being well tested and is orthogonal to page faulting), but to make sure that our object and GGTT locking is exercised. We can safely reduce our RSS without loss of coverage. Furthermore, by using varying sizes we can exercise different code paths within page faulting, rather than all being serviced as partial mmaps. Instead of allocating 32 surfaces, each of 16MiB, we allocate 32 surfaces in incremental 512KiB sizes; halving the memory requirement. References: https://bugs.freedesktop.org/show_bug.cgi?id=111864 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Acked-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
2019-11-22i915/gem_mmap_gtt: Test mmap_gtt extension validityAbdiel Janulgue
If we accidentally modify the mmap_gtt ioctl struct sizes in our headers, we might end up feeding garbage into the ioctl and start validating that as our flags for the upcoming mmap_offset ioctl. This ensures header changes don't mess up with our existing mmap_gtt ioctl. Signed-off-by: Abdiel Janulgue <abdiel.janulgue@linux.intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2019-11-12i915: Mark up a few more tests that only target GGTTChris Wilson
If a test is only targeting the GGTT API and its corner cases, it can only run if we have a mappable aperture. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Antonio Argenziano <antonio.argenziano@intel.com> Acked-by: Antonio Argenziano <antonio.argenziano@intel.com>
2019-11-06i915/gem_mmap_gtt: Skip if we have no aperture and no mmap_gttChris Wilson
If the device does not expose an aperture for indirect access with detiling functionality, the kernel rejects an attempt to create such a mapping with -ENODEV. If the ioctl is not supported, we can skip all of our mmap_gtt specific tests. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Abdiel Janulgue <abdiel.janulgue@linux.intel.com> Cc: Matthew Auld <matthew.auld@intel.com> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com> Reviewed-by: Matthew Auld <matthew.auld@intel.com> Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
2019-09-24i915/gem_map_gtt: Escape from slow forked GTT accessChris Wilson
Beware the slithy t'oves. Forked GTT access on icl is notoriously slow, so rather than spend an eternity checking the whole object, check for a completion event after handling the pagefault. It's is the race of the pagefault vs reset that we care most about, and we expect the bug to result in the pagefault being blocked indefinitely, so checking afterwards does not reduce coverage. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com> Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
2019-09-17i915/gem_mmap_gtt: Replace forked-mmapped tests with a lighter variantChris Wilson
Introduce a new 2-process fork test that is bound to a single cpu to exercise contention during pagefaults. This is a much lighter variant of the all-cpus test intended to be viable even on the legendary frozen lakes of molasses. References: https://bugs.freedesktop.org/show_bug.cgi?id=110882 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com> Cc: Martin Peres <martin.peres@linux.intel.com> Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
2019-08-29i915/gem_mmap_gtt: Race mmap offset generation against closureChris Wilson
This simply checks that a few threads opening and closing handles do not cause explosion in other threads in the process of mmaping that handle. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Abdiel Janulgue <abdiel.janulgue@linux.intel.com> Reviewed-by: Abdiel Janulgue <abdiel.janulgue@linux.intel.com>
2019-08-13i915/gem_mmap_gtt: Test mmap_offset lifetimeChris Wilson
Closing the object on another file should not affect the local mmap_offset. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Abdiel Janulgue <abdiel.janulgue@linux.intel.com> Reviewed-by: Abdiel Janulgue <abdiel.janulgue@linux.intel.com>
2019-06-11i915/gem_mmap_gtt: Disregard forked subtests on ICL for reasonsChris Wilson
Nothing to see here, please move along. The short story seems to be that a BIOS update made concurrent GTT access a few orders of magnitude slower, severely hampering CI. Where the fault actually lies is unknown, and how to circumvent it, unknown. References: https://bugs.freedesktop.org/show_bug.cgi?id=110882 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com> Cc: Martin Peres <martin.peres@linux.intel.com> Acked-by: Daniel Vetter <daniel@ffwll.ch>
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-04-16i915/gem_mmap_gtt: Markup a couple of GTT set-domainsChris Wilson
We have to control the cache domains, especially important before first writing into the object. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
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-25i915: Mark up some forgotten set-domainChris Wilson
It is the user's responsibility to manage their domains. In libdrm, when you mmap a pointer, it calls set-domain automatically, but igt requires the caller to manage it explicitly, so do so. The vast majority already do correct manage the domain as they use the pointer into the mmap, just a few have been missed over the years. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.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_gtt: Add invalid parameters testAntonio Argenziano
Add a test for an invalid handle being passed to the 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>
2019-02-12i915/gem_mmap_gtt: Impose a timeout for "hang"Chris Wilson
Only wait a maximum of 2 more seconds for the hang children to complete, to catch deadlocks in a timely fashion. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Mika Kuoppala <mika.kuoppala@intel.com> Reviewed-by: Mika Kuoppala <mika.kuoppala@intel.com>
2019-01-24i915/gem_mmap_gtt: Reset faster and longer to catch fencing errorsChris Wilson
Performing a GPU reset clobbers the fence registers, affecting which addresses the tiled GTT mmap access. If the driver does not take precautions across a GPU reset, a client may read the wrong values (but only within their own buffer as the fence will only be degraded to I915_TILING_NONE, reducing the access area). However, as this requires performing a read using the indirect GTT at exactly the same time as the reset occurs, it can be quite difficult to catch, so repeat the test many times and across all cores simultaneously. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.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>