Age | Commit message (Collapse) | Author |
|
With the new engine query method engines are reachable through
an index and context they are combined with.
The 'gem_has_ring()' becomes 'gem_context_has_engine()' that
requires the index that the engine is mapped within the driver.
The function has been moved from lib/ioctl_wappers to
lib/i915/gem_context where it is more appropriate.
The previous 'gem_has_ring()' function becomes a wrapper to the
new 'gem_context_has_engine()'.
Signed-off-by: Andi Shyti <andi.shyti@intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
|
|
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>
|
|
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>
|
|
Move all mmap flavours and support function to separate file in i915
folder. This helps with moving i915 specific functions away from common
libraries.
v2:
- Autotools still exists. (Petri)
- Include gem_mman.h directly. (Chris)
v3:
- Keep includes explicit. (Chris)
Signed-off-by: Antonio Argenziano <antonio.argenziano@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Petri Latvala <petri.latvala@intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
vmwgfx and amdgpu doesn't support fb modifiers, yet kms_addfb() requires
modifier support. Since many tests don't need this to run, the
requirement can be made less broad.
Therefore, tighten the requirement to cases where modifiers are actually
needed.
v2:
* In create_fb() calls to kms_addfb(), remove the modifier flag iff the
driver doesn't support modifiers and the modifer is 0
* Don't modify the flag in kms_addfb().
Signed-off-by: Deepak Rawat <drawat@vmware.com>
Signed-off-by: Leo Li <sunpeng.li@amd.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
|
|
Nobody uses the function directly, instead using the various helpers to
determine if ppgtt is present.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
|
|
Currently __kms_addfb() assumes that only the first plane can be
at offset 0. I don't particularly like such assumptions so let's
just pass in the number of planes explicitly.
We'll also require offsets[] to be passed in always. Nothing really
to gain by making it optional.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
|
|
Make __kms_addfb() usable with planar formats by passing in the
stride for each plane.
v2: Handle strides[1] for planar formats in kms_available_modes_crc
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
|
|
Setup a userptr object that only has a read-only mapping back to a file
store (memfd). Then attempt to write into that mapping using the GPU and
assert that those writes do not land (while also writing via a writable
userptr mapping into the same memfd to verify that the GPU is working!)
v2: Pull the random batch construction into a routine to avoid
duplication.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
|
|
Pollable spin batch exports a spin->running pointer which can be checked
by dereferencing it to see if the spinner is actually executing on the
GPU.
This is useful for tests which want to make sure they do not proceed with
their next step whilst the spinner is potentially only being processed by
the driver and not actually executing.
Pollable spinner can be created with igt_spin_batch_new_poll or
__igt_spin_batch_new_poll, after which igt_spin_busywait_until_running can
be used to busy wait until it is executing.
v2:
* Move READ_ONCE to igt_core.
* Add igt_spin_busywait_until_running. (Chris Wilson)
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Add support to create planar framebuffers, but don't add formats
that support them yet. This first requires conversion to the RGB24 format.
Changes since v1:
- Don't crash in igt_create_bo_with_dimensions().
Changes since v2:
- Zero offsets for dumb fb too.
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Reviewed-by: Mika Kahola <mika.kahola@intel.com>
[mlankhorst: Change memset(4 * ..) to memset(ARRAY_SIZE(format->plane_bpp) * ..)]
|
|
We'd like to make ioctl_wrappers a bit thinner, and we plan to add new
helpers in the following patch. Let's move context related helpers before
adding more content.
Signed-off-by: Michał Winiarski <michal.winiarski@intel.com>
Cc: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Katarzyna Dec <katarzyna.dec@intel.com>
Cc: Petri Latvala <petri.latvala@intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Katarzyna Dec <katarzyna.dec@intel.com>
Acked-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
|
|
Couple of tests are using either determining scheduler capabilities or
pretty printing. Let's move those to helpers in lib. We can also keep
the value obtained from getparam static.
v2: Break the trend of expanding ioctl_wrappers
Signed-off-by: Michał Winiarski <michal.winiarski@intel.com>
Cc: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Katarzyna Dec <katarzyna.dec@intel.com>
Cc: Petri Latvala <petri.latvala@intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Katarzyna Dec <katarzyna.dec@intel.com>
Acked-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
|
|
We want to create very large objects, larger than the 2G limit imposed
by using ints.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
Reviwed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
|
|
We have two style of ioctl wrappers. The principle interface does error
checking on behalf of the caller (to avoid having lots of repetitious
code in each test), and for the few cases where the error is important
for the test, we also expose a double underscore version. Fix up
__gem_create() to follow this pattern and report the negative error code
returned by the kernel.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
|
|
The early gen3 machines inherited the MI block and restrictions from
gen2, and may only use physical addresses in conjunction with
MI_STORE_DATA_IMM -- that makes it unusable for us from userspace, where
we can only use virtual offsets.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
|
|
Soon we will have tests that are only for platforms with reset-engine
(GEN8+), so add a helper to query the has_gpu_reset via the getparam ioctl.
v2: Add more helper functions to avoid using magic numbers in tests (Arek).
Cc: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
Signed-off-by: Michel Thierry <michel.thierry@intel.com>
Acked-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
|
|
gem_execbuf_wr was duplicated in multiple places.
Moving everything to lib/
Signed-off-by: Lukasz Fiedorowicz <lukasz.fiedorowicz@intel.com>
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
|
|
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
When the memory backing the userptr object is released by the user, but the
BO itself is not closed, it's possible to trigger recursive deadlock
caused by operations done on different BO mapped in that region.
Testcases are simulating such behaviour by using MAP_FIXED mmap flag.
Signed-off-by: Michał Winiarski <michal.winiarski@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
|
|
Trying to execbuf with a purged object is meant to fail.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
SIGRTMAX appears to be used by valgrind now for its internal tracking,
so avoid it in the helpers.
Also add some valgrind annotations in gem_mmap, to make sure that its
accesses are tracked correctly. I've also added gem_munmap, but there
are a lot of places that don't use it yet in tests/.
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
|
|
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Added a subtest for invalid FENCE_IN usage, updated invalid-flag subtest
and made the rsvd2 test skip when exec fences are available.
Signed-off-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Add a few subtests that check that lossless compressed render targets
are properly displayed. Also test a few error conditions.
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Cc: Ben Widawsky <ben@bwidawsk.net>
Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Acked-by: Ben Widawsky <ben@bwidawsk.net>
|
|
The opposite direction of to_user_pointer() is from_user_pointer().
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Add to_user_pointer() helper function which helps cast
pointers properly when being used with ioctls.
Signed-off-by: Robert Foss <robert.foss@collabora.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Context BAN_PERIOD will get depracated so subsitute it with BANNABLE
property. Make ctx param test to accept both variants for now
until kernel changes have landed, to not break BAT.
v2: check against - EINVAL on get/set ban as it can return -EPERM
v3: better naming for get/set (Chris)
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
|
|
The kernel tries to hide L-shaped memory with asymmetric swizzling from
userspace by reporting lies through the get-tiling interface. Check for
these lies by comparing the reported swizzle with the actual swizzle,
and only run swizzling tests where we know the underlying physical
swizzling.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97108
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Avoid macro expansion inside the asserts so that the error messages are
readable.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Check for available stolen memory size before attempting to run
the stolen memory tests. This way we make sure that we do not
create objects from stolen memory without knowing the available size.
This checks if the kernel supports creation of stolen backed objects
before doing any operation on stolen backed objects.
Also correcting the CREATE_VERSION ioctl number in getparam ioctl,
due to kernel changes added in between.
v2: Removed size argument for checking stolen memory availability (Tvrtko)
Signed-off-by: Ankitprasad Sharma <ankitprasad.r.sharma@intel.com>
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
|
|
- Give __ prefix to internal funcstion and structs, only
igt_interruptible is used by tests.
- Move docs to igt_interruptible and adjust.
- Explain more clearly how the timeout is getting doubled each
iteration until no more interruptions happen. Also rename the
argument to give it a more meaningful name in the docs.
- Link from other functions to this one for cross-referencing.
- Rename to igt_do_interruptible to make it clearer it's a loop,
inspired by do {} while () loops.
v2: Rename instead to igt_while_interruptible and fix typos (Chris).
And add gtk-doc for igt_ioctl, too.
Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
|
|
The MOCS registers were added in Gen9 and define the caching policy.
The registers are split into two sets. The first set controls the
EDRAM policy and have a set for each engine, the second set controls
the L3 policy. The two sets use the same index.
The RCS registers and the L3CC registers are stored in the RCS context.
The test checks that the registers are correct by checking the values by
directly reading them via MMIO, then again it tests them by reading them
from within a batch buffer. RCS engine is tested last as it programs the
registers via a batch buffer and this will invalidate the test for
workloads that don't use the render ring or don't run a render batch
first.
v2: Reorganised the structure.
Added more tests. (Chris Wilson)
v3: Fixed a few bugs. (Chris Wilson)
v4: More Tidy-ups. (Chris Wilson)
SKL does does not have a snoop bit. (Peter Antoine)
Signed-off-by: Peter Antoine <peter.antoine@intel.com>
|
|
Insted of calling drmIoctl() directly, call igt_ioctl() instead. In the
normal scenario this is function pointer that calls drmIoctl() (so no
penalty), but allows us to divert ioctls into our own routines for
nefarious purposes. One such purpose will be to control interrupt
generation into the ioctl, to be able to detect when we successfully
interrupt the ioctl and when we no longer need more interrupts.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
No users so time to die.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
No one uses this nor should they as it just gem_get_param() in disguise
and they are better feature queries for whether individual execution
engines are functional.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Check that the system operates normally before and after the suspend (as
well as across the suspend). The goal is to isolate the breakage to the
subtest.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Allow read-only synchronisation on dmabuf mmaps, useful to allow
concurrent read-read testing between the CPU and GPU.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
We intend to use gem_wait() in more tests than gem_wait.c, so move the
simple ioctl wrapper into the core.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Missed an error whilst rebasing and trying to modify the previous patch
to keep this function intact... Instead, I now have to add this patch to
restore gem_available_aperture_size() and its one usage.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
For many tests, the relevant aperture is not the ppGTT but the internal
global GTT managed by the kernel. Use this limit appropriately.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
This patch adds dma-buf mmap synchronization ioctls that can be used by tests
for cache coherency management e.g. when CPU and GPU domains are being accessed
through dma-buf at the same time.
v7: add sync invalid flags test.
Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
|
|
This patch adds test_correct_cpu_write, which maps the texture buffer through a
prime fd and then writes directly to it using the CPU. It stresses the driver
to guarantee cache synchronization among the different domains.
This test also adds test_forked_cpu_write, which creates the GEM bo in one
process and pass the prime handle of the it to another process, which in turn
uses the handle only to map and write. Roughly speaking this test simulates
Chrome OS architecture, where the Web content ("unpriviledged process") maps
and CPU-draws a buffer, which was previously allocated in the GPU process
("priviledged process").
This requires kernel modifications (Daniel Thompson's "drm: prime: Honour
O_RDWR during prime-handle-to-fd") and therefore prime_handle_to_fd_for_mmap is
added to fail in case these lack. Also, upcoming tests (e.g. next patch) are
going to use it as well, so make it public and available in the lib.
v2: adds prime_handle_to_fd_with_mmap for skipping test in older kernels and
test for invalid flags.
Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
|
|
This patch moves userptr definitions and helpers implementation that were
locally in gem_userptr_benchmark and gem_userptr_blits to the library, so other
tests can make use of them as well. There's no functional changes.
v2: added __ function to differentiate when errors want to be handled back in
the caller; bring gem_userptr_sync back to gem_userptr_blits; added gtkdoc.
v8: remove local_i915_gem_userptr from gem_concurrent_all.c to use the global
helpers instead.
Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
|
|
An oft-repeated function to check EXECBUFFER2 for a particular fail
condition.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
We can move it from softpin test into lib, and since softpin support is
highly unlikely to go away in-between getparam ioctl calls, let's just
do a single call and store the value.
v2: rebase
Signed-off-by: Michał Winiarski <michal.winiarski@intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
|
|
No functional changes.
While I'm here, let's also rename gem_uses_aliasing_ppgtt (since it's
being used to indicate if we are using ANY kind of ppgtt) and introduce
gem_uses_full_ppgtt to drop some unnecessary code from tests that were
previously calling getparam directly instead of using ioctl wrapper.
v2: drop gem_uses_full_48b_ppgtt since it's no longer used anywhere,
s/48b/64b (Chris)
v3: rebase
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Michał Winiarski <michal.winiarski@intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
|
|
Some potential callers want to inject a hang into a particular context,
some want to trigger an actual ban and others may or may not want to
capture the associated error state. Expand the hang injection interface
to suit all.
v2: Disable the new kernel API, but push to provide a missing piece of
infrastucture to unbreak compilation.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|