16 Commits

Author SHA1 Message Date
Ville Syrjälä
f52e7ec787 Replace __gem_mmap__{cpu,gtt,wc}() + igt_assert() with gem_mmap__{cpu,gtt,wc}()
gem_mmap__{cpu,gtt,wc}() already has the assert built in, so replace
 __gem_mmap__{cpu,gtt,wc}() + igt_assert() with it.

Mostly done with coccinelle, with some manual help:
@@
identifier I;
expression E1, E2, E3, E4, E5, E6;
@@
(
-  I = __gem_mmap__gtt(E1, E2, E3, E4);
+  I = gem_mmap__gtt(E1, E2, E3, E4);
...
-  igt_assert(I);
|
-  I = __gem_mmap__cpu(E1, E2, E3, E4, E5);
+  I = gem_mmap__cpu(E1, E2, E3, E4, E5);
...
-  igt_assert(I);
|
-  I = __gem_mmap__wc(E1, E2, E3, E4, E5);
+  I = gem_mmap__wc(E1, E2, E3, E4, E5);
...
-  igt_assert(I);
)

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Stochastically-reviwewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-10-12 19:57:58 +03:00
Ville Syrjälä
b8a77dd6c8 Make gem_mmap__{cpu,gtt,wc}() assert on failure
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>
2015-10-09 19:16:26 +03:00
Ville Syrjälä
7eaae3c201 Sprinkle igt_assert(ptr) after gem_mmap__{cpu,gtt,wc}
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>
2015-10-09 18:33:30 +03:00
Micah Fedke
c81d293aed convert drm_open_any*() calls to drm_open_driver*(DRIVER_INTEL) calls with cocci
Apply the new API to all call sites within the test suite using the following
semantic patch:

// Semantic patch for replacing drm_open_any* with arch-specific drm_open_driver* calls
@@
identifier i =~ "\bdrm_open_any\b";
@@
- i()
+ drm_open_driver(DRIVER_INTEL)

@@
identifier i =~ "\bdrm_open_any_master\b";
@@
- i()
+ drm_open_driver_master(DRIVER_INTEL)

@@
identifier i =~ "\bdrm_open_any_render\b";
@@
- i()
+ drm_open_driver_render(DRIVER_INTEL)

@@
identifier i =~ "\b__drm_open_any\b";
@@
- i()
+ __drm_open_driver(DRIVER_INTEL)

Signed-off-by: Micah Fedke <micah.fedke@collabora.co.uk>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-09-11 14:39:43 +01:00
Thomas Wood
804e11f40d lib: add a single include header
Add a header that includes all the headers for the library. This allows
reorganisation of the library without affecting programs using it and
also simplifies the headers that need to be included to use the library.

Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-08-21 09:37:10 +01: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
a5a6d40ca8 igt/gem_streaming_writes: Reorder src/dst to avoid executing on snooped
During the streaming setup, we execute a dummy batch in order to bind
the objects into the GTT and query their offsets. For this, we should
not use a snooped buffer for the dummy batch, or else we may anger the
GPU. Given that we have a choice, use the other buffer for the dummy
batch.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-06-03 14:00:59 +01:00
Chris Wilson
9777300846 igt/gem_streaming_writes: Map the whole batch for CPU accesses
The llc cpu path only partially mapped the batch buffer so confused the
CS when attempting to execute an empty batch.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=90809
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-06-02 11:26:18 +01:00
Chris Wilson
e93fbc2873 igt/gem_streaming_write: Add a variant to exercise CS
Another issue in streaming writes is into the batch buffer.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-05-20 14:57:16 +01:00
Chris Wilson
3d1f9a2236 igt/gem_streaming_writes: Remember to markup the write target!
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-05-19 15:35:48 +01:00
Chris Wilson
65fec5e583 igt/gem_streaming_writes: Add more validation steps
Inalcude a pre-pass to check that the non-streaming, partial writes
work.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-05-19 15:35:48 +01:00
Chris Wilson
2ce298cf13 igt/gem_stream_writes: Use execbuf LUT to shave a few cycles off dispatch
Since our goal is to have concurrent read/writes of GPU buffers, we want
to spend as little time in between as possible.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-05-12 15:35:32 +01:00
Chris Wilson
f5dd258cc7 igt/gem_streaming_writes: Build in a self-test
Use the first pass to write all values prior to the initial execbuf to
verify that the copy itself is true. Subsequent passes then focus on
verifying that writing values whilst the GPU is reading from
neighbouring values is then correct.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-05-12 10:04:46 +01:00
Chris Wilson
357073c257 igt/gem_streaming_writes: Trim number of batch buffers allocated
Reduce memory usage for batches by a factor of 64 - which we immediately
spend some of in increasing the stress.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-05-11 21:21:36 +01:00
Chris Wilson
672238dbf7 igt: Add gem_streaming_writes
This tries to replicate the missing barrier observed when using
asynchronous mmap(wc) on byt.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-05-11 16:19:12 +01:00