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>
We use igt_create_fb(), which decides the stride by itself: there's no
guarantee that making a buffer 512 pixels bigger is going to make its
stride change.
I had a fix for this problem that was supposed to be applied before
this patch, but due to a rework request I'm changing the order of the
patches, so we should expect to hit this assertion for now. At least
the root cause of the problem is clear now.
v2: Update the commit message due to the patch order changing.
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Make those subtests try to change the stride using multiple APIs so we
can catch errors that affect full modesets, fast modesets and page
flips.
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Add a new FLIP_PLANES enum so we can do "page flips" using it too. The
goal is to exercise the fast modeset paths on the Kernel.
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
If the caller is going to specify a custom size, it's likely that he
will also specify a custom stride. The automatic stride picked by
create_bo_for_fb() is too huge for tiled buffers, so if the caller
wants smaller buffers, then he'll need a smaller stride too, otherwise
the Kernel will reject the addfb IOCTL due to stride * height being
bigger than the size.
I want to make tests/kms_frontbuffer_tracking use
igt_create_fb_with_bo_size() so I can provide smaller buffers that
will fit into the CFB. I'm also planning to make all frontbuffers with
the same width/height/format have the same stride and size regardless
of tiling method so I can exercise specific code paths.
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
If we pass zero as the bo_size we won't get the minimum needed size,
we'll just get a size that works. The size is decided by
create_bo_for_fb(). The selected size is really not minimal for tiled
objects.
We'll implement support for minimum size later.
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
I want to have a little more control over the size of the buffers in
kms_frontbuffer_tracking, so I decided to start calling
igt_create_fb_with_bo_size() instead of igt_create_fb(). The problem
is that create_bo_for_fb() returns its own calculated size as size_ret
instead of the actual used size.
So we fix this by returning the actual size, the one used in
gem_create instead of the calculated size that's not used anywhere.
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
We assume that lock is held on start of the loop scope.
Some paths continuing inside loop didn't adhere to this
assumption, causing segfault on unlocking an already
unlocked mutex. Fix this by re-aquiring lock always.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93013
Cc: Michał Winiarski <michal.winiarski@intel.com>
Cc: Thomas Wood <thomas.wood@intel.com>
Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
Reviewed-by: Michał Winiarski <michal.winiarski@intel.com>
In theory, this should force i915_gem_fault() when we first use the
buffer (and not at mmap time) and so prevent a __copy_to_user_inatomic()
from writting to the buffer.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
CLOCK_MONOTONIC_RAW is not affected by NTP, so it should be THE clock
used for timing execution of tests.
When fetching either the starting or ending time of a test, show the
time as -1.000s.
v6:
- Whitespace corrections (Chris)
v5:
- Do not use C99 style comments (Chris)
v4:
- Introduce time_valid macro (Chris)
- Reduce amount of boilerplate code for calculating elapsed time
v3:
- Do not exit directly from handler (Chris)
- Show elapsed time as -1 if it is not calculable
v2:
- Cache the used clock (Chris)
- Do not change the clock during execution
- Spit out and error if monotonic time can not be read
Cc: Thomas Wood <thomas.wood@intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
Add the Kabylake GT4 PCI IDs as defined in this kernel patch.
commit 8b10c0cf21ec84618d4bf02c73c0543500ece68d
Author: Deepak S <deepak.s@intel.com>
Date: Wed Oct 28 12:21:12 2015 -0700
drm/i915/kbl: Add Kabylake GT4 PCI ID
Signed-off-by: Wayne Boyer <wayne.boyer@intel.com>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
Remove the KBL check from IS_SKYLAKE() following the kernel definition.
Then, add the KBL check to IS_GEN9().
The idea is to avoid confusion. On the kernel side, the mix of SKY
and KBL was nacked so the platforms are split.
Signed-off-by: Wayne Boyer <wayne.boyer@intel.com>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
aubdump.c uses dlsym(), so it needs to link with -ldl. Otherwise:
/bin/sh: symbol lookup error: /usr/lib64/intel_aubdump.so: undefined symbol: dlsym
Signed-off-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
Test designed to trigger the
WARN_ON(!list_empty(&ppgtt->base.active_list))
in i915_gem_context_clean.
v2:
Simplify execbuf building and the test itself. Cleanup code. (Chris Wilson)
v3:
Removed asserts done by the helpers already. (Chris Wilson)
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Benchmark the overhead of changing from GTT to CPU domains and vice
versa. Effectively this measures the cost of a clflush, and how well the
driver can avoid them.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
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 power metter was not showing up due to an erroneous check for a
failure to open the i915 perf interface.
Reported-by: Marius Vlad <marius.c.vlad@intel.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
In this subtest, as a first step, MAX_FENCES+1 number of framebuffers are
created backed up by objects that have multiple GGTT views (normal and
rotated). Next, we have the i915 driver instantiate a normal view followed
by a rotated view. We continue doing the above MAX_FENCES + 1 times.
v2:
- Add a igt_require() to check if there is enough GTT space left for
MAX_FENCES+1 framebuffers. (Tvrtko)
- Make data2 local to test_plane_rotation_exhaust_fences(). (Tvrtko)
- If there is a failure, deallocate all the previously allocated
framebuffers before asserting.
v3: Close the gem handle if set_tiling or addfb fails. (Tvrtko)
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Signed-off-by: Vivek Kasireddy <vivek.kasireddy@intel.com>
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
We don't allow ARGB8888 anymore on primary planes on most platforms,
so use XRGB8888 instead as the format.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>