Skip to content

Commit

Permalink
drm/i915: Convert partial ggtt vma to full ggtt if it spans the entir…
Browse files Browse the repository at this point in the history
…e object

If we want to create a partial vma from a chunk that is the same size as
the object, create a normal ggtt vma instead. The benefit is that it
will match future requests for the normal ggtt.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20160818161718.27187-24-chris@chris-wilson.co.uk
  • Loading branch information
Chris Wilson committed Aug 18, 2016
1 parent a61007a commit aa136d9
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions drivers/gpu/drm/i915/i915_gem.c
Original file line number Diff line number Diff line change
Expand Up @@ -1755,6 +1755,12 @@ int i915_gem_fault(struct vm_area_struct *area, struct vm_fault *vmf)
(area->vm_end - area->vm_start) / PAGE_SIZE -
view.params.partial.offset);

/* If the partial covers the entire object, just create a
* normal VMA.
*/
if (chunk_size >= obj->base.size >> PAGE_SHIFT)
view.type = I915_GGTT_VIEW_NORMAL;

vma = i915_gem_object_ggtt_pin(obj, &view, 0, 0, PIN_MAPPABLE);
}
if (IS_ERR(vma)) {
Expand Down

0 comments on commit aa136d9

Please sign in to comment.