[Intel-gfx] [PATCH 4/5] drm/i915: Use __sg_alloc_table_from_pages for allocating object backing store

2016-10-21 Thread Tvrtko Ursulin
From: Tvrtko Ursulin With the current way of allocating backing store which over-estimates the number of sg entries required we typically waste around 1-6 MiB of memory on unused sg entries at runtime. We can instead have the intermediate step of storing our pages in an array and use __sg_alloc_

Re: [Intel-gfx] [PATCH 4/5] drm/i915: Use __sg_alloc_table_from_pages for allocating object backing store

2016-10-21 Thread Chris Wilson
On Fri, Oct 21, 2016 at 03:11:22PM +0100, Tvrtko Ursulin wrote: > @@ -2236,18 +2233,16 @@ i915_gem_object_get_pages_gtt(struct > drm_i915_gem_object *obj) > BUG_ON(obj->base.read_domains & I915_GEM_GPU_DOMAINS); > BUG_ON(obj->base.write_domain & I915_GEM_GPU_DOMAINS); > > - max_s

Re: [Intel-gfx] [PATCH 4/5] drm/i915: Use __sg_alloc_table_from_pages for allocating object backing store

2016-10-21 Thread Tvrtko Ursulin
On 21/10/2016 15:27, Chris Wilson wrote: On Fri, Oct 21, 2016 at 03:11:22PM +0100, Tvrtko Ursulin wrote: @@ -2236,18 +2233,16 @@ i915_gem_object_get_pages_gtt(struct drm_i915_gem_object *obj) BUG_ON(obj->base.read_domains & I915_GEM_GPU_DOMAINS); BUG_ON(obj->base.write_domain &