3683 Commits

Author SHA1 Message Date
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
Paulo Zanoni
ffd7321c70 kms_frontbuffer_tracking: use the dirty ioctl after MMAP_WC calls
We can't add this to igt_draw since igt_draw doesn't care whether it's
writing on a frontbuffer or not.

PS: the ENOSYS is for Kernels without the patch implementing the
IOCTL.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2015-08-05 17:21:48 -03:00
Paulo Zanoni
cd33b47a47 tests/gem_mmap_wc: don't fail if the Kernel is too old for the getparam flag
Just don't check the drmIoctl() return code: the "if (val)" should be
enough to prevent any problems.

v2: Don't SKIP, just proceed (Chris).

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89739
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2015-08-05 17:18:45 -03:00
Kristian Høgsberg Kristensen
5f9bc98a55 configure.ac: Fix chmod on intel_aubdump the right way
autoconf executes the init commands after each file it creates,
causing these errors at configure time:

  ...
  chmod: cannot access 'tools/intel_aubdump': No such file or directory
  config.status: creating tools/Makefile
  chmod: cannot access 'tools/intel_aubdump': No such file or directory
  config.status: creating tools/intel_aubdump
  config.status: creating tools/quick_dump/Makefile
  ...

Once it creates intel_aubdump, the errors go away. When I first added
the chmod command, I already had a tools/intel_aubdump in my tree and
didn't get the error.

Split the intel_aubdump creation into its own AC_CONFIG_FILES()
invocation to avoid this.

Signed-off-by: Kristian Høgsberg Kristensen <kristian.h.kristensen@intel.com>
2015-08-05 11:58:59 -07:00
Kristian Høgsberg Kristensen
78e2a2f245 tools: Use right #include path for i915_drm.h
pkg-config adds /usr/include/libdrm to the include path so we only need i915_drm.h

Signed-off-by: Kristian Høgsberg Kristensen <kristian.h.kristensen@intel.com>
2015-08-05 11:53:17 -07:00
Kristian Høgsberg Kristensen
86de4c60f3 configure.ac: Fix the intel_aubdump chmod to use topbuilddir
Signed-off-by: Kristian Høgsberg Kristensen <kristian.h.kristensen@intel.com>
2015-08-04 15:11:55 -07:00
Kristian Høgsberg Kristensen
220c7d1f91 tools/aubdump: Add --device option for overriding device ID
This lets us capture AUB traces for platforms different from the one
we're running on.

Signed-off-by: Kristian Høgsberg Kristensen <kristian.h.kristensen@intel.com>
2015-08-04 15:00:50 -07:00
Kristian Høgsberg Kristensen
f47bdba8b0 tools/aubdump.c: Also define struct drm_i915_gem_userptr for compatibility
Oops, we obviously also need to define the argument struct for userptr.

Signed-off-by: Kristian Høgsberg Kristensen <kristian.h.kristensen@intel.com>
2015-08-04 09:36:53 -07:00
Kristian Høgsberg Kristensen
e4fa17df02 tools/aubdump: #define DRM_IOCTL_I915_GEM_USERPTR if kernel headers don't
Fix compile error on older kernels.

Signed-off-by: Kristian Høgsberg Kristensen <kristian.h.kristensen@intel.com>
2015-07-31 14:26:15 -07:00
Kristian Høgsberg Kristensen
0b5faefba3 tools: Add man page for intel_aubdump
Signed-off-by: Kristian Høgsberg Kristensen <kristian.h.kristensen@intel.com>
2015-07-31 13:44:07 -07:00
Kristian Høgsberg Kristensen
e6a5d799fc tools: Add LD_PRELOAD-based AUB dumper tool
This does everything the aub dump functionality in libdrm does, but
without being part of libdrm.  This moves the very developer oriented
functionality out of core libdrm and adds some flexibility in how we
activate it (we can specify filename, for example).  Most importantly,
this lets us dump aub files for tools and/or drivers that don't use
libdrm, without having to add that code to each of those projects.

The tool is used much like strace or valgrind.  For example:

  $ intel_aubdump -v --output=stuff.aub -- glxgears -geometry 500x500

will launch glxgears with its options and enable aub dumping and pass
the -v and --output=stuff.aub options to the aub dumper.

Signed-off-by: Kristian Høgsberg Kristensen <kristian.h.kristensen@intel.com>
2015-07-31 10:40:04 -07:00
Daniel Vetter
6bd42ce9c7 tests/kms_addfb: Add testcass for garbage in unused planes
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2015-07-30 20:45:46 +02:00
Chris Wilson
0591af9c76 igt/gem_streaming_writes: Reorder setting EXEC_OBJECT_WRITE
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=90944
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-07-28 20:12:03 +01:00
Chris Wilson
40ebf95163 igt/gem_streaming_writes: Bind into the GTT early
If we are using a streaming GGTT write into the source, we need to
trigger an early fault in order to obtain a mappable offset. This is
required when later we start reserving execbuf object top-down to try
and avoid mappable space!

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-07-28 19:01:41 +01:00
Chris Wilson
cd306d4e65 benchmark: Measure allocation time for objects
A basic measurement, how fast can we create and populate an object with
backing storage?

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-07-24 18:56:00 +01:00
Chris Wilson
42a386b83b benchmarks: Measure mmap fault latency
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-07-24 18:55:49 +01:00
Chris Wilson
e984d4965f benchmarks: Benchmarkify gem_exec_ctx
Measure the overhead of execution when doing nothing, switching between
a pair of contexts, or creating a new context every time.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-07-24 18:55:49 +01:00
Michał Winiarski
d49a868378 tests/drm_import_export: Add tests for prime/flink sharing races
It is possible to race between unreference of the underlying BO and
importing it from prime_fd/name. Verify that the behaviour of libdrm
is consistent for prime/flink.

v2: more comments in source file, dropped extra whitespace

Signed-off-by: Michał Winiarski <michal.winiarski@intel.com>
Cc: Thomas Wood <thomas.wood@intel.com>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-07-24 15:55:18 +01:00
Chris Wilson
e14507ce98 benchmarks: Add kms_vblank to .gitignore
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-07-24 14:16:44 +01:00
Chris Wilson
d88981f62b benchmarks: Measure round-trip time for an immediate vblanks
By measuring both the query and the event round trip time, we can make a
reasonable estimate of how long it takes for the query to send the
vblank following an interrupt.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-07-23 15:52:53 +01:00
Chris Wilson
af510c249d benchmarks: gem_prw add the read/write switch to getopt
In my haste to merge the two gem_pread/gem_pwrite, I forgot to write up
the command line switch to getopt.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-07-23 12:30:06 +01:00
Chris Wilson
f8628a2c98 benchmarks: Add simple mmap benchmarks
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-07-23 12:20:43 +01:00
Chris Wilson
f689e2aa81 benchmarks: Add simple pread/pwrite benchmarks
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-07-23 12:20:05 +01:00
Chris Wilson
b7c33e0939 benchmarks: Benchmarkify gem_exec_nop
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-07-22 15:14:05 +01:00
Thomas Wood
a64cf28719 man: ensure rst files are included in the distribution tarball
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-07-20 18:13:37 +01:00
Dominik Zeromski
3676912970 lib/gpgpu_fill: Add SKL support
SKL changed state base address command.

Cc: Thomas Wood <thomas.wood@intel.com>
Signed-off-by: Dominik Zeromski <dominik.zeromski@intel.com>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-07-20 18:13:37 +01:00
Dominik Zeromski
a017c2905a lib/gpgpu_fill: Add BDW support
BDW changed structure of surface state and interface descriptors.
Commands like state base address, gpgpu walker were extended.

Cc: Thomas Wood <thomas.wood@intel.com>
Signed-off-by: Dominik Zeromski <dominik.zeromski@intel.com>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-07-20 18:13:37 +01:00
Dominik Zeromski
ed816d560c lib: Move gpgpu_fill code to separate file
The gpgpu fill utility functions are used in separate test so it's
logical to keep them in separate file. This is similar to what media
spin test did in the past.

Functionally only gpgpu kernel changed. Send instruction payload size
was reduced. Since offset is incremented by 0x10 bytes there is no point
in using larger writes.

Cc: Thomas Wood <thomas.wood@intel.com>
Signed-off-by: Dominik Zeromski <dominik.zeromski@intel.com>
[Thomas: Fix typo of gpgpu_fill.h in Makefile.sources]
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-07-20 18:13:37 +01:00
Derek Morton
3c294a8fa3 Android.mk: Disable tools that do not build for android
Disable the tools / demo code that do not currently build
for android until they can be fixed.

Affected tools / demos
intel_display_crc
intel_sprite_on

v2: intel_display_crc compiled conditionally on ANDROID_HAS_CAIRO
flag.
v3: removed intel_reg from the skip list as Thomas has prepared
a patch to fix it for Android.

Signed-off-by: Derek Morton <derek.j.morton@intel.com>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-07-20 18:13:37 +01:00
Thomas Wood
e65c69b995 lib: exit immediately if igt_fail is called in an exit handler
Exit immediately if the test is already exiting and igt_fail is called.
This can happen if an igt_assert fails in an exit handler.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91349
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-07-20 18:13:37 +01:00
Thomas Wood
51576b7ad6 tools/Android.mk: add any extra program sources
v2: remove unintended change and fix source file duplication errors
    (Derek Morton)

Cc: Derek Morton <derek.j.morton@intel.com>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-07-20 18:13:37 +01:00
Thomas Wood
80f1553780 intel_reg: support platforms without sys/io.h
Based on an idea from Jani Nikula.

Cc: Jani Nikula <jani.nikula@intel.com>
Cc: Derek Morton <derek.j.morton@intel.com>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-07-20 18:13:37 +01:00
Chris Wilson
0705ce6d15 igt/stats: Fixup tests to compile after interface changes
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-07-19 18:19:29 +01:00
Chris Wilson
d9c3f0b50c tools: Add a simple stats generator 'igt_stats'
A rudimentary tool on top of the igt_stats library. Reads a list of
numbers from stdin or from a file and prints the estimate of the central
location, aka average.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-07-19 15:30:23 +01:00
Chris Wilson
8506cdcaa5 lib: Allow storing floating point values in igt_stats
We don't always have precise integers with which to store, so allow
degrading to double precision floating point based on available input.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-07-19 15:30:23 +01:00
Michał Winiarski
fdefdd48f6 tests/gem_reg_read: Extend and check for valid 36b counter
When reading the timestamp register with single 64b read, we are observing
invalid values on x86_64:

    [f = valid counter value | X = garbage]

    i386:   0x0000000fffffffff
    x86_64: 0xffffffffXXXXXXXX

Test checks if the counter is moving and increasing.
Add a check to see if we can use (reg | 1) flag to get a proper 36b timestamp,
shifting the value on x86_64 if we can't.

v2: More iterations of monotonic test, comments, minor fixups (Chris)
v3: Skip tests if reg_read is not supported

Cc: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Michał Winiarski <michal.winiarski@intel.com>
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2015-07-16 13:06:13 +01:00
Chris Wilson
32c898849b igt/gem_eio: Waiting on a hung batch should report -EIO
If we are waiting on a handle, and its request is cancelled due to a
hang, we should report that explicitly through the ABI.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-07-15 22:09:54 +01:00
Paulo Zanoni
7f952bd976 kms_frontbuffer_tracking: don't keep debugfs open
Make the code smaller and simpler, also ready for when we move
debugfs_read() to lib/.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2015-07-14 15:21:26 -03:00
Paulo Zanoni
1048aa9aa5 tests: add kms_fbcon_fbt
This test should test the interactions between fbcon and the
frontbuffer tracking infrastructure.

Right now the PSR test fails, but as soon as we merge the following
kernel patches, the test wills tart passing:
 - drm/i915: PSR: Flush means invalidate + flush
 - drm/i915: fbdev restore mode needs to invalidate frontbuffer
 - drm/i915: fbdev_set_par reliably invalidating frontbuffer

I didn't want to make this a subtest of kms_frontbuffer_tracking just
because when I wrote it, I really didn't have in mind the fact that
someone might just close the DRM fd in the middle of a subtest.

After this commit we'll have a little bit of duplicated code among
tests. I'll clean this up later.

v2:
  - Refactor the code a little bit.
  - Add the suspend subtests.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2015-07-14 15:20:57 -03:00
Paulo Zanoni
7c5a218cc3 kms_frontbuffer_tracking: implement suspend subtest
Make sure we survive suspend/resume.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2015-07-14 13:06:41 -03:00
Paulo Zanoni
1c389f69f0 kms_frontbuffer_tracking: allow passing a NULL pattern
So we don't need to initialize CRCs we won't use. This makes the
modesetfrombusy and badstride tests a little faster.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2015-07-14 13:06:08 -03:00
Paulo Zanoni
91f097aefa kms_frontbuffer_tracking: simplify subtest enumeration
Just a small bikeshed.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2015-07-14 13:05:40 -03:00
Paulo Zanoni
04d1311fc3 kms_frontbuffer_tracking: add farfromfence subtest
Make sure we notice in case our crtc->y handling is still wrong.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2015-07-14 13:05:12 -03:00
Paulo Zanoni
cb3861a9e3 kms_frontbuffer_tracking: implement badstride test
Test strides that are either completely invalid or just result in
disabled FBC.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2015-07-14 13:04:23 -03:00