Since we hold an exclusive write lock we expect 2 writes to happen
serially, but we expect 2 reads to happen in parallel. Expand the testing
to demonstrate this effect (i.e. we expect read-read to be roughly 2x
faster than write-write for small copies on big core.)
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Many warnings of the form
gem_pread.c: In function ‘main’:
gem_pread.c:128:8: warning: assignment discards ‘const’ qualifier from
pointer target type [-Wdiscarded-qualifiers]
bps = bytes_per_sec(buf, object_size/usecs*1e6);
Regression from
commit 48c945322b4c5f6443758143cccb9c4c04da4aaa
Author: Ankitprasad Sharma <ankitprasad.r.sharma@intel.com>
Date: Wed Dec 2 14:54:51 2015 +0530
igt/gem_pread: Support to verify pread/pwrite for non-shmem backed obj
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This reverts commit 4f5efc5c844f6fe69209982463f9220f8f3951ed.
There was a bit a misunderstanding on IRC between Chris&me. We want
basic tests as sanity test to be run in the BAT CI. It's just unfortunate
that right now we have fairly limited ability to absorb new ones, both
because of a pile of existing bugs in the kernel and because the CI
infrastructure is still being scaled out.
The idea was just to remove the BAT tests added yesterday, not all of
the ones we've had for a while longer.
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Grumpily-acked-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
In times past, I added "basic" variants of tests just to ensure that the
general principle of operation was sound before proceeding on to the
main test (which typically looked at thrashing, i.e. were long and
tedious and pointless if the test didn't even work in the normal
situation). Since "basic" now collides with BAT, rename my trivial tests
to "sanitycheck".
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
As the concurrency tests are a good source of stress for
i915_wait_request() (the tests are primarily designed to ensure that GPU
activity of one form or another is completed before access by third
parties), one of the common form of errors we can detect are the
"missing interrupts" (i.e. where the waits do not terminate because of a
race between the interrupt and the seqno write). Add an explicit check
for this error and flag it as a definite fail - which also helps narrow
it down to certain subtests when run as a batch.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
When changing the sysfs GT min frequency, the kernel won't
automatcilly drop the GT frequency to idle unless the GPU
transitions from busy to idle.
Load the GPU after increasing the GT min frequency to force
a busy to idle transition. This matches the behavior when
decreasing the GT min frequency.
Signed-off-by: Bob Paauwe <bob.j.paauwe@intel.com>
Reviewed-by: Imre Deak <imre.deak@intel.com>
Using same timeout value as kms_fronbuffer_tracking and for
same reasons exposed at 'commit 83582f9b ("kms_frontbuffer_tracking:
Increase the time we wait for PSR.")'
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
These tests exercise the userptr ioctl to create shared buffers
between CPU and GPU. They contain error and normal usage scenarios.
They also contain a couple of stress tests which copy buffers between
CPU and GPU. These tests rely on the softpin patch in order to pin buffers
to a certain VA.
Caveat: These tests were designed to run on 64-bit system. Future work
includes adding logic to ensure these tests can run on 32-bit systems with
PPGTT support. Some tests are currently disabled for 32-bit systems for that
reason.
v2: Added cc and signed-off-by fields
v3: Fixed review comments, added helper functions. Removed userptr error
scenarios covered by existing userptr tests. Modified stress test to have
100K buffers, it now runs for ~30 mins, checks every element has been written
to correctly, and pins buffers at different VMAs.
v4: Changed name to gem_softpin
v5: More fixes. Removed the file based tests, will move them to userptr tests.
Added a function that validates appropriate PPGTT support before running tests.
Optimized stack space and memory footprint in stress test. Removed the eviction
test, will add it back after verifying proper functionality.
v6: Split basic test into userptr and bo
Fixed some coding style issues.
v7: Enhanced invalid vma pinning test to verify 32-bit PPGTT functionality.
Enabled the test for 32-bit PPGTT systems, and verify pinning fails above
32-bit addresses. Enhanced the high adress pinning test to ensure pinning
fails when EXEC_OBJECT_PINNED flag is not used. Some more cosmetic fixes to
close buffer handles. Changed userptr function to used synchronized operations.
v8: Minor change to high address pinning test as per comment.
v9: Skip the tests if softpin support is not present.
v10: Removed trailing white spaces.
v11: Keep alphabetical order in Makefile and gitignore; update error code
returned while trying to pin above the max vm size (EINVAL); test attempt
to pin above 4GB without the support 48b flag.
Cc: Michel Thierry <michel.thierry@intel.com>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Signed-off-by: Vinay Belgaumkar <vinay.belgaumkar@intel.com>
Signed-off-by: Michel Thierry <michel.thierry@intel.com> (v11)
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Since commit c8beadb811bdc2b9c21f95144852f3e55867b546
Author: Derek Morton <derek.j.morton@intel.com>
Date: Wed Nov 11 14:46:58 2015 +0000
tests/gem_exec_nop: Improved test run time
the stablity of the measurement regressed and it is once again no longer
a reliable metric for detecting regressions. Give up.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Derek Morton <derek.j.morton@intel.com>
Add a new subtest that makes sure old stale modes get pruned from the
connector's mode list when the EDID changes.
v2: s/drmModeGetConnector/drmModeGetConnectorCurrent/ since
kmstest_force_edid() already takes care of doing the heavier
call for us (Daniel)
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Although kms_frontbuffer_tracking already has psr-suspend testcase
this one here can complement it by testing different combination
and mainly covering 2 different cases individually:
1. wait-for-psr, suspend-resume tehn run 1 operation.
2. suspend-resume, wait-for-psr then run 1 operation.
v2: Remove no-suspend option since this should be done with piglit
if necessary for now.
v3: argh! remove remaining no-suspend checks...
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
commit 75b286e821 ("tests/kms_psr_sink_crc: test even
if PSR is disabled by default")' force PSR enabling without
respecting the no-psr (running-with-psr-disabled) option.
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Even with all sink crc re-works we still have platforms
where after 6 vblanks it is unable to calculate the
sink crc. But if we don't get the sink crc it isn't true
that test failed, but that we have no ways to say test
passed or failed.
So let's print a message and move forward in case sink crc
cannot help us to know if the screen has been updated.
v2: Also include a message on setup_sink_crc and also
only skip when it is mandatory, i.e. when running for PSR.
Acked-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Unfortunately Sink CRC is not 100% reliable for all platforms.
So we cannot block FBC tests nor skip them when we are getting
unreliable Sink CRC results, or not getting them at all.
Acked-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
With commit (drm/i915: Delay first PSR activation.) in kernel
PSR might take a bit longer to really activate after the modeset.
The first PSR activation after modeset is taking 5 times the panel
power cycle delay time, which is 600ms for our machines here.
So timeout here needs to be a minimum of 3s. However let's use
5s as the safe value in case we find machines with higher power
cycle delay.
Since we do a lot of assert(psr_disabled), this commit is increasing
the time it takes to run the whole set of PSR tests by a few minutes,
which had been reduced by commit f4db3b18841
("kms_frontbuffer_tracking: reduce the PSR wait timeout to 2s").
Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Since commit
commit aed242ff7ebb697e4dff912bd4dc7ec7192f7581
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date: Wed Mar 18 09:48:21 2015 +0000
drm/i915: Relax RPS contraints to allows setting minfreq on idle
it is now possible that the current frequency will drop be the user
specified minimum frequency to the "idle" or RPn frequency. Update the
pm_rps tests to reflect that droping below the user specified minimum
is no longer considered a failure.
v2: Add check RPn <= current freq. (Me)
v3: Use RPn instead of MIN frequency in idle check (Imre)
Signed-off-by: Bob Paauwe <bob.j.paauwe@intel.com>
Reviewed-by: Imre Deak <imre.deak@intel.com>
This way we correctly auto-skip instead of falling over the
lack of i915 debugfs files first and fail the testcase due to
that.
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Instead of failing. We might want to move this into i915 tests
eventually, but this is good for now.
v2: Use the correct exit code (Derek) and use the new symbolic values
Thomas added.
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
wait-ioctl skips a couple of side-effects of retiring, so provoke them
using set-domain before we sleep.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Forcing connector state is a basic piece of our test infrastructure
that we use in all the kms_ tests. It allows us to run tests even if
no outputs are connected.
They're also really fast, so perfect candidates for inclusion into the
BAT set.
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Speeds up testcases except for those where we want to exercise the
probing itself. The only exceptions left where we do a full probe are
- pm_rpm: We use it to make sure the kernel doesn't get things wrong
with power domains, so we really want to exercise the full probe
paths. And there the only place really is the specific validation
done with the data gathered by get_drm_info.
- kmstest_force_ functions: Newer kernels should be better at
re-probing state when the force sysfs fields change, but better safe
than sorry.
v2: I also consolidated the start_n_modes and start_connectors while
at it - move one of the fixup hunks to this patch that accidentally
got misplaced (Thomas).
Cc: Thomas Wood <thomas.wood@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
The edid we inject stayed the same, but the kernel started to list
more modes for it. No idea whether that's the right thing here since
I'm not really an EDID expert. But then again the testcase wants to
check that the injection works, not validate the kernel's parser.
v2: Only check the preferred mode for more future-proofing (Thomas).
v3: Clarify commit message (Jani).
Cc: Thomas Wood <thomas.wood@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
This test validates the two parameters (size and flags) GEM_CREATE ioctl.
v2: Added IGT_TEST_DESCRIPTION (Thomas Wood)
v3: Removed use of hard coded values, updated comments (Tvrtko)
v4: Removed over-use of macros, updated with multiples of PAGE_SIZE (Tvrtko)
Signed-off-by: Ankitprasad Sharma <ankitprasad.r.sharma@intel.com>
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
This patch adds support to verify pread/pwrite for non-shmem backed
objects. It also shows the pread/pwrite speed.
It also tests speeds for pread with and without user side page faults
v2: Fixed Rebase conflicts (Ankit)
v3: Precalculating values to avoid redundant function calls (Dave)
Replaced igt_subtest by igt_subtest_f, added asserts for mmap, corrected
indentation (Tvrtko)
v4: Updated data types to avoid redundant type conversions (Tvrtko)
Corrected pagefault-pread time calculation (Ankit)
Signed-off-by: Ankitprasad Sharma <ankitprasad.r.sharma@intel.com>
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
This patch adds the testcases for verifying the new extended
gem_create ioctl. By means of this extended ioctl, memory
placement of the GEM object can be specified, i.e. either
shmem or stolen memory.
These testcases include functional tests and interface tests for
testing the gem_create ioctl call for stolen memory placement
v2: Testing pread/pwrite functionality for stolen backed objects,
added local struct for extended gem_create and gem_get_aperture,
until headers catch up (Chris)
v3: Removed get_aperture related functions, extended gem_pread
to compare speeds for user pages with and without page faults,
unexposed local_gem_create struct, changed gem_create_stolen
usage (Chris)
v4: Splitting patch to remove changes from gem_pread/gem_pwrite
to another patch (Ankit)
v5: Fixed Rebase conflicts (Ankit)
Added IGT_TEST_DESCRIPTION (Thomas Wood)
v6: Added __gem_create_stolen for user to handle error, updated
gem_create_stolen to align with gem_create function, corrected
fill_purge test (out of bound access), added testcase to validate
allocating of more than 32 bit sized buffers (Tvrtko)
v7: Removed unused variables, Corrected comments & formatting (Tvrtko)
Signed-off-by: Ankitprasad Sharma <ankitprasad.r.sharma@intel.com>
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
The tests/NAMING-CONVENTION file has been removed and its contents is
now included in the API documentation.
Reported-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
The script uses the obsoleted and removed intel_reg_read tool. Rather
than mechanically fix this to use intel_reg, observe that the hardcoded
register offsets are platform specific. A quick glance suggests they are
for PCH split platforms with FDI, and as such useful only on a minority
of platforms. Remove the script as obsolete.
If the need for such a script arises, it should be based around using
'intel_reg dump' with display-only register spec files.
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Embarrasingly I noticed that I need to git add the file when resolving
the conflict and manually applying my patch. But then I added the
wrong file ... Reported by Thomas Wood.
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
The kernel is free to allocate blob ids however it wants to. And also
to reallocate them whenever it sees fit. The only thing we are allowed
to compare is the length and the actual date.
Removing this bogus check makes drm-resources-equal on my snb.
Cc: Paulo Zanoni <paulo.r.zanoni@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=90546
Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Tests that master state isn't leaked to new masters by checking
that auth magics for the old master don't work any more.
Based upon a simple test program provided by Thomas.
v2: Use comment Thomas suggested on intel-gfx.
Cc: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
It really is a core drm testcase and not a libdrm testcase. While at it
also make it generic, since it is.
Cc: Daniel Stone <daniels@collabora.com>
Acked-by: Daniel Stone <daniels@collabora.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
gem_set_caching() tries to be clever and detect when the ioctl isn't
supported (thereby skipping the test). However, it forget that we may be
acting on active objects and be subject to the usual EAGAIN/EINTR
errors. We can use the drmIoctl() to wrap the raw ioctl() in order to
get the automatic restart on the interrupted syscall.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
v4: re-bind the gem objects each time before calling
disable_all_screens_and_wait().
v3: Use smaller sizes when allocating gem objects for caching tests.
v2: use mmap to gtt instead off cpu and various style-changes.
Signed-off-by: Marius Vlad <marius.c.vlad@intel.com>
Reviewed-by: Imre Deak <imre.deak@intel.com>
Signed-off-by: Imre Deak <imre.deak@intel.com>
During the review of a recent FBC patch, Ville pointed a problem that
happens when we use the page flip IOCTL to switch between buffers that
have different tiling formats. This test should catch the problem
introduced by that patch - which was not merged, by the way, so the
test should be passing.
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>