diff options
Diffstat (limited to 'lib/mesa/src/intel/tools/gen_context.h')
-rw-r--r-- | lib/mesa/src/intel/tools/gen_context.h | 63 |
1 files changed, 33 insertions, 30 deletions
diff --git a/lib/mesa/src/intel/tools/gen_context.h b/lib/mesa/src/intel/tools/gen_context.h index 39041408b..3f488c07c 100644 --- a/lib/mesa/src/intel/tools/gen_context.h +++ b/lib/mesa/src/intel/tools/gen_context.h @@ -21,22 +21,22 @@ * IN THE SOFTWARE. */ -#ifndef INTEL_CONTEXT_H -#define INTEL_CONTEXT_H +#ifndef GEN_CONTEXT_H +#define GEN_CONTEXT_H #include <stdint.h> #define RING_SIZE (1 * 4096) #define PPHWSP_SIZE (1 * 4096) -#define GFX11_LR_CONTEXT_RENDER_SIZE (14 * 4096) -#define GFX10_LR_CONTEXT_RENDER_SIZE (19 * 4096) -#define GFX9_LR_CONTEXT_RENDER_SIZE (22 * 4096) -#define GFX8_LR_CONTEXT_RENDER_SIZE (20 * 4096) -#define GFX8_LR_CONTEXT_OTHER_SIZE (2 * 4096) +#define GEN11_LR_CONTEXT_RENDER_SIZE (14 * 4096) +#define GEN10_LR_CONTEXT_RENDER_SIZE (19 * 4096) +#define GEN9_LR_CONTEXT_RENDER_SIZE (22 * 4096) +#define GEN8_LR_CONTEXT_RENDER_SIZE (20 * 4096) +#define GEN8_LR_CONTEXT_OTHER_SIZE (2 * 4096) -#define CONTEXT_RENDER_SIZE GFX9_LR_CONTEXT_RENDER_SIZE /* largest size */ -#define CONTEXT_OTHER_SIZE GFX8_LR_CONTEXT_OTHER_SIZE +#define CONTEXT_RENDER_SIZE GEN9_LR_CONTEXT_RENDER_SIZE /* largest size */ +#define CONTEXT_OTHER_SIZE GEN8_LR_CONTEXT_OTHER_SIZE #define MI_LOAD_REGISTER_IMM_n(n) ((0x22 << 23) | (2 * (n) - 1)) #define MI_LRI_FORCE_POSTED (1<<12) @@ -70,10 +70,26 @@ #define MEMORY_MAP_SIZE (64 /* MiB */ * 1024 * 1024) #define PTE_SIZE 4 -#define GFX8_PTE_SIZE 8 +#define GEN8_PTE_SIZE 8 #define NUM_PT_ENTRIES (ALIGN(MEMORY_MAP_SIZE, 4096) / 4096) -#define PT_SIZE ALIGN(NUM_PT_ENTRIES * GFX8_PTE_SIZE, 4096) +#define PT_SIZE ALIGN(NUM_PT_ENTRIES * GEN8_PTE_SIZE, 4096) + +#define STATIC_GGTT_MAP_START 0 + +#define RENDER_RING_ADDR STATIC_GGTT_MAP_START +#define RENDER_CONTEXT_ADDR (RENDER_RING_ADDR + RING_SIZE) + +#define BLITTER_RING_ADDR (RENDER_CONTEXT_ADDR + PPHWSP_SIZE + GEN9_LR_CONTEXT_RENDER_SIZE) +#define BLITTER_CONTEXT_ADDR (BLITTER_RING_ADDR + RING_SIZE) + +#define VIDEO_RING_ADDR (BLITTER_CONTEXT_ADDR + PPHWSP_SIZE + GEN8_LR_CONTEXT_OTHER_SIZE) +#define VIDEO_CONTEXT_ADDR (VIDEO_RING_ADDR + RING_SIZE) + +#define STATIC_GGTT_MAP_END (VIDEO_CONTEXT_ADDR + PPHWSP_SIZE + GEN8_LR_CONTEXT_OTHER_SIZE) +#define STATIC_GGTT_MAP_SIZE (STATIC_GGTT_MAP_END - STATIC_GGTT_MAP_START) + +#define PML4_PHYS_ADDR ((uint64_t)(STATIC_GGTT_MAP_END)) #define CONTEXT_FLAGS (0x339) /* Normal Priority | L3-LLC Coherency | * PPGTT Enabled | @@ -81,24 +97,11 @@ * Valid */ -#define MI_LOAD_REGISTER_IMM_vals(data, flags, ...) do { \ - uint32_t __regs[] = { __VA_ARGS__ }; \ - assert((ARRAY_SIZE(__regs) % 2) == 0); \ - *(data)++ = MI_LOAD_REGISTER_IMM_n(ARRAY_SIZE(__regs) / 2) | (flags); \ - for (unsigned __e = 0; __e < ARRAY_SIZE(__regs); __e++) \ - *(data)++ = __regs[__e]; \ - } while (0) - - -struct gen_context_parameters { - uint64_t pml4_addr; - uint64_t ring_addr; - uint32_t ring_size; -}; - -typedef void (*gen_context_init_t)(const struct gen_context_parameters *, uint32_t *, uint32_t *); +#define RENDER_CONTEXT_DESCRIPTOR ((uint64_t)1 << 62 | RENDER_CONTEXT_ADDR | CONTEXT_FLAGS) +#define BLITTER_CONTEXT_DESCRIPTOR ((uint64_t)2 << 62 | BLITTER_CONTEXT_ADDR | CONTEXT_FLAGS) +#define VIDEO_CONTEXT_DESCRIPTOR ((uint64_t)3 << 62 | VIDEO_CONTEXT_ADDR | CONTEXT_FLAGS) -#include "gfx8_context.h" -#include "gfx10_context.h" +#include "gen8_context.h" +#include "gen10_context.h" -#endif /* INTEL_CONTEXT_H */ +#endif /* GEN_CONTEXT_H */ |