From: Chris Wilson Date: Mon, 21 Feb 2011 12:54:48 +0000 (+0000) Subject: drm/i915: First try a normal large kmalloc for the temporary exec buffers X-Git-Tag: v3.0~1070^2~29^2~15 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8408c282f0cf34ee166df5f842f2861d245407fd;p=platform%2Fkernel%2Flinux-amlogic.git 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: Chris Wilson --- diff --git a/drivers/gpu/drm/i915/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/i915_gem_execbuffer.c index a72e7b2..f0c93b2 100644 --- a/drivers/gpu/drm/i915/i915_gem_execbuffer.c +++ b/drivers/gpu/drm/i915/i915_gem_execbuffer.c @@ -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);