Skip to content

Commit

Permalink
drm/i915: First try a normal large kmalloc for the temporary exec buf…
Browse files Browse the repository at this point in the history
…fers

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: Chris Wilson <chris@chris-wilson.co.uk>
  • Loading branch information
Chris Wilson committed Feb 22, 2011
1 parent fca8740 commit 8408c28
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion drivers/gpu/drm/i915/i915_gem_execbuffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 8408c28

Please sign in to comment.