Commit c03cbe4c authored by Chris Wilson's avatar Chris Wilson

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: default avatarChris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: default avatarMika Kuoppala <mika.kuoppala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190712094327.24437-5-chris@chris-wilson.co.uk
parent 27763264
This diff is collapsed.
...@@ -239,6 +239,11 @@ struct i915_page_dma { ...@@ -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_table {
struct i915_page_dma base; struct i915_page_dma base;
atomic_t used; atomic_t used;
...@@ -259,9 +264,10 @@ struct i915_page_directory { ...@@ -259,9 +264,10 @@ struct i915_page_directory {
#define px_base(px) \ #define px_base(px) \
__px_choose_expr(px, struct i915_page_dma *, __x, \ __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_table *, &__x->base, \
__px_choose_expr(px, struct i915_page_directory *, &__x->pt.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_dma(px) (px_base(px)->daddr)
#define px_pt(px) \ #define px_pt(px) \
...@@ -316,12 +322,8 @@ struct i915_address_space { ...@@ -316,12 +322,8 @@ struct i915_address_space {
#define VM_CLASS_GGTT 0 #define VM_CLASS_GGTT 0
#define VM_CLASS_PPGTT 1 #define VM_CLASS_PPGTT 1
u64 scratch_pte; struct i915_page_scratch scratch[4];
int scratch_order; unsigned 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 */
unsigned int top; unsigned int top;
/** /**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment