summaryrefslogtreecommitdiff
path: root/lib/igt_dummyload.c
diff options
context:
space:
mode:
authorChris Wilson <chris.p.wilson@intel.com>2021-06-21 12:59:22 +0200
committerZbigniew Kempczyński <zbigniew.kempczynski@intel.com>2021-06-22 05:03:05 +0200
commit3fa131bf05bbf88d8fd6431ab9ed74d405b0d79c (patch)
tree58efd89efd3ec390d4a03237e7943d52d166cfc0 /lib/igt_dummyload.c
parent66201524b4819c0abfb4b2387a40b83d86ba0096 (diff)
lib: Ensure the spinner reuses the canonical address
For resubmitting a spinner, we pinned the objects into their addresses used for the initial submission (so that we can remove the relocations). When supplying a pinned address, the kernel insists that it should be in canonical form, so let's also make sure that it is on setting the pin flag. Signed-off-by: Chris Wilson <chris.p.wilson@intel.com> Reviewed-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
Diffstat (limited to 'lib/igt_dummyload.c')
-rw-r--r--lib/igt_dummyload.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/igt_dummyload.c b/lib/igt_dummyload.c
index 63b1fc73..75be2f7c 100644
--- a/lib/igt_dummyload.c
+++ b/lib/igt_dummyload.c
@@ -40,6 +40,7 @@
#include "igt_dummyload.h"
#include "igt_gt.h"
#include "igt_vgem.h"
+#include "intel_allocator.h"
#include "intel_chipset.h"
#include "intel_reg.h"
#include "ioctl_wrappers.h"
@@ -92,7 +93,8 @@ emit_recursive_batch(igt_spin_t *spin,
{
#define SCRATCH 0
#define BATCH IGT_SPIN_BATCH
- const int gen = intel_gen(intel_get_drm_devid(fd));
+ const unsigned int devid = intel_get_drm_devid(fd);
+ const unsigned int gen = intel_gen(devid);
struct drm_i915_gem_relocation_entry relocs[3], *r;
struct drm_i915_gem_execbuffer2 *execbuf;
struct drm_i915_gem_exec_object2 *obj;
@@ -381,7 +383,8 @@ emit_recursive_batch(igt_spin_t *spin,
for (i = 0; i < ARRAY_SIZE(spin->obj); i++) {
spin->obj[i].relocation_count = 0;
spin->obj[i].relocs_ptr = 0;
- spin->obj[i].flags = EXEC_OBJECT_PINNED;
+ spin->obj[i].offset = CANONICAL(spin->obj[i].offset);
+ spin->obj[i].flags |= EXEC_OBJECT_PINNED;
}
spin->cmd_precondition = *spin->condition;