Commit e9e7dc41 authored by Chris Wilson's avatar Chris Wilson

drm/i915/gtt: Make gen6 page directories evictable

Currently all page directories are bound at creation using an
unevictable node in the GGTT. This severely limits us as we cannot
remove any inactive ppgtt for new contexts, or under aperture pressure.
To fix this we need to make the page directory into a first class and
unbindable vma. Hence, the creation of a custom vma to wrap the page
directory as opposed to a GEM object.

In this patch, we leave the page directories pinned upon creation.
Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Cc: Matthew Auld <matthew.william.auld@gmail.com>
Reviewed-by: default avatarMatthew Auld <matthew.william.auld@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180612120446.13901-1-chris@chris-wilson.co.uk
parent 3d6d62ea
This diff is collapsed.
...@@ -410,7 +410,7 @@ struct i915_hw_ppgtt { ...@@ -410,7 +410,7 @@ struct i915_hw_ppgtt {
struct gen6_hw_ppgtt { struct gen6_hw_ppgtt {
struct i915_hw_ppgtt base; struct i915_hw_ppgtt base;
struct drm_mm_node node; struct i915_vma *vma;
gen6_pte_t __iomem *pd_addr; gen6_pte_t __iomem *pd_addr;
}; };
......
...@@ -54,6 +54,7 @@ struct i915_vma { ...@@ -54,6 +54,7 @@ struct i915_vma {
struct reservation_object *resv; /** Alias of obj->resv */ struct reservation_object *resv; /** Alias of obj->resv */
struct sg_table *pages; struct sg_table *pages;
void __iomem *iomap; void __iomem *iomap;
void *private; /* owned by creator */
u64 size; u64 size;
u64 display_alignment; u64 display_alignment;
struct i915_page_sizes page_sizes; struct i915_page_sizes page_sizes;
...@@ -340,6 +341,12 @@ static inline void i915_vma_unpin(struct i915_vma *vma) ...@@ -340,6 +341,12 @@ static inline void i915_vma_unpin(struct i915_vma *vma)
__i915_vma_unpin(vma); __i915_vma_unpin(vma);
} }
static inline bool i915_vma_is_bound(const struct i915_vma *vma,
unsigned int where)
{
return vma->flags & where;
}
/** /**
* i915_vma_pin_iomap - calls ioremap_wc to map the GGTT VMA via the aperture * i915_vma_pin_iomap - calls ioremap_wc to map the GGTT VMA via the aperture
* @vma: VMA to iomap * @vma: VMA to iomap
......
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