Commit 9d0bad17 authored by Jani Nikula's avatar Jani Nikula
parent e6f19648
...@@ -19,7 +19,7 @@ void __i915_gem_object_set_pages(struct drm_i915_gem_object *obj, ...@@ -19,7 +19,7 @@ void __i915_gem_object_set_pages(struct drm_i915_gem_object *obj,
unsigned int sg_page_sizes) unsigned int sg_page_sizes)
{ {
struct drm_i915_private *i915 = to_i915(obj->base.dev); struct drm_i915_private *i915 = to_i915(obj->base.dev);
unsigned long supported = INTEL_INFO(i915)->page_sizes; unsigned long supported = RUNTIME_INFO(i915)->page_sizes;
bool shrinkable; bool shrinkable;
int i; int i;
......
...@@ -358,7 +358,7 @@ fake_huge_pages_object(struct drm_i915_private *i915, u64 size, bool single) ...@@ -358,7 +358,7 @@ fake_huge_pages_object(struct drm_i915_private *i915, u64 size, bool single)
static int igt_check_page_sizes(struct i915_vma *vma) static int igt_check_page_sizes(struct i915_vma *vma)
{ {
struct drm_i915_private *i915 = vma->vm->i915; struct drm_i915_private *i915 = vma->vm->i915;
unsigned int supported = INTEL_INFO(i915)->page_sizes; unsigned int supported = RUNTIME_INFO(i915)->page_sizes;
struct drm_i915_gem_object *obj = vma->obj; struct drm_i915_gem_object *obj = vma->obj;
int err; int err;
...@@ -419,7 +419,7 @@ static int igt_mock_exhaust_device_supported_pages(void *arg) ...@@ -419,7 +419,7 @@ static int igt_mock_exhaust_device_supported_pages(void *arg)
{ {
struct i915_ppgtt *ppgtt = arg; struct i915_ppgtt *ppgtt = arg;
struct drm_i915_private *i915 = ppgtt->vm.i915; struct drm_i915_private *i915 = ppgtt->vm.i915;
unsigned int saved_mask = INTEL_INFO(i915)->page_sizes; unsigned int saved_mask = RUNTIME_INFO(i915)->page_sizes;
struct drm_i915_gem_object *obj; struct drm_i915_gem_object *obj;
struct i915_vma *vma; struct i915_vma *vma;
int i, j, single; int i, j, single;
...@@ -438,7 +438,7 @@ static int igt_mock_exhaust_device_supported_pages(void *arg) ...@@ -438,7 +438,7 @@ static int igt_mock_exhaust_device_supported_pages(void *arg)
combination |= page_sizes[j]; combination |= page_sizes[j];
} }
mkwrite_device_info(i915)->page_sizes = combination; RUNTIME_INFO(i915)->page_sizes = combination;
for (single = 0; single <= 1; ++single) { for (single = 0; single <= 1; ++single) {
obj = fake_huge_pages_object(i915, combination, !!single); obj = fake_huge_pages_object(i915, combination, !!single);
...@@ -485,7 +485,7 @@ static int igt_mock_exhaust_device_supported_pages(void *arg) ...@@ -485,7 +485,7 @@ static int igt_mock_exhaust_device_supported_pages(void *arg)
out_put: out_put:
i915_gem_object_put(obj); i915_gem_object_put(obj);
out_device: out_device:
mkwrite_device_info(i915)->page_sizes = saved_mask; RUNTIME_INFO(i915)->page_sizes = saved_mask;
return err; return err;
} }
...@@ -495,7 +495,7 @@ static int igt_mock_memory_region_huge_pages(void *arg) ...@@ -495,7 +495,7 @@ static int igt_mock_memory_region_huge_pages(void *arg)
const unsigned int flags[] = { 0, I915_BO_ALLOC_CONTIGUOUS }; const unsigned int flags[] = { 0, I915_BO_ALLOC_CONTIGUOUS };
struct i915_ppgtt *ppgtt = arg; struct i915_ppgtt *ppgtt = arg;
struct drm_i915_private *i915 = ppgtt->vm.i915; struct drm_i915_private *i915 = ppgtt->vm.i915;
unsigned long supported = INTEL_INFO(i915)->page_sizes; unsigned long supported = RUNTIME_INFO(i915)->page_sizes;
struct intel_memory_region *mem; struct intel_memory_region *mem;
struct drm_i915_gem_object *obj; struct drm_i915_gem_object *obj;
struct i915_vma *vma; struct i915_vma *vma;
...@@ -573,7 +573,7 @@ static int igt_mock_ppgtt_misaligned_dma(void *arg) ...@@ -573,7 +573,7 @@ static int igt_mock_ppgtt_misaligned_dma(void *arg)
{ {
struct i915_ppgtt *ppgtt = arg; struct i915_ppgtt *ppgtt = arg;
struct drm_i915_private *i915 = ppgtt->vm.i915; struct drm_i915_private *i915 = ppgtt->vm.i915;
unsigned long supported = INTEL_INFO(i915)->page_sizes; unsigned long supported = RUNTIME_INFO(i915)->page_sizes;
struct drm_i915_gem_object *obj; struct drm_i915_gem_object *obj;
int bit; int bit;
int err; int err;
...@@ -1390,7 +1390,7 @@ static int igt_ppgtt_smoke_huge(void *arg) ...@@ -1390,7 +1390,7 @@ static int igt_ppgtt_smoke_huge(void *arg)
static int igt_ppgtt_sanity_check(void *arg) static int igt_ppgtt_sanity_check(void *arg)
{ {
struct drm_i915_private *i915 = arg; struct drm_i915_private *i915 = arg;
unsigned int supported = INTEL_INFO(i915)->page_sizes; unsigned int supported = RUNTIME_INFO(i915)->page_sizes;
struct { struct {
igt_create_fn fn; igt_create_fn fn;
unsigned int flags; unsigned int flags;
......
...@@ -1218,7 +1218,7 @@ IS_SUBPLATFORM(const struct drm_i915_private *i915, ...@@ -1218,7 +1218,7 @@ IS_SUBPLATFORM(const struct drm_i915_private *i915,
#define HAS_PAGE_SIZES(dev_priv, sizes) ({ \ #define HAS_PAGE_SIZES(dev_priv, sizes) ({ \
GEM_BUG_ON((sizes) == 0); \ GEM_BUG_ON((sizes) == 0); \
((sizes) & ~INTEL_INFO(dev_priv)->page_sizes) == 0; \ ((sizes) & ~RUNTIME_INFO(dev_priv)->page_sizes) == 0; \
}) })
#define HAS_OVERLAY(dev_priv) (INTEL_INFO(dev_priv)->display.has_overlay) #define HAS_OVERLAY(dev_priv) (INTEL_INFO(dev_priv)->display.has_overlay)
......
...@@ -1091,8 +1091,7 @@ int i915_gem_init(struct drm_i915_private *dev_priv) ...@@ -1091,8 +1091,7 @@ int i915_gem_init(struct drm_i915_private *dev_priv)
/* We need to fallback to 4K pages if host doesn't support huge gtt. */ /* We need to fallback to 4K pages if host doesn't support huge gtt. */
if (intel_vgpu_active(dev_priv) && !intel_vgpu_has_huge_gtt(dev_priv)) if (intel_vgpu_active(dev_priv) && !intel_vgpu_has_huge_gtt(dev_priv))
mkwrite_device_info(dev_priv)->page_sizes = RUNTIME_INFO(dev_priv)->page_sizes = I915_GTT_PAGE_SIZE_4K;
I915_GTT_PAGE_SIZE_4K;
ret = i915_gem_init_userptr(dev_priv); ret = i915_gem_init_userptr(dev_priv);
if (ret) if (ret)
......
...@@ -160,7 +160,7 @@ ...@@ -160,7 +160,7 @@
/* Keep in gen based order, and chronological order within a gen */ /* Keep in gen based order, and chronological order within a gen */
#define GEN_DEFAULT_PAGE_SIZES \ #define GEN_DEFAULT_PAGE_SIZES \
.page_sizes = I915_GTT_PAGE_SIZE_4K .__runtime.page_sizes = I915_GTT_PAGE_SIZE_4K
#define GEN_DEFAULT_REGIONS \ #define GEN_DEFAULT_REGIONS \
.memory_regions = REGION_SMEM | REGION_STOLEN_SMEM .memory_regions = REGION_SMEM | REGION_STOLEN_SMEM
...@@ -647,8 +647,8 @@ static const struct intel_device_info chv_info = { ...@@ -647,8 +647,8 @@ static const struct intel_device_info chv_info = {
}; };
#define GEN9_DEFAULT_PAGE_SIZES \ #define GEN9_DEFAULT_PAGE_SIZES \
.page_sizes = I915_GTT_PAGE_SIZE_4K | \ .__runtime.page_sizes = I915_GTT_PAGE_SIZE_4K | \
I915_GTT_PAGE_SIZE_64K I915_GTT_PAGE_SIZE_64K
#define GEN9_FEATURES \ #define GEN9_FEATURES \
GEN8_FEATURES, \ GEN8_FEATURES, \
...@@ -802,9 +802,9 @@ static const struct intel_device_info cml_gt2_info = { ...@@ -802,9 +802,9 @@ static const struct intel_device_info cml_gt2_info = {
}; };
#define GEN11_DEFAULT_PAGE_SIZES \ #define GEN11_DEFAULT_PAGE_SIZES \
.page_sizes = I915_GTT_PAGE_SIZE_4K | \ .__runtime.page_sizes = I915_GTT_PAGE_SIZE_4K | \
I915_GTT_PAGE_SIZE_64K | \ I915_GTT_PAGE_SIZE_64K | \
I915_GTT_PAGE_SIZE_2M I915_GTT_PAGE_SIZE_2M
#define GEN11_FEATURES \ #define GEN11_FEATURES \
GEN9_FEATURES, \ GEN9_FEATURES, \
...@@ -1001,9 +1001,9 @@ static const struct intel_device_info adl_p_info = { ...@@ -1001,9 +1001,9 @@ static const struct intel_device_info adl_p_info = {
#undef GEN #undef GEN
#define XE_HP_PAGE_SIZES \ #define XE_HP_PAGE_SIZES \
.page_sizes = I915_GTT_PAGE_SIZE_4K | \ .__runtime.page_sizes = I915_GTT_PAGE_SIZE_4K | \
I915_GTT_PAGE_SIZE_64K | \ I915_GTT_PAGE_SIZE_64K | \
I915_GTT_PAGE_SIZE_2M I915_GTT_PAGE_SIZE_2M
#define XE_HP_FEATURES \ #define XE_HP_FEATURES \
.__runtime.graphics.ver = 12, \ .__runtime.graphics.ver = 12, \
......
...@@ -110,7 +110,7 @@ void intel_device_info_print(const struct intel_device_info *info, ...@@ -110,7 +110,7 @@ void intel_device_info_print(const struct intel_device_info *info,
drm_printf(p, "gt: %d\n", info->gt); drm_printf(p, "gt: %d\n", info->gt);
drm_printf(p, "memory-regions: %x\n", info->memory_regions); drm_printf(p, "memory-regions: %x\n", info->memory_regions);
drm_printf(p, "page-sizes: %x\n", info->page_sizes); drm_printf(p, "page-sizes: %x\n", runtime->page_sizes);
drm_printf(p, "platform: %s\n", intel_platform_name(info->platform)); drm_printf(p, "platform: %s\n", intel_platform_name(info->platform));
drm_printf(p, "ppgtt-size: %d\n", info->ppgtt_size); drm_printf(p, "ppgtt-size: %d\n", info->ppgtt_size);
drm_printf(p, "ppgtt-type: %d\n", info->ppgtt_type); drm_printf(p, "ppgtt-type: %d\n", info->ppgtt_type);
......
...@@ -221,6 +221,8 @@ struct intel_runtime_info { ...@@ -221,6 +221,8 @@ struct intel_runtime_info {
struct intel_step_info step; struct intel_step_info step;
unsigned int page_sizes; /* page sizes supported by the HW */
/* display */ /* display */
struct { struct {
u8 num_sprites[I915_MAX_PIPES]; u8 num_sprites[I915_MAX_PIPES];
...@@ -242,8 +244,6 @@ struct intel_device_info { ...@@ -242,8 +244,6 @@ struct intel_device_info {
enum intel_ppgtt_type ppgtt_type; enum intel_ppgtt_type ppgtt_type;
unsigned int ppgtt_size; /* log2, e.g. 31/32/48 bits */ unsigned int ppgtt_size; /* log2, e.g. 31/32/48 bits */
unsigned int page_sizes; /* page sizes supported by the HW */
u32 memory_regions; /* regions supported by the HW */ u32 memory_regions; /* regions supported by the HW */
u8 gt; /* GT number, 0 if undefined */ u8 gt; /* GT number, 0 if undefined */
......
...@@ -174,7 +174,7 @@ struct drm_i915_private *mock_gem_device(void) ...@@ -174,7 +174,7 @@ struct drm_i915_private *mock_gem_device(void)
RUNTIME_INFO(i915)->graphics.ver = -1; RUNTIME_INFO(i915)->graphics.ver = -1;
mkwrite_device_info(i915)->page_sizes = RUNTIME_INFO(i915)->page_sizes =
I915_GTT_PAGE_SIZE_4K | I915_GTT_PAGE_SIZE_4K |
I915_GTT_PAGE_SIZE_64K | I915_GTT_PAGE_SIZE_64K |
I915_GTT_PAGE_SIZE_2M; I915_GTT_PAGE_SIZE_2M;
......
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