drm/i915: Use __sg_alloc_table_from_pages for userptr allocations
authorTvrtko Ursulin <[email protected]>
Thu, 3 Aug 2017 09:14:17 +0000 (10:14 +0100)
committerTvrtko Ursulin <[email protected]>
Thu, 7 Sep 2017 09:48:29 +0000 (10:48 +0100)
commit5602452e4c9943a81c9cd049d10d37d3f137b0c0
treeb1d4541b7679ef36a05d89f0ae0d9ad59d4a7cc2
parent89d8589cd72c6f48b19c370517d16f3ee23909df
drm/i915: Use __sg_alloc_table_from_pages for userptr allocations

With the addition of __sg_alloc_table_from_pages we can control
the maximum coalescing size and eliminate a separate path for
allocating backing store here.

Similar to 871dfbd67d4e ("drm/i915: Allow compaction upto
SWIOTLB max segment size") this enables more compact sg lists to
be created and so has a beneficial effect on workloads with many
and/or large objects of this class.

v2:
 * Rename helper to i915_sg_segment_size and fix swiotlb override.
 * Commit message update.

v3:
 * Actually include the swiotlb override fix.

v4:
 * Regroup parameters a bit. (Chris Wilson)

v5:
 * Rebase for swiotlb_max_segment.
 * Add DMA map failure handling as in abb0deacb5a6
   ("drm/i915: Fallback to single PAGE_SIZE segments for DMA remapping").

v6: Handle swiotlb_max_segment() returning 1. (Joonas Lahtinen)

v7: Rebase.
v8: Commit spelling fix.

Signed-off-by: Tvrtko Ursulin <[email protected]>
Cc: Chris Wilson <[email protected]>
Cc: [email protected]
Reviewed-by: Chris Wilson <[email protected]>
Cc: Joonas Lahtinen <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
drivers/gpu/drm/i915/i915_drv.h
drivers/gpu/drm/i915/i915_gem.c
drivers/gpu/drm/i915/i915_gem_userptr.c