From c03cbe4c0a838ce03266a8c579ef8d13181907b6 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Fri, 12 Jul 2019 10:43:26 +0100 Subject: 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 Reviewed-by: Mika Kuoppala Link: https://patchwork.freedesktop.org/patch/msgid/20190712094327.24437-5-chris@chris-wilson.co.uk --- drivers/gpu/drm/i915/i915_gem_gtt.h | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'drivers/gpu/drm/i915/i915_gem_gtt.h') 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; /** -- cgit v1.2.3