Commit 0f9fc0c1 authored by Matthew Auld's avatar Matthew Auld

drm/i915/selftests: tweak the misaligned_case

The compact-pt layout restrictions should only apply to the ppGTT. Also
make this play nice on platforms that only have the 64K GTT restriction,
and not the compact-pt thing.
Signed-off-by: default avatarMatthew Auld <matthew.auld@intel.com>
Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com>
Cc: Nirmoy Das <nirmoy.das@linux.intel.com>
Cc: Ramalingam C <ramalingam.c@intel.com>
Reviewed-by: default avatarNirmoy Das <nirmoy.das@linux.intel.com>
Reviewed-by: default avatarRamalingam C <ramalingam.c@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220420181613.70033-4-matthew.auld@intel.com
parent 9707cc4b
...@@ -1112,10 +1112,16 @@ static int misaligned_case(struct i915_address_space *vm, struct intel_memory_re ...@@ -1112,10 +1112,16 @@ static int misaligned_case(struct i915_address_space *vm, struct intel_memory_re
expected_vma_size = round_up(size, 1 << (ffs(vma->resource->page_sizes_gtt) - 1)); expected_vma_size = round_up(size, 1 << (ffs(vma->resource->page_sizes_gtt) - 1));
expected_node_size = expected_vma_size; expected_node_size = expected_vma_size;
if (NEEDS_COMPACT_PT(vm->i915) && i915_gem_object_is_lmem(obj)) { if (HAS_64K_PAGES(vm->i915) && i915_gem_object_is_lmem(obj)) {
/* compact-pt should expand lmem node to 2MB */ /*
* The compact-pt should expand lmem node to 2MB for the ppGTT,
* for all other cases we should only expect 64K.
*/
expected_vma_size = round_up(size, I915_GTT_PAGE_SIZE_64K); expected_vma_size = round_up(size, I915_GTT_PAGE_SIZE_64K);
if (NEEDS_COMPACT_PT(vm->i915) && !i915_is_ggtt(vm))
expected_node_size = round_up(size, I915_GTT_PAGE_SIZE_2M); expected_node_size = round_up(size, I915_GTT_PAGE_SIZE_2M);
else
expected_node_size = round_up(size, I915_GTT_PAGE_SIZE_64K);
} }
if (vma->size != expected_vma_size || vma->node.size != expected_node_size) { if (vma->size != expected_vma_size || vma->node.size != expected_node_size) {
......
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