All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/6] drm/i915/gtt: Avoid calling non-existent allocate_va_range
@ 2018-06-01  9:35 Chris Wilson
  2018-06-01  9:35 ` [PATCH 2/6] drm/i915/gtt: Don't restore the non-existent PDE for GGTT Chris Wilson
                   ` (6 more replies)
  0 siblings, 7 replies; 12+ messages in thread
From: Chris Wilson @ 2018-06-01  9:35 UTC (permalink / raw)
  To: intel-gfx

On hsw and older, we do not need to allocate the ppgtt on the fly and so
ppgtt->allocate_va_range() is NULL. Fixup ppgtt_bind_vma not to call it,
in that case!

v2: PIN_UPDATE still exists.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 drivers/gpu/drm/i915/i915_gem_gtt.c | 34 ++++++++++++++++++-----------
 1 file changed, 21 insertions(+), 13 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c b/drivers/gpu/drm/i915/i915_gem_gtt.c
index 7f4def556f40..344b572d0721 100644
--- a/drivers/gpu/drm/i915/i915_gem_gtt.c
+++ b/drivers/gpu/drm/i915/i915_gem_gtt.c
@@ -190,19 +190,11 @@ int intel_sanitize_enable_ppgtt(struct drm_i915_private *dev_priv,
 	return 1;
 }
 
-static int ppgtt_bind_vma(struct i915_vma *vma,
-			  enum i915_cache_level cache_level,
-			  u32 unused)
+static int gen6_ppgtt_bind_vma(struct i915_vma *vma,
+			       enum i915_cache_level cache_level,
+			       u32 unused)
 {
 	u32 pte_flags;
-	int ret;
-
-	if (!(vma->flags & I915_VMA_LOCAL_BIND)) {
-		ret = vma->vm->allocate_va_range(vma->vm, vma->node.start,
-						 vma->size);
-		if (ret)
-			return ret;
-	}
 
 	/* Currently applicable only to VLV */
 	pte_flags = 0;
@@ -214,6 +206,22 @@ static int ppgtt_bind_vma(struct i915_vma *vma,
 	return 0;
 }
 
+static int gen8_ppgtt_bind_vma(struct i915_vma *vma,
+			       enum i915_cache_level cache_level,
+			       u32 unused)
+{
+	int ret;
+
+	if (!(vma->flags & I915_VMA_LOCAL_BIND)) {
+		ret = vma->vm->allocate_va_range(vma->vm,
+						 vma->node.start, vma->size);
+		if (ret)
+			return ret;
+	}
+
+	return gen6_ppgtt_bind_vma(vma, cache_level, unused);
+}
+
 static void ppgtt_unbind_vma(struct i915_vma *vma)
 {
 	vma->vm->clear_range(vma->vm, vma->node.start, vma->size);
@@ -1657,8 +1665,8 @@ static int gen8_ppgtt_init(struct i915_hw_ppgtt *ppgtt)
 		gen8_ppgtt_notify_vgt(ppgtt, true);
 
 	ppgtt->base.cleanup = gen8_ppgtt_cleanup;
+	ppgtt->base.bind_vma = gen8_ppgtt_bind_vma;
 	ppgtt->base.unbind_vma = ppgtt_unbind_vma;
-	ppgtt->base.bind_vma = ppgtt_bind_vma;
 	ppgtt->base.set_pages = ppgtt_set_pages;
 	ppgtt->base.clear_pages = clear_pages;
 	ppgtt->debug_dump = gen8_dump_ppgtt;
@@ -2100,8 +2108,8 @@ static int gen6_ppgtt_init(struct i915_hw_ppgtt *ppgtt)
 
 	ppgtt->base.clear_range = gen6_ppgtt_clear_range;
 	ppgtt->base.insert_entries = gen6_ppgtt_insert_entries;
+	ppgtt->base.bind_vma = gen6_ppgtt_bind_vma;
 	ppgtt->base.unbind_vma = ppgtt_unbind_vma;
-	ppgtt->base.bind_vma = ppgtt_bind_vma;
 	ppgtt->base.set_pages = ppgtt_set_pages;
 	ppgtt->base.clear_pages = clear_pages;
 	ppgtt->base.cleanup = gen6_ppgtt_cleanup;
-- 
2.17.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2018-06-01 13:55 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-01  9:35 [PATCH 1/6] drm/i915/gtt: Avoid calling non-existent allocate_va_range Chris Wilson
2018-06-01  9:35 ` [PATCH 2/6] drm/i915/gtt: Don't restore the non-existent PDE for GGTT Chris Wilson
2018-06-01 12:56   ` Joonas Lahtinen
2018-06-01 13:55     ` Chris Wilson
2018-06-01  9:35 ` [PATCH 3/6] drm/i915: Flush all writes before suspend Chris Wilson
2018-06-01 13:01   ` Joonas Lahtinen
2018-06-01  9:35 ` [PATCH 4/6] drm/i915: Apply the full CPU domain markup before freezing Chris Wilson
2018-06-01 13:04   ` Joonas Lahtinen
2018-06-01  9:35 ` [PATCH 5/6] drm/i915/gtt: Enable full-ppgtt by default for HSW Chris Wilson
2018-06-01  9:35 ` [PATCH 6/6] drm/i915/gtt: Enable full-ppgtt by default everywhere! Chris Wilson
2018-06-01 10:01 ` ✗ Fi.CI.BAT: failure for series starting with [1/6] drm/i915/gtt: Avoid calling non-existent allocate_va_range Patchwork
2018-06-01 11:37 ` ✗ Fi.CI.IGT: " Patchwork

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.