diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2019-03-20 15:59:39 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2019-03-20 20:39:20 +0000 |
commit | fedd92f4022837e2c20e472b65bd7d0849f484a3 (patch) | |
tree | 41b7c2cbf83261e165094bec1759d34d245bb487 /tests/i915 | |
parent | 27939a179fcd143e3a179ffc7b0372718259587a (diff) |
i915/gem_shrink: Open the device before using it!
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=110212
Fixes: 8ae86621d6ff ("lib/igt_device: Move intel_get_pci_device under igt_device")
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Michał Winiarski <michal.winiarski@intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Diffstat (limited to 'tests/i915')
-rw-r--r-- | tests/i915/gem_shrink.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/tests/i915/gem_shrink.c b/tests/i915/gem_shrink.c index 73b6be72..f71a1fcb 100644 --- a/tests/i915/gem_shrink.c +++ b/tests/i915/gem_shrink.c @@ -403,7 +403,11 @@ igt_main unsigned int engine; int fd; - /* Spawn enough processes to use all memory, but each only + fd = drm_open_driver(DRIVER_INTEL); + igt_require_gem(fd); + + /* + * Spawn enough processes to use all memory, but each only * uses half the available mappable aperture ~128MiB. * Individually the processes would be ok, but en masse * we expect the shrinker to start purging objects, @@ -418,9 +422,6 @@ igt_main intel_require_memory(num_processes, alloc_size, CHECK_SWAP | CHECK_RAM); - fd = drm_open_driver(DRIVER_INTEL); - igt_require_gem(fd); - nengine = 0; for_each_engine(fd, engine) engines[nengine++] = engine; |