Commit 0ef723cb authored by Chris Wilson's avatar Chris Wilson

drm/i915: Round tile chunks up for constructing partial VMAs

When we split a large object up into chunks for GTT faulting (because we
can't fit the whole object into the aperture) we have to align our cuts
with the fence registers. Each partial VMA must cover a complete set of
tile rows or the offset into each partial VMA is not aligned with the
whole image. Currently we enforce a minimum size on each partial VMA,
but this minimum size itself was not aligned to the tile row causing
distortion.
Reported-by: default avatarAndreas Reis <andreas.reis@gmail.com>
Reported-by: default avatarChris Clayton <chris2553@googlemail.com>
Reported-by: default avatarNorbert Preining <preining@logic.at>
Tested-by: default avatarNorbert Preining <preining@logic.at>
Tested-by: default avatarChris Clayton <chris2553@googlemail.com>
Fixes: 03af84fe ("drm/i915: Choose partial chunksize based on tile row size")
Fixes: a61007a8 ("drm/i915: Fix partial GGTT faulting") # enabling patch
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98402
Testcase: igt/gem_mmap_gtt/medium-copy-odd
Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: Jani Nikula <jani.nikula@linux.intel.com>
Cc: <drm-intel-fixes@lists.freedesktop.org> # v4.9-rc1+
Link: http://patchwork.freedesktop.org/patch/msgid/20161107105443.27855-1-chris@chris-wilson.co.ukReviewed-by: default avatarJoonas Lahtinen <joonas.lahtinen@linux.intel.com>
parent dfd2812e
...@@ -1779,7 +1779,7 @@ int i915_gem_fault(struct vm_area_struct *area, struct vm_fault *vmf) ...@@ -1779,7 +1779,7 @@ int i915_gem_fault(struct vm_area_struct *area, struct vm_fault *vmf)
/* Use a partial view if it is bigger than available space */ /* Use a partial view if it is bigger than available space */
chunk_size = MIN_CHUNK_PAGES; chunk_size = MIN_CHUNK_PAGES;
if (i915_gem_object_is_tiled(obj)) if (i915_gem_object_is_tiled(obj))
chunk_size = max(chunk_size, tile_row_pages(obj)); chunk_size = roundup(chunk_size, tile_row_pages(obj));
memset(&view, 0, sizeof(view)); memset(&view, 0, sizeof(view));
view.type = I915_GGTT_VIEW_PARTIAL; view.type = I915_GGTT_VIEW_PARTIAL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment