diff --git a/intel/intel_bufmgr_gem.c b/intel/intel_bufmgr_gem.c index c5bb588..310076e 100644 --- a/intel/intel_bufmgr_gem.c +++ b/intel/intel_bufmgr_gem.c @@ -1552,6 +1552,22 @@ drm_intel_gem_bo_exec(drm_intel_bo *bo, int used, return ret; } +static void validate_exec_list(struct drm_i915_gem_exec_object2 *objects, + int count) +{ + int i, j; + + for (i = 0; i < count; i++) { + for (j = i + 1; j < count; j++) { + if (objects[i].handle == objects[j].handle) { + fprintf(stderr, "object [%d] occurs more than once in list at %d and %d\n", + objects[i].handle, i, j); + assert(0); + } + } + } +} + static int drm_intel_gem_bo_mrb_exec2(drm_intel_bo *bo, int used, drm_clip_rect_t *cliprects, int num_cliprects, int DR4, @@ -1585,6 +1601,8 @@ drm_intel_gem_bo_mrb_exec2(drm_intel_bo *bo, int used, * pointing to it. */ drm_intel_add_validate_buffer2(bo, 0); + validate_exec_list(bufmgr_gem->exec2_objects, + bufmgr_gem->exec_count); execbuf.buffers_ptr = (uintptr_t)bufmgr_gem->exec2_objects; execbuf.buffer_count = bufmgr_gem->exec_count;