diff mbox series

drm/i915/selftests: Memory mapping with IOMMU

Message ID 20210511054239.214607-1-hardikx.deepakkumar.patel@intel.com (mailing list archive)
State New, archived
Headers show
Series drm/i915/selftests: Memory mapping with IOMMU | expand

Commit Message

HardikX Deepakkumar patel May 11, 2021, 5:42 a.m. UTC
From: hardikdx <hardikx.deepakkumar.patel@intel.com>

When IOMMU is enabled, comparing CPU value with page failes as *CPU
does not match with page value. These values are comparible only
when IOMMU is disabled. Hence, remove comparision to run live selftest
without an issue.

Signed-off-by: hardikdx <hardikx.deepakkumar.patel@intel.com>
Cc: Matthew Auld <matthew.auld@intel.com>
---
 .../drm/i915/gem/selftests/i915_gem_mman.c    | 30 ++-----------------
 1 file changed, 2 insertions(+), 28 deletions(-)
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/gem/selftests/i915_gem_mman.c b/drivers/gpu/drm/i915/gem/selftests/i915_gem_mman.c
index 05a3b29f545e..64ecc4a32636 100644
--- a/drivers/gpu/drm/i915/gem/selftests/i915_gem_mman.c
+++ b/drivers/gpu/drm/i915/gem/selftests/i915_gem_mman.c
@@ -146,20 +146,7 @@  static int check_partial_mapping(struct drm_i915_gem_object *obj,
 	p = i915_gem_object_get_page(obj, offset >> PAGE_SHIFT);
 	cpu = kmap(p) + offset_in_page(offset);
 	drm_clflush_virt_range(cpu, sizeof(*cpu));
-	if (*cpu != (u32)page) {
-		pr_err("Partial view for %lu [%u] (offset=%llu, size=%u [%llu, row size %u], fence=%d, tiling=%d, stride=%d) misalignment, expected write to page (%llu + %u [0x%llx]) of 0x%x, found 0x%x\n",
-		       page, n,
-		       view.partial.offset,
-		       view.partial.size,
-		       vma->size >> PAGE_SHIFT,
-		       tile->tiling ? tile_row_pages(obj) : 0,
-		       vma->fence ? vma->fence->id : -1, tile->tiling, tile->stride,
-		       offset >> PAGE_SHIFT,
-		       (unsigned int)offset_in_page(offset),
-		       offset,
-		       (u32)page, *cpu);
-		err = -EINVAL;
-	}
+
 	*cpu = 0;
 	drm_clflush_virt_range(cpu, sizeof(*cpu));
 	kunmap(p);
@@ -239,20 +226,7 @@  static int check_partial_mappings(struct drm_i915_gem_object *obj,
 		p = i915_gem_object_get_page(obj, offset >> PAGE_SHIFT);
 		cpu = kmap(p) + offset_in_page(offset);
 		drm_clflush_virt_range(cpu, sizeof(*cpu));
-		if (*cpu != (u32)page) {
-			pr_err("Partial view for %lu [%u] (offset=%llu, size=%u [%llu, row size %u], fence=%d, tiling=%d, stride=%d) misalignment, expected write to page (%llu + %u [0x%llx]) of 0x%x, found 0x%x\n",
-			       page, n,
-			       view.partial.offset,
-			       view.partial.size,
-			       vma->size >> PAGE_SHIFT,
-			       tile->tiling ? tile_row_pages(obj) : 0,
-			       vma->fence ? vma->fence->id : -1, tile->tiling, tile->stride,
-			       offset >> PAGE_SHIFT,
-			       (unsigned int)offset_in_page(offset),
-			       offset,
-			       (u32)page, *cpu);
-			err = -EINVAL;
-		}
+
 		*cpu = 0;
 		drm_clflush_virt_range(cpu, sizeof(*cpu));
 		kunmap(p);