3776 Commits

Author SHA1 Message Date
Paulo Zanoni
9194f4efdf lib/igt_draw: fix pwrite_tiled()
Don't forget to flush in case we're in the last iteration of the loop.
This fixes failures of kms_frontbuffer_tracking when used with
--use-small-modes on eDP monitors.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2015-08-14 15:28:07 -03:00
Paulo Zanoni
caaf3b869f lib/igt_draw: add support for RGB565 and XRGB2101010
We need to test those pixel formats on the FBC code, so let's make
sure the drawing library works on them first.

v2: Update the gtkdoc (Daniel).

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2015-08-14 15:27:19 -03:00
Paulo Zanoni
a1fce7490c lib/igt_core: use print("%s", #expr) instead of print(#expr)
If I have a program with the following:

    igt_skip_on(i % 2 == 0);
    igt_skip_on_f(i % 2 == 0, "i:%d\n", i);
    igt_require(i % 2 == 0);
    igt_require_f(i % 2 == 0, "i:%d\n", i);

then I'll get compiler error messages complaining about format
conversions related to the '%' character used in the mod operation. So
put the whole string as a %s argument to avoid interpreting '%' and
any other possible chars.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2015-08-14 15:26:28 -03:00
Jesse Barnes
87a5f2d776 tests/kms_setmode: mark simple clone test as basic
Should cover simple, single CRTC mode sets.

Reviewed-by: Daniel Vetter <daniel@ffwll.ch>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2015-08-14 09:27:33 -07:00
Jesse Barnes
e5839d240a tests/kms_flip: add basic tests for flip, flip vs dpms, and flip modeset v2
Simple variants that don't do multiple output or interruptible testing.

v2: add vblank variant, remove duplication (Daniel)

Reviewed-by: Daniel Vetter <daniel@ffwll.ch>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2015-08-14 09:27:33 -07:00
Jesse Barnes
5134f2c96d tests/pm_rpm: mark RTE and D3 tests as basic
These always need to pass for basic PM functionality.

Reviewed-by: Daniel Vetter <daniel@ffwll.ch>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2015-08-14 09:27:33 -07:00
Jesse Barnes
68d1b532fa tests/pm_backlight: mark simple test as basic
We should be able to adjust the backlight and observe changes in sysfs.

Reviewed-by: Daniel Vetter <daniel@ffwll.ch>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2015-08-14 09:27:33 -07:00
Jesse Barnes
ec4b76872d tests/kms_addfb: mark simple fb creation tests as basic v2
We should always be able to create simple and tiled objects.

v2: make the whole test basic (Daniel)
    add to .gitignore

Reviewed-by: Daniel Vetter <daniel@ffwll.ch>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2015-08-14 09:27:33 -07:00
Jesse Barnes
503420944d tests/gem_tiled_pread: mark normal tests as basic v2
These simple tests should always pass.

v2: drop pwrite variant as it's more of a stress test (Daniel)
    add to .gitignore

Reviewed-by: Daniel Vetter <daniel@ffwll.ch>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2015-08-14 09:27:33 -07:00
Jesse Barnes
5001640718 tests/gem_pread/pwrite: mark normal tests as basic
These should always pass.

Reviewed-by: Daniel Vetter <daniel@ffwll.ch>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2015-08-14 09:27:33 -07:00
Jesse Barnes
c51c1ed776 tests/gem_mmap_gtt: mark basic access and copy tests as basic v2
These ones should always pass and are fairly quick.

v2: add more tests (Daniel)

Reviewed-by: Daniel Vetter <daniel@ffwll.ch>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2015-08-14 09:27:33 -07:00
Jesse Barnes
90c47b2947 tests/gem_mmap: mark basic object creation tests as basic
We should be able to create small and moderate sized objects quickly and
without errors.

Reviewed-by: Daniel Vetter <daniel@ffwll.ch>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2015-08-14 09:27:30 -07:00
Jesse Barnes
b0d8d73d8b tests/drv_getparams: mark EU and subslice fetch as basic v2
Fundamental and simple functionality.

v2: make whole test basic (Daniel)
    add to .gitignore

Reviewed-by: Daniel Vetter <daniel@ffwll.ch>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2015-08-14 09:26:12 -07:00
Jesse Barnes
e920d719b2 tests/gem_flink, prime_self_import: mark flink and prime tests as basic v2
They're testing basic functionality and don't involve stress or race
induction.

v2: use gem_flink and prime_self_import tests instead (Daniel)
    add to .gitignore

Reviewed-by: Daniel Vetter <daniel@ffwll.ch>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2015-08-14 09:26:12 -07:00
Jesse Barnes
dc9505a405 tests/drv_module_reload_basic: use linear_blits after module_reload for sanity check
Reduces runtime a lot...

Reviewed-by: Daniel Vetter <daniel@ffwll.ch>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2015-08-14 09:26:12 -07:00
Jesse Barnes
4409c83284 tests/drv_module_reload: rename drv_module_reload to include in BATs
Absolutely-acked-by: Daniel Vetter <daniel@ffwll.ch>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2015-08-14 09:26:12 -07:00
Jesse Barnes
0679702150 tests/gem_storedw_loop: add new store_dword test to unify per-ring ones v2
There was a lot of duplication going on...  Mark as basic while we're at
it as these should never fail.

v2: add to .gitignore

Reviewed-by: Daniel Vetter <daniel@ffwll.ch>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2015-08-14 09:26:12 -07:00
Chris Wilson
d568f69d5d igt/gem_mmap: Add one more extra large bo
Daniel complained that all the tests in gem_mmap.c were too quick. This
one aims to rectify that by double checking that if we mmap a buffer
larger enough to force swapping, everything still works.

Also fix the test to exercise the different object sizes!

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-08-14 14:08:05 +01:00
Chris Wilson
8af62be2ad lib: Allow caller to use uint64_t sizes with intel_require_memory()
Allow the caller to ask how many extra large objects can be created and
still fit into memory.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-08-14 14:07:43 +01:00
Mika Kuoppala
5c07135b7b tools/null_state/gen9: Send all components in VF state
Fix

commit 59cdc16b1a6f069f944ff17851a59edf8f72d45d
Author: Arun Siluvery <arun.siluvery@linux.intel.com>
Date:   Fri Jul 31 16:27:07 2015 +0100

    tools/null_state/gen9: Send atleast one valid component in VF state

to honor the Reviewed-by, send all four components as noted by
Ben in his review.

Cc: Ben Widawsky <benjamin.widawsky@intel.com>
Cc: Arun Siluvery <arun.siluvery@linux.intel.com>
Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
2015-08-13 16:18:55 +03:00
Paulo Zanoni
c049096eb6 kms_frontbuffer_tracking: don't test SPR or CUR on multidraw
The goal of the multidraw subtest is to check if alternating drawing
methods can somehow break the feature. The plane we're drawing to
really shouldn't matter here - we have other tests to make sure
drawing on the different planes works correctly. So after this patch
we'll only run the multidraw subtest for the primary plane, not for
sprite and cursors anymore.

This makes "--no-edp --fbc-only --1p-only" go from 2m29s to 1m40s on
my machine.

Of course, we can still run these tests with the --show-hidden flag.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2015-08-13 10:08:33 -03:00
Paulo Zanoni
78d076268c kms_frontbuffer_tracking: don't test CUR or SPR planes on FBS_SHARED
We already tested these planes for FBS_INDIVIDUAL, and there are no
reasons to believe those planes will behave differently under
FBS_SHARED, so save some time avoiding potentially useless tests.

This makes "--no-edp --fbc-only --1p-only" go from 2m49s to 2m29s on
my machine.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2015-08-13 10:07:56 -03:00
Arun Siluvery
59cdc16b1a tools/null_state/gen9: Send atleast one valid component in VF state
A programming restriction exists for this instruction, atleast one component
of one valid vertex element must be enabled.

Cc: Ben Widawsky <benjamin.widawsky@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Arun Siluvery <arun.siluvery@linux.intel.com>
Reviewed-by: Ben Widawsky <benjamin.widawsky@intel.com>
Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
2015-08-13 15:20:32 +03:00
Arun Siluvery
dd82494724 lib/rendercopy_gen9: Setup Push constant pointer before sending BTP commands
From Gen9, by default push constant command is not committed to the shader unit
untill the corresponding shader's BTP_* command is parsed. This is the
behaviour when set shader is enabled. This patch updates the batch to follow
this requirement otherwise it results in gpu hang.

Set shader need to be disabled if legacy behaviour is required.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89959
Cc: Ben Widawsky <benjamin.widawsky@intel.com>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: Mika Kuoppala <mika.kuoppala@intel.com>
Signed-off-by: Arun Siluvery <arun.siluvery@linux.intel.com>
Tested-by: Mika Kuoppala <mika.kuoppala@intel.com>
Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
2015-08-13 15:20:19 +03:00
Mika Kuoppala
8a68ec1453 lib/rendercopy_gen9: WaBindlessSurfaceStateModifyEnable
Don't set the size of bindless surface state on rendercopy.
And as of doing so, take into account the workaround for setting
the command size.

This was tried during hunting for
https://bugs.freedesktop.org/show_bug.cgi?id=89959. But no
impact was found.

Cc: Arun Siluvery <arun.siluvery@linux.intel.com>
Reviewed-by: Arun Siluvery <arun.siluvery@linux.intel.com>
Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
2015-08-13 15:17:19 +03:00
Derek Morton
d524a964fc benckmarks/Android.mk: Fix building benchmarks for Android
The commit "benchmarks: Do not install to system-wide bin/" changed
the benchmark file list from bin_PROGRAMS to benchmarks_PROGRAMS.
However Android.mk was not updated, resulting in IGT failing to
build for Android.
This commit adds that change. It also adds LOCAL_MODULE_PATH to
specify where the built benchmarks should be put.

v2: I discovered that the existing definitions of LOCAL_MODULE_PATH
were creating what should have been an invalid path. Not sure how it
was ever working previously, but fixed now.

Signed-off-by: Derek Morton <derek.j.morton@intel.com>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-08-13 11:28:22 +01:00
Kristian Høgsberg Kristensen
33bc41aa41 aubdump: Write header after figuring out the gen
We have to defer figuring out the gen until we have a PCI ID, which we
don't have for sure until the first execbuffer2 ioctl. We can't write
the file header until we have the gen since we need to know the size of
offsets in the file format.  Move the call to write_header() into the
dump_execbuffer2() where we have the gen.

Signed-off-by: Kristian Høgsberg Kristensen <kristian.h.kristensen@intel.com>
2015-08-12 08:58:00 -07:00
Kristian Høgsberg Kristensen
3156305ace aubdump: Handle 48 bit ppgtt dumping
Put 48 bit block offsets in the AUB file and track the bo offsets with
uint64_t.

Signed-off-by: Kristian Høgsberg Kristensen <kristian.h.kristensen@intel.com>
2015-08-12 08:58:00 -07:00
Thomas Wood
8a7c386f0a tests: update .gitignore
Add missing entry to .gitignore and sort alphabetically.

Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-08-12 16:33:58 +01:00
Ville Syrjälä
a149fb238a tests/gem_pwrite_snooped: Verify set_caching vs. pwrite clflush behaviour
The test does the following
1. set_domain src GTT
2. set_caching src NONE
3. pwrite src
4. set_caching src CACHED
5. blt src->dst
6. pread dst
7. verify data matches

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2015-08-12 16:24:51 +03:00
Ville Syrjälä
62426feec5 tests/kms_pwrite_crc: Use drmModeSetPlane() instead of igt_plane_set_fb()
igt_plane_set_fb()+igt_display_commit() have too much overhead, and that
causes the cache to get flushed before we flip, making the test
useless, at least on machines with small LLC. Switch to
drmModeSetPlane() to reduce the chance that the cache gets flushed
before we grab the crc.

Still nowhere near 100% reliable on my IVB laptop with 3 MiB LLC,
but at least it can now hit the problem occasioanally. My desktop
IVB with 8 MiB LLC seems to hit it rather reliably.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2015-08-12 16:24:50 +03:00
Daniel Vetter
adfc294384 tests: Document ABI extension catchers
Our invalid-flags/params testcases are meant to catch abi extensions
by just testing for the next available flag/param. Unfortunately we
need that since without those we forgot to write testcases for these
new flags way too often :(

But it's not entirely clear why this is, so document this trick with
comments.

Also gem_wait wasn't this paranoid, so change the testcase to be so.

Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2015-08-12 14:46:46 +02:00
Daniel Vetter
5b0a8433fd lib/core: Add igt_reset_timeout
Convenience wrapper suggested by Chris for igt_set_timeout(0, NULL).

v2: While at it add an empty line in kms_flip to make
set/reset_timeout a visual block.

Cc: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2015-08-12 14:46:46 +02:00
Daniel Vetter
370c989723 lib/core: Add optional reason for timeout failure
"Timed out" isn't a terribly informative message, allow users to set
something more informative. Inspired by a request from Jesse.

Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2015-08-12 14:46:40 +02:00
David Weinehall
24617ef82a tests/gem_ctx_param_basic: support NO_ZEROMAP
Signed-off-by: David Weinehall <david.weinehall@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-08-12 14:42:46 +02:00
Chris Wilson
38b3bd6b7c benchmarks: Add a microbenchmark for relocation overhead
Allow specification of the many different busyness modes and relocation
interfaces, along with the number of buffers to use and relocations.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-08-11 15:31:02 +01:00
Chris Wilson
98bcc18572 benchmarks/gem_exec_trace: Unmap each trace after replay
Just on the off chance someone is replaying a bunch of traces, remember
to cleanup up.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-08-10 18:53:26 +01:00
Chris Wilson
b483e68173 benchmarks/gem_exec_trace: Mark the mmap as sequentially read
Use madvise(MADV_SEQUENTIAL) to let the kernel optimise for our
straightforward sequential read pattern.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-08-10 18:53:26 +01:00
Chris Wilson
3911621d0d benchmarks: Rename the gem_exec_trace tracer module
Now that we actually install the benchmarks into a sane location,
slightly abuse it to put the tracer for gem_exec_trace alongside.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-08-10 18:24:15 +01:00
Chris Wilson
d9462e61f9 benchmarks/gem_exec_trace: Clear all new bo handles
When reallocing the bo array, remember to set the new entries to 0.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-08-10 16:16:36 +01:00
Chris Wilson
4c74a683c1 benchmarks: Do not install to system-wide bin/
These benchmarks are first-and-foremost development tools, not aimed at
general users. As such they should not be installed into the system-wide
bin/ directory, but installed into libexec/.

v2: Now actually install beneath ${libexec}

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-08-10 15:53:08 +01:00
Chris Wilson
0393e7288b benchmarks: Record and replay calls to EXECBUFFER2
This slightly idealises the behaviour of clients with the aim of
measuring the kernel overhead of different workloads. This test focuses
on the cost of relocating batchbuffers.

A trace file is generated with an LD_PRELOAD intercept around
execbuffer, which we can then replay at our leisure. The replay replaces
the real buffers with a set of empty ones so the only thing that the
kernel has to do is parse the relocations. but without a real workload
we lose the impact of having to rewrite active buffers.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-08-09 19:20:46 +01:00
Chris Wilson
74a8068086 overlay: Handle execlists not setting the rings as active
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-08-08 21:31:54 +01:00
Chris Wilson
06aed34d38 overlay: Add Broadwell+ ids from kernel i915_pciids.h 2015-08-08 21:31:54 +01:00
Kristian Høgsberg
9c15167c61 tools/aubdump: Get PCI ID from getparam ioctl when we can
Instead of doing an extra getparam ioctl to discover the PCI ID, we
can snoop it when the application queries it.

Signed-off-by: Kristian Høgsberg <krh@cryptic-dragon.jf.intel.com>
2015-08-07 15:00:32 -07:00
Kristian Høgsberg
5f4fad3182 tools/aubdump: Don't rely on open for discovering the drm fd
DRI3 passes the drm fd over X protocol and as such we can't rely on
hooking open to discover the drm fd. Instead we look for drm ioctl
codes in the ioctl wrapper. If we don't have a drm fd and see
something that looks like a drm ioctl, we stat the fd to see if it's a
drm fd.  If it is, we save it for later so we don't have to do an
extra stat on every ioctl.  We can then drop the open wrapper, but we
keep the close wrapper so we can invalidate our cached drm_fd if it's
closed.

Signed-off-by: Kristian Høgsberg <krh@cryptic-dragon.jf.intel.com>
2015-08-07 14:59:56 -07:00
Jesse Barnes
db0f28aee8 Revert "tests/gem_ctx_param_basic: fix invalid params"
This reverts commit 0b45b0746f45deea11670a8b2c949776bbbef55c.

We want to check against our local copy of the params so we can at least
potentially catch new flag additions.

Requested-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2015-08-06 14:35:34 -07:00
Jesse Barnes
0b45b0746f tests/gem_ctx_param_basic: fix invalid params
Use -1 as the invalid param since we've added more since this test was
created, causing expected EINVAL failures to return an unexpected error
code.

Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2015-08-06 13:17:48 -07:00
Derek Morton
1ae1d290bf benchmarks/Android.mk, tools/Android.mk: Fix android build error
Recently added tools / benckmarks have the same module name as
existing tests. Android does not allow duplicate modules. This
patch appends _benchmark and _tool to the module names used when
building benckmarks and tools to prevent clashes with tests of
the same name.

Signed-off-by: Derek Morton <derek.j.morton@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-08-06 14:39:44 +02:00
Paulo Zanoni
995f2738ad lib: add igt_debugfs_read()
A helpful function for when you want to read a whole debugfs file to a
string and don't want to worry about opening and closing file
descriptors and asserting buffer sizes.

We've been using this already for kms_frontbuffer_tracking and
kms_fbcon_fbt, so the only test with new code here is kms_fbc_crc.

Also notice that for kms_fbc_crc we had to increase the buffer size
since the file can sometimes be bigger than 64 bytes - depending on
the reason why FBC is disabled.

Of course, there are probably many other programs we can patch, but
I'm not doing this now.

v2: Add the macro to wrap sizeof() (Daniel).
v3: Add documentation for the macro too (Daniel).

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2015-08-05 17:30:58 -03:00