summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/i915/intel_region_ttm.c
diff options
context:
space:
mode:
authorMatthew Auld <matthew.auld@intel.com>2021-06-25 13:38:23 +0300
committerMatthew Auld <matthew.auld@intel.com>2021-06-30 15:24:29 +0300
commitd22632c83b948e4f7a3d4202a884be2409098cc2 (patch)
tree6c54a39208b130222bea51a6ba2a53f0137bc0ad /drivers/gpu/drm/i915/intel_region_ttm.c
parente11b7b6e574d57b99952213b5388db66445b18f2 (diff)
downloadlinux-d22632c83b948e4f7a3d4202a884be2409098cc2.tar.xz
drm/i915: support forcing the page size with lmem
For some specialised objects we might need something larger than the regions min_page_size due to some hw restriction, and slightly more hairy is needing something smaller with the guarantee that such objects will never be inserted into any GTT, which is the case for the paging structures. This also fixes how we setup the BO page_alignment, if we later migrate the object somewhere else. For example if the placements are {SMEM, LMEM}, then we might get this wrong. Pushing the min_page_size behaviour into the manager should fix this. v2(Thomas): push the default page size behaviour into buddy_man, and let the user override it with the page-alignment, which looks cleaner v3: rebase on ttm sys changes Signed-off-by: Matthew Auld <matthew.auld@intel.com> Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com> Reviewed-by: Thomas Hellström <thomas.hellstrom@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20210625103824.558481-1-matthew.auld@intel.com
Diffstat (limited to 'drivers/gpu/drm/i915/intel_region_ttm.c')
-rw-r--r--drivers/gpu/drm/i915/intel_region_ttm.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/gpu/drm/i915/intel_region_ttm.c b/drivers/gpu/drm/i915/intel_region_ttm.c
index 4cd10f364e84..98c7339bf8ba 100644
--- a/drivers/gpu/drm/i915/intel_region_ttm.c
+++ b/drivers/gpu/drm/i915/intel_region_ttm.c
@@ -86,7 +86,8 @@ int intel_region_ttm_init(struct intel_memory_region *mem)
int ret;
ret = i915_ttm_buddy_man_init(bdev, mem_type, false,
- resource_size(&mem->region), PAGE_SIZE);
+ resource_size(&mem->region),
+ mem->min_page_size, PAGE_SIZE);
if (ret)
return ret;
@@ -167,7 +168,6 @@ intel_region_ttm_resource_alloc(struct intel_memory_region *mem,
int ret;
mock_bo.base.size = size;
- mock_bo.page_alignment = mem->min_page_size >> PAGE_SHIFT;
place.flags = flags;
ret = man->func->alloc(man, &mock_bo, &place, &res);