[PATCH 2/4] drm/i915/gtt: Warn if the next layer scratch dma is invalid

Mika Kuoppala
2015-06-30T15:19:38Z

When dma page is setup, warn if we try to point the entries
to a uninitialized (zero) dma address. Like we do with gen6

Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
---
drivers/gpu/drm/i915/i915_gem_gtt.c | 4 ++++
1 file changed, 4 insertions(+)

diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c b/drivers/gpu/drm/i915/i915_gem_gtt.c
index 23f5896..78bfb88 100644
--- a/drivers/gpu/drm/i915/i915_gem_gtt.c
+++ b/drivers/gpu/drm/i915/i915_gem_gtt.c
@@ -427,6 +427,8 @@ static void gen8_initialize_pt(struct i915_address_space *vm,
{
gen8_pte_t scratch_pte;

+ WARN_ON(px_dma(vm->scratch_page) == 0);
+
scratch_pte = gen8_pte_encode(px_dma(vm->scratch_page),
I915_CACHE_LLC, true);

@@ -488,6 +490,8 @@ static void gen8_initialize_pd(struct i915_address_space *vm,
{
gen8_pde_t scratch_pde;

+ WARN_ON(px_dma(vm->scratch_pt) == 0);
+
scratch_pde = gen8_pde_encode(px_dma(vm->scratch_pt), I915_CACHE_LLC);

fill_px(vm->dev, pd, scratch_pde);
--
2.1.4