18 Commits

Author SHA1 Message Date
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
Thomas Wood
7a5e1c6f0a tests: match gem_create prototype in igt_eviction_test_ops create function
This avoids a warning when using gem_create as the create function.

Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-05-14 17:01:57 +01:00
Chris Wilson
af3e32cee2 igt/gem_evict_everything: Simplify mlocked_evictions
igt_fork/igt_waitchildren already perform the magic required to raise
errors based on the exit error code of the child, so take advantage of
that and kill the overlycomplicated message passing!

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-03-30 17:05:16 +01:00
Chris Wilson
068f9ceb62 igt/gem_evict_everything: Use mlock to reduce available memory
The idea here is to check what happens when a large process requests
memory from us - we create and utilize a bunch of surfaces then have to
relinquish some but continue using the whole working set (so as to force
reloads).

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-03-29 15:57:50 +01:00
Matt Roper
07be8fec15 igt.cocci: Replace igt_assert() with igt_assert_CMP() where possible
The integer comparison macros give us better error output by including
the actual values that failed the comparison.

Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2015-03-06 18:06:10 +01:00
Daniel Vetter
2eca38eab9 lib/igt_aux: s/swap/igt_swap/
It collides with the subtest naming convention glossary entry for swap.
Which makes the docbook xml stuff unhappy.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-02-13 09:35:36 +01:00
Ville Syrjälä
8032f526ef tests: Run lib/igt.cocci
Found some open coded min()/max()/swap() macros.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2014-12-08 19:26:39 +02:00
Daniel Vetter
a535cdedfb lib/os: Pust igt_require into memory check function
More in line with the usual igt pattern and simplifies the code -
every called just wrapped it in igt_require.

Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2014-11-17 14:43:33 +01:00
Thomas Wood
be4710a541 lib: add common min and max macros
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2014-10-17 15:34:43 +01:00
Chris Wilson
784b77257b igt/gem_userptr_blits: New tests, old issues
Introduce a new test to keep that we clean up on process exit (if the
userptr is busy or it has been gtt mmapped). This revealed a few bugs in
the existing tests so clean those up.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-07-21 16:32:42 +01:00
Chris Wilson
a1a8aa16fb igt/gem_evict_everything: Compute number of surfaces to saturate the aperture
The goal is to only fill the aperture, not all of memory, so fine-tune
the computed number of surfaces, hopefully avoiding an integer overflow
in the process.

References: https://bugs.freedesktop.org/show_bug.cgi?id=79573
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-05 13:34:02 +01:00
Chris Wilson
a384e55b49 igt/gem_evict_everything: Move assertion
If we move the assertion from out of the callback, we can get a much
more useful error message.

References: https://bugs.freedesktop.org/show_bug.cgi?id=79573
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-03 07:35:54 +01:00
Chris Wilson
321273ff76 Factor in kernel object overhead when checking available memory for tests
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-05-28 09:05:57 +01:00
Daniel Vetter
f5daeec724 lib: extract igt_aux.[hc]
And shovel all the various helpers in there.

Also move igt_set_vt_graphics_mode to igt_kms.h since the function is
implemented in igt_kms.c. And it fits better. I kinda missed this in
the prep work.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-03-23 13:47:09 +01:00
Chris Wilson
8c475e0ba6 evictions: Limit the number of minor eviction surfaces to fit in RAM
We allocate more surfaces than used in a single pass in order to stress
the eviction code between batches. The intent here is not to exercise
swapping, and we fail to check that there is enough swap+memory to hold
all our surfaces. So limit the number of surfaces we allocate to fit
into RAM, and then require that the number of surfaces we need for
testing is less than the number of surfaces we can allocate.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-02-26 12:06:10 +00:00
Tvrtko Ursulin
42bcd05eb3 tests/eviction_common: Avoid submitting duplicate objects
Make sure selection loop does not generate duplicates
when it picks a subset of objects for a single exec buffer.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-02-04 12:36:57 +01:00
Tvrtko Ursulin
e1dea7e2e1 tests/gem_evict_everything: Factor out eviction logic
In preparation for userptr test we move the eviction logic
into a common file so it can be used from both test cases.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-02-04 12:36:53 +01:00