Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8408c282 authored by Chris Wilson's avatar Chris Wilson
Browse files

drm/i915: First try a normal large kmalloc for the temporary exec buffers



As we just need a temporary array whilst performing the relocations for
the execbuffer, first attempt to allocate using kmalloc even if it is
not of order page-0. This avoids the overhead of remapping the
discontiguous array and so gives a moderate boost to execution
throughput.

Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
parent fca87409
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -1306,7 +1306,11 @@ i915_gem_execbuffer2(struct drm_device *dev, void *data,
		return -EINVAL;
	}

	exec2_list = drm_malloc_ab(sizeof(*exec2_list), args->buffer_count);
	exec2_list = kmalloc(sizeof(*exec2_list)*args->buffer_count,
			     GFP_KERNEL | __GFP_NOWARN | __GFP_NORETRY);
	if (exec2_list == NULL)
		exec2_list = drm_malloc_ab(sizeof(*exec2_list),
					   args->buffer_count);
	if (exec2_list == NULL) {
		DRM_ERROR("Failed to allocate exec list for %d buffers\n",
			  args->buffer_count);