Do a dry run with rtcwake first to determine if the system even supports
the intended suspend state. If not, skip the test.
Fixes a bunch of stuff on my BYT FFRD8 that doesn't support S3.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Don't try to test invaliud pipe/port combos. Fixes the test on
VLV w/ DSI since the pipe<->DSI port mapping is fixed. Should also
fix other platforms with similar restrictions.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
We need a new ioctl to find the correct GTT size to use when submitting
execbuffers (as opposed to wishing to know the global GTT size).
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
We've had bugs in the past that caused cursor updates to be synced to
vblank, resulting in sluggish cursor movement. Add a test to try to
make sure we don't regress and reintroduce these bugs.
Cc: kalyan.kondapally@intel.com
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
Apparently GCC treats the #pragma directive as a code block and so we
returned unconditionally from memchr_inv() on the first byte fubaring
the test.
commit b04691b3e8e62bd105f0f4d8d3b9e7da187f0c90
Author: Thomas Wood <thomas.wood@intel.com>
Date: Tue Sep 8 11:16:46 2015 +0100
tests/gem_pwrite_snooped: disable const cast warning
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=92227
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
core_prop_blob was using ioctls not in the android kernel. Added a
igt_require_propblob() function and local defines/structures so the
test will compile and skip on kernels where the feature is unsupported.
v2: moved igt_require_propblob() to core_prop_blob.c (Daniel Vetter)
Moved gem_blt.c to a seperate patch (Thomas Wood)
Signed-off-by: Derek Morton <derek.j.morton@intel.com>
[Thomas: fix compiler warning]
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
Do some page flipping on the rotated plane just to exercise
that code path.
v2: Actually render to flip fb and fixed flip counter.
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Cc: Sonika Jindal <sonika.jindal@intel.com>
Cc: Arun R Murthy <arun.r.murthy@intel.com>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
Gen9 adds some new capabilities not present on previous platforms
(primary plane windowing, 90/270 rotation, etc.). Add a new subtest to
check how these new features interact with the use of the universal
plane API.
For now we just check whether pageflips work as expected in a windowed
setting. We may want to add some rotation testing in future patches.
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
Also, following kernel definition Kabylake is Skylake.
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
This patch adds support for dumping audio registers of Broxton.
Signed-off-by: Lu, Han <han.lu@intel.com>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
Rename the current gem_mmap__{cpu,gtt,wc}() functions into
__gem_mmap__{cpu,gtt,wc}(), and add back wrappers with the original name
that assert that the pointer is valid. Most callers will expect a valid
pointer and shouldn't have to bother with failures.
To avoid changing anything (yet), sed 's/gem_mmap__/__gem_mmap__/g'
over the entire codebase.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Stochastically-reviwewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Cairo helpfully allocates a new buffer for us when
cairo_image_surface_create_for_data() is called with a NULL ptr. That
means if gem_mmap__gtt() fails, we get a totally silent failure and
nothing ever drawn into the framebuffer. Very confusing.
Put in an igt_assert() to make sure we managed to mmap something.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Stochastically-reviwewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Do the following
ptr = gem_mmap__{cpu,gtt,wc}()
+igt_assert(ptr);
whenever the code doesn't handle the NULL ptr in any kind of
specific way.
Makes it easier to move the assert into gem_mmap__{cpu,gtt,wc}() itself.
Mostly done with coccinelle, with some manual cleanups:
@@
identifier I;
@@
<... when != igt_assert(I)
when != igt_require(I)
when != igt_require_f(I, ...)
when != I != NULL
when != I == NULL
(
I = gem_mmap__gtt(...);
+ igt_assert(I);
|
I = gem_mmap__cpu(...);
+ igt_assert(I);
|
I = gem_mmap__wc(...);
+ igt_assert(I);
)
...>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Stochastically-reviwewed-by: Chris Wilson <chris@chris-wilson.co.uk>
gem_mmap__{cpu,gtt,wc} never return MAP_FAILED, it gets converted to
NULL internally. So don't go asserting that the returned value is
not MAP_FAILED.
Done with coccinelle:
@@
type T;
identifier I;
@@
(
I = gem_mmap__gtt(...);
|
I = gem_mmap__cpu(...);
|
I = gem_mmap__wc(...);
)
...
(
- igt_assert(I != MAP_FAILED);
+ igt_assert(I);
|
- igt_assert(I && I != MAP_FAILED);
+ igt_assert(I);
|
- igt_assert(I != (T *) MAP_FAILED);
+ igt_assert(I);
|
- igt_assert(I != NULL);
+ igt_assert(I);
)
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Stochastically-reviwewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Get rid of the gem_mmap() alias of gem_mmap__gtt(). I don't see any
point in having it.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Stochastically-reviwewed-by: Chris Wilson <chris@chris-wilson.co.uk>
The current upstream Kernel code stops and then restarts FBC at every
page flip. I am working on patches to keep FBC enabled all the time,
so this brings the possibility of having the hardware tracking
mechanism looking at the old buffer instead of the new one. This test
should catch this problem.
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
There's no reason to do a mode unset since we don't care about whether
FBC or PSR are enabled or disabled. This should save about a second
for each time you invoke the program.
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
It's not testing a lot since we lack the Kernel Stolen Memory Checker,
but some day this will be useful.
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
... instead of just setting it for the fullscreen_plane subtest and
then unsetting it. We want to use it more, so just make sure all the
code knows how to deal with multiple planes per CRTC.
This also allows us to do some upfront caching of the plane
information, so the code for the tests gets simpler.
There's a new test that's going to use all these changes.
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Exercises the new blob-creation ioctl, testing lifetimes and behaviour
of user-created blobs, as well as exercising all the invariant
conditions we guarantee from modes exposed as blob properties.
v2: Renamed to core_prop_blob, skip test if blob not available.
v3: No changes.
v4: Consistently return 0/errno.
v5: Use do_ioctl_err and igt_assert_fd.
Use igt_assert_*() helper macros rather than direct igt_assert().
Signed-off-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Daniel Vetter <daniel.vetter@intel.com>
do_ioctl demands that the ioctl returns success; add a variant named
do_ioctl_err, which expects the ioctl to fail, and demands a particular
result.
Signed-off-by: Daniel Stone <daniels@collabora.com>
Logical negation is hard.
v2: The second integer isn't plural (Daniel).
Cc: "Morton, Derek J" <derek.j.morton@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Execute N blits and time how long they complete to measure both GPU
limited bandwidth and submission overhead.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Android M-Dessert treats implicit declaration of function warnings
as errors resulting in igt failing to build.
This patch fixes the errors by including missing header files as
required. Mostly this involved including igt.h in the benchmarks.
Signed-off-by: Derek Morton <derek.j.morton@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
The code is confused about the units of CODE_TIME. The comment
says 50 microsseconds, but the actual code makes it 50
milliseconds. Avoid the whole mess by measuring the sleep
duration ourselves. Since the time measurement is taken around
the whole operation it obviously includes a bit of extra, but
at least it's much less than the fixed 50 ms.
For instance on one VLV board I now get something like this:
- Residency in rc6 or deeper state: 3002 ms (ratio to expected duration: 0.98)
+ Residency in rc6 or deeper state: 3001 ms (sleep duration 3003 ms) (ratio to expected duration: 1.00)
so the reported ratio is now much closer to reality.
Reviewed-by: Imre Deak <imre.deak@intel.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
When testing all modes on a connector with a single mode, if the modeset
fails, the code attempts to remove fb_info[-1], because old_fb still has
the inital value of -1.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=90625
Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
Test that VMAs associated with a context are cleaned up when
contexts are destroyed.
In practice this emulates the leak seen between fbcon and X server.
Every time the X server exits we gain one VMA on the fbcon frame
buffer object as externally visible via for example
/sys/kernel/debug/dri/0/i915_gem_gtt.
v2: Use igt_debugfs_open, getline and strstr instead of home-brewed
string matching. (Thomas Wood)
v3: Rebase for drm_open_driver.
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Cc: Thomas Wood <thomas.wood@intel.com>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
Dereferencing a NULL pointer is undefined behaviour and may not always
result in a segmentation fault. Explicitly raise the SIGSEGV signal to
test handling of this signal.
v2: include signal.h (Derek Morton)
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
Commit fb66cd5 (tests/gem_storedw_loop: Fix use after free for bufmgr)
introduced a segmentation fault when listing subtests because
drm_intel_bufmgr_destroy is called with NULL. Move this and the call to
the close function inside an igt_fixture block to prevent them being
called when listing subtests.
Cc: Robert Beckett <robert.beckett@intel.com>
Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
Move bufmgr destruction to end of tests. This avoids use after free on
successive tests.
This could be squashed with the following patch to aid bisectability:
commit 0679702150157706a6def66b893b29c16345f4db
Author: Jesse Barnes <jbarnes@virtuousgeek.org>
Date: Wed Aug 5 16:06:31 2015 -0700
tests/gem_storedw_loop: add new store_dword test to unify per-ring ones v2
Signed-off-by: Robert Beckett <robert.beckett@intel.com>
Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
The test expects an ioctl failure when it tries to set
CONTEXT_PARAM_NO_ZEROMAP from a non-root process. However, there is no
requirement in the kernel for the user to be root to set this parameter,
so the test is failing (it never passed as far as I'm aware of).
Fix the test by making it expect a successful ioctl completion.
Signed-off-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
The requirement for these macros was removed in commit af97918 (tools:
remove quick_dump).
Reported-by: Ben Widawsky <benjamin.widawsky@intel.com>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
This allows multiple subtests to be specified using standard wildcard
characters when using the --run-subtest command line option.
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
Add a script to take a piglit results file and create a list of tests
that ran in under 60 seconds. This list can be used by the --test-list
option of piglit.
v2: exclude incomplete tests
Signed-off-by: Thomas Wood <thomas.wood@intel.com>