diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2019-07-12 12:43:26 +0300 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2019-07-12 14:22:35 +0300 |
commit | c03cbe4c0a838ce03266a8c579ef8d13181907b6 (patch) | |
tree | 944d9c1be08342a08899764cb43284f47bb37014 /drivers/gpu/drm/i915/i915_gem_gtt.h | |
parent | 2776326457562f971b7b38f4683e298e55252ccc (diff) | |
download | linux-c03cbe4c0a838ce03266a8c579ef8d13181907b6.tar.xz |
drm/i915/gtt: Convert vm->scratch into an array
Each level has its own scratch. Make the levels more obvious by forgoing
the fancy similarly names and replace them with a number. 0 is the bottom
most level, the physical page used for actual data; 1+ are the page
directories.
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-5-chris@chris-wilson.co.uk
Diffstat (limited to 'drivers/gpu/drm/i915/i915_gem_gtt.h')
-rw-r--r-- | drivers/gpu/drm/i915/i915_gem_gtt.h | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.h b/drivers/gpu/drm/i915/i915_gem_gtt.h index fb33f251ef9a..1a43ac4a9249 100644 --- a/drivers/gpu/drm/i915/i915_gem_gtt.h +++ b/drivers/gpu/drm/i915/i915_gem_gtt.h @@ -239,6 +239,11 @@ struct i915_page_dma { }; }; +struct i915_page_scratch { + struct i915_page_dma base; + u64 encode; +}; + struct i915_page_table { struct i915_page_dma base; atomic_t used; @@ -259,9 +264,10 @@ struct i915_page_directory { #define px_base(px) \ __px_choose_expr(px, struct i915_page_dma *, __x, \ + __px_choose_expr(px, struct i915_page_scratch *, &__x->base, \ __px_choose_expr(px, struct i915_page_table *, &__x->base, \ __px_choose_expr(px, struct i915_page_directory *, &__x->pt.base, \ - (void)0))) + (void)0)))) #define px_dma(px) (px_base(px)->daddr) #define px_pt(px) \ @@ -316,12 +322,8 @@ struct i915_address_space { #define VM_CLASS_GGTT 0 #define VM_CLASS_PPGTT 1 - u64 scratch_pte; - int scratch_order; - struct i915_page_dma scratch_page; - struct i915_page_dma scratch_pt; - struct i915_page_dma scratch_pd; - struct i915_page_dma scratch_pdp; /* GEN8+ & 48b PPGTT */ + struct i915_page_scratch scratch[4]; + unsigned int scratch_order; unsigned int top; /** |