[PATCH 15/16] drm/i915: restore min_page_size behaviour
Matthew Auld
matthew.auld at intel.com
Tue May 11 14:23:58 UTC 2021
We now have bo->page_alignment which perfectly describes what we need if
we have min page size restrictions for lmem. We can also drop the flag
here, since this is the default behaviour for all objects.
Signed-off-by: Matthew Auld <matthew.auld at intel.com>
---
drivers/gpu/drm/i915/gem/i915_gem_ttm.c | 5 +++--
drivers/gpu/drm/i915/intel_memory_region.h | 3 +--
drivers/gpu/drm/i915/intel_region_ttm.c | 2 +-
drivers/gpu/drm/i915/selftests/mock_region.c | 2 +-
4 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/gpu/drm/i915/gem/i915_gem_ttm.c b/drivers/gpu/drm/i915/gem/i915_gem_ttm.c
index e70f03994905..f03ab7c45db7 100644
--- a/drivers/gpu/drm/i915/gem/i915_gem_ttm.c
+++ b/drivers/gpu/drm/i915/gem/i915_gem_ttm.c
@@ -539,8 +539,9 @@ int __i915_gem_ttm_object_init(struct intel_memory_region *mem,
i915_gem_object_make_unshrinkable(obj);
ret = ttm_bo_init(&i915->bdev, i915_gem_to_ttm(obj), size,
- ttm_bo_type_kernel, &i915_sys_placement, PAGE_SIZE,
- true, NULL, NULL, i915_ttm_bo_destroy);
+ ttm_bo_type_kernel, &i915_sys_placement,
+ mem->min_page_size, true, NULL, NULL,
+ i915_ttm_bo_destroy);
obj->read_domains = I915_GEM_DOMAIN_WC | I915_GEM_DOMAIN_GTT;
diff --git a/drivers/gpu/drm/i915/intel_memory_region.h b/drivers/gpu/drm/i915/intel_memory_region.h
index 8c7fd49bdca6..9817885ac2b7 100644
--- a/drivers/gpu/drm/i915/intel_memory_region.h
+++ b/drivers/gpu/drm/i915/intel_memory_region.h
@@ -39,8 +39,7 @@ enum intel_region_id {
#define REGION_STOLEN_SMEM BIT(INTEL_REGION_STOLEN_SMEM)
#define REGION_STOLEN_LMEM BIT(INTEL_REGION_STOLEN_LMEM)
-#define I915_ALLOC_MIN_PAGE_SIZE BIT(0)
-#define I915_ALLOC_CONTIGUOUS BIT(1)
+#define I915_ALLOC_CONTIGUOUS BIT(0)
#define for_each_memory_region(mr, i915, id) \
for (id = 0; id < ARRAY_SIZE((i915)->mm.regions); id++) \
diff --git a/drivers/gpu/drm/i915/intel_region_ttm.c b/drivers/gpu/drm/i915/intel_region_ttm.c
index b4886cd7026e..f1d02677caaa 100644
--- a/drivers/gpu/drm/i915/intel_region_ttm.c
+++ b/drivers/gpu/drm/i915/intel_region_ttm.c
@@ -150,7 +150,7 @@ void *intel_region_ttm_node_alloc(struct intel_memory_region *mem,
int ret;
res.num_pages = size >> PAGE_SHIFT;
- mock_bo.page_alignment = PAGE_SIZE;
+ mock_bo.page_alignment = mem->min_page_size;
place.flags = flags;
ret = man->func->alloc(man, &mock_bo, &place, &res);
diff --git a/drivers/gpu/drm/i915/selftests/mock_region.c b/drivers/gpu/drm/i915/selftests/mock_region.c
index c0f47f380788..091dc52909aa 100644
--- a/drivers/gpu/drm/i915/selftests/mock_region.c
+++ b/drivers/gpu/drm/i915/selftests/mock_region.c
@@ -26,7 +26,7 @@ static int mock_region_get_pages(struct drm_i915_gem_object *obj)
struct sg_table *pages;
int err;
- flags = I915_ALLOC_MIN_PAGE_SIZE;
+ flags = 0;
if (obj->flags & I915_BO_ALLOC_CONTIGUOUS)
flags |= TTM_PL_FLAG_CONTIGUOUS;
--
2.26.3
More information about the Intel-gfx-trybot
mailing list