drm/i915/gtt: Markup i915_ppgtt height
authorChris Wilson <chris@chris-wilson.co.uk>
Fri, 12 Jul 2019 09:43:24 +0000 (10:43 +0100)
committerChris Wilson <chris@chris-wilson.co.uk>
Fri, 12 Jul 2019 11:22:32 +0000 (12:22 +0100)
This will be useful to consolidate recursive code.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190712094327.24437-3-chris@chris-wilson.co.uk
drivers/gpu/drm/i915/i915_gem_gtt.c
drivers/gpu/drm/i915/i915_gem_gtt.h

index abb2e3e..4544af1 100644 (file)
@@ -1598,6 +1598,7 @@ static struct i915_ppgtt *gen8_ppgtt_create(struct drm_i915_private *i915)
                return ERR_PTR(-ENOMEM);
 
        ppgtt_init(ppgtt, &i915->gt);
+       ppgtt->vm.top = i915_vm_is_4lvl(&ppgtt->vm) ? 3 : 2;
 
        /*
         * From bdw, there is hw support for read-only pages in the PPGTT.
@@ -2084,6 +2085,7 @@ static struct i915_ppgtt *gen6_ppgtt_create(struct drm_i915_private *i915)
                return ERR_PTR(-ENOMEM);
 
        ppgtt_init(&ppgtt->base, &i915->gt);
+       ppgtt->base.vm.top = 1;
 
        ppgtt->base.vm.allocate_va_range = gen6_alloc_va_range;
        ppgtt->base.vm.clear_range = gen6_ppgtt_clear_range;
index 48bb8c5..36162bb 100644 (file)
@@ -323,6 +323,7 @@ struct i915_address_space {
        struct i915_page_dma scratch_pt;
        struct i915_page_dma scratch_pd;
        struct i915_page_dma scratch_pdp; /* GEN8+ & 48b PPGTT */
+       unsigned int top;
 
        /**
         * List of vma currently bound.