Age | Commit message (Collapse) | Author |
|
Since the introduction of debugfs/i915_drop_caches, we have offered the
ability to wait upon all outstanding batches. This is more efficient and
less error prone (one example is the use of context priorities, we have
to idle at the lowest in order not to jump over any low priority tasks
we want to wait upon) than trying to do it all in userspace. Though we
could if we wanted to, it's just easier to use the existing facility
designed for the purpose -- that we were already partially using!
Note that debugfs/i915_drop_caches has only existed since v4.2.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Reviewed-by: Petri Latvala <petri.latvala@intel.com>
|
|
It looks like there are some rogue processes running in CI that prevent
DRM_MASTER from being obtained. Dump the list of clients on failure to
make it more obvious what is being left behind.
v2: Fix up gtkdocs, meson build
References: https://bugs.freedesktop.org/show_bug.cgi?id=104157
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
|
|
If we asked to open a particular chipset and we find no matching device,
try again after attempting to load its module. Previously we only did
this for vgem, which is not automatically probed during boot, but if we
want to leave the module unloaded we have to try harder when we need the
device.
v2: DRIVER_* are already masks (and not shifts). Use a common
driver_open for both /dev/dri/cardX and /dev/dri/renderDX.
v3: Beware making local variables accidentally static scoped.
v4: Beware multiple threads trying and failing to open a device
v5: Fixed spelling of render (Petri)
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Petri Latvala <petri.latvala@intel.com>
Reviewed-by: Petri Latvala <petri.latvala@intel.com>
|
|
"other" was misspelled as "otehr". Fix it.
Signed-off-by: Thierry Reding <treding@nvidia.com>
|
|
As part of the general procedure for ensuring the GPU is idle, we also
want to ask the driver to flush its idle_worker. The idle_worker is
responsible for releasing both the driver's internal cache of buffers
and cache of state (such as the prolonged GT wakeref). By flushing the
idle_worker we ensure that each test (each caller needing an idle gpu)
has a clean slate; not carrying over caches from one test to the next.
Note this is a silent no-op for kernels that do not know about DROP_IDLE,
old bugs will remain.
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>
|
|
Also, we are _GNU_SOURCE, so simplify the conditions accordingly.
The next patch will remove _GNU_SOURCE everywhere else.
Reviewed-by: Eric Anholt <eric@anholt.net>
Acked-by: Jani Nikula <jani.nikula@intel.com>
Acked-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
Acked-by: Petri Latvala <petri.latvala@intel.com>
Acked-by: Daniel Stone <daniels@collabora.com>
Acked-by: Radoslaw Szwichtenberg <radoslaw.szwichtenberg@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
|
|
I spent too much time going wtf why does this test not run until
realizing that vgem is missing. This should help a lot for tests that
need multiple different drm drivers.
v2: Distinguish "any" and "other" (Chris).
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
|
|
Simple copy and replace of the CUnit tests inside libdrm to form a basis
for further prime integration testing.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
For an as of yet unknown reason, calling system("modprobe") from inside
igt/gem_wait causes kasan to spend 1-5 minutes copying the process
pagetables. This evaporates if we replace the fork-happy call to system
with a call to load the module using libkmod. So be it.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
This reverts commit 25fbae15262cf570e207e62f50e7c5233e06bc67, restoring
commit 301ad44cdf1b868b1ab89096721da91fa8541fdc
Author: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Date: Thu Mar 2 10:37:11 2017 +0100
lib: Open debugfs files for the given DRM device
with fixes.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
This reverts commit 301ad44cdf1b868b1ab89096721da91fa8541fdc.
When a render-only device is opened and gem_quiescent_gpu is called, we
need to use the debugfs dir for the master device instead.
Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
|
|
When opening a DRM debugfs file, locate the right path based on the
given DRM device FD.
This is needed so, in setups with more than one DRM device, any
operations on debugfs files affect the expected DRM device.
v2: - rebased and fixed new API additions
v3: - updated chamelium test, which was missed previously
- use the minor of the device for the debugfs path, not the major
- have a proper exit handler for calling igt_hpd_storm_reset with the
right device fd.
Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Reviewed-by: Robert Foss <robert.foss@collabora.com>
Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
A lot of igt testcases need some GPU workload to make sure a race
window is big enough. Unfortunately having a fixed amount of
workload leads to spurious test failures or overly long runtimes
on some fast/slow platforms. This library contains functionality
to submit GPU workloads that should consume exactly a specific
amount of time.
Since v14: Since we are using multiple signals, walk list of batches
to terminate a batch to avoid using a single global batch. Cycle signals
between SIGRTMIN and SIGRTMAX properly.
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: tomeu@tomeuvizoso.net
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Signed-off-by: Abdiel Janulgue <abdiel.janulgue@linux.intel.com>
|
|
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Fixes: 9921aff583ac ("lib/drmtest: Take DRIVER_ANY into account when opening the DRM device")
Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
|
|
__drm_open_driver was changed to bail out on VGEM devices unless they
are explicitly asked for (DRIVER_VGEM). But with that change we lost
support for DRIVER_ANY.
Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Fixes: 7ce63894854d ("lib: Support opening vGEM device")
Cc: Chris Wilson <chris@chris-wilson.co.uk>
|
|
If we opened the driver multiple times, we would not flush i915 if it
was opened second. The persistence of one test state into a second can
upset third parties, e.g. prime_vgem upsetting vgem_basic (due to
references from i915.ko to vgem.ko preventing module unload).
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Petri Latvala <petri.latvala@intel.com>
|
|
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
The __ prefixed functions are there to report the error and should not
automatically skip, which is handled by the normal unprefixed variant.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Support the virtio GPU on drmtest.
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
|
|
Now other gpus are supported too.
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
|
|
Several years ago we made the plan of only having one canonical source
for i915_pciids.h, the kernel and everyone importing their definitions
from that. For consistency, we style the intel_device_info after the
kernel, most notably using a generation mask and a per-codename bitfield.
This first step converts looking up the generation for a devid tree from
a massive if(devid)-chain to a (cached) table lookup.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
When opening the device, we first ensure the device is idle. However,
performing GEM operations on !i915 is bad behaviour, so don't.
Signed-off-by: Robert Foss <robert.foss@collabora.com>
|
|
Silly compiler emitting warnings that just cause people to break code
attempting to silence the compiler.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Pass -s switch to modprobe so that we don't litter stderr with the error
message for a missing module - the load failure is sufficient.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
|
|
Lib and test code can use this function to avoid i915-specific behavior
when running on other drivers.
Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
|
|
Add function that requires that the driver we are talking to is i915.
This allows us to skip subtests that are specific to that driver.
Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
|
|
As it reflects more clearly what the function actually does.
Suggested-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
|
|
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
When flushing work and idling the GPU, we need to flush all engines,
including the forgotten BSD2.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Daniel Stone <daniels@collabora.com>
|
|
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
|
|
Now that we have better ioctl wrappers, let's make us of them. The
advantage should be in improved error reporting in case
gem_quiescent_gpu() ever fails.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
The drm_open_driver*() functions replace the drm_open_any*() functions and
provide the same utility, but in a way that is platform agnostic, not
intel-specific. This opens the path for adopting intel-gpu-tools to non-intel
platforms.
This commit renames the calls and adds the chipset parameter which can be used
to restrict the opening to a specific hardware family. For example,
drm_open_driver(DRIVER_INTEL) will only return a valid fd if an intel GPU is
found on the system, along with performing intel-specific initialization stuff
like gem_quiescent_gpu(), et al. If OPEN_ANY_GPU is specified, the first
available drm device of any type will be opened.
Other hardware type flags may be added in the future.
The drm_open_any*() calls are retained as aliases of
drm_open_driver*(OPEN_ANY_GPU) but will be removed in a subsequent patch.
Signed-off-by: Micah Fedke <micah.fedke@collabora.co.uk>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
|
|
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
|
|
The DRM device id for the igfx is fixed, since there can only be one in
the system. So once we query it for the first time we can safely report
that value on every subsequent request, cutting out a lot of noisy
ioctls from inside tests.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Also move forcewake and stop_rings code from igt_debugfs to igt_gt
since it fits better. And move the hang injection fork helpers from
igt_aux to igt_gt, too.
Also push the intel_gen call into igt_hang_ring while at it.
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
|
|
As drm_open_any() now quietly fails if there is no driver, this
nullifies the effectiviness of using gem_exec_nop as the test for a good
reload. Combine with gem_alive (and guarantee that gem_alive can detect
a dead driver, putting lie to
commit 032f30cb38bb03562ee7fde19cd278b1d8ac31a9
Author: Thomas Wood <thomas.wood@intel.com>
Date: Tue Jan 13 13:33:57 2015 +0000
lib: remove unnecessary checks on the drm_open_any return value
) first.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=88573
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
drm_open_any always returns a valid file descriptor, so there is no need
to check the return value.
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
|
|
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
|
|
Signed-off-by: Imre Deak <imre.deak@intel.com>
|
|
Before issuing any i915 specific ioctls, check the driver is i915
otherwise we make other drivers emit nasty errors at the start of every
test.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
|
|
Clear all the ioctl structs to zero before use as valgrind does not our
ioctls and so complains about undefined bytes being passed to syscalls.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Actually only the igt_core was breaking the make distcheck,
but let's make it consistent and let the code cleaner.
Credits-to: Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@gmail.com>
|
|
If we dup the fd, we are in mercy of the context banning
of the test application. Better to have our own to guarantee
that gem_quiescent_gpu won't find itself banned on exit.
Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
|
|
Multiple tests are introducing hangs by fidding with i915_ring_stop
debugfs entry.
Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
|