[PATCH] drm/i915/selftests: do not try misaligned_pin test on unmappable memory

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



In case of Small BAR configurations stolen local memory can be unmappable.
Trying to test it causes -ENOSPC error from _i915_gem_object_stolen_init.

Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/6565
Signed-off-by: Andrzej Hajda <andrzej.hajda@xxxxxxxxx>
---
 drivers/gpu/drm/i915/selftests/i915_gem_gtt.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c b/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c
index fb5e6196347925..667c4c004bdbcf 100644
--- a/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c
+++ b/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c
@@ -1164,6 +1164,10 @@ static int misaligned_pin(struct i915_address_space *vm,
 		if (hole_size < 3 * min_alignment)
 			continue;
 
+		/* avoid -ENOSPC on unmappable memory */
+		if (!mr->io_size)
+			continue;
+
 		/* we can't test < 4k alignment due to flags being encoded in lower bits */
 		if (min_alignment != I915_GTT_PAGE_SIZE_4K) {
 			err = misaligned_case(vm, mr, addr + (min_alignment / 2), size, flags);
-- 
2.25.1




[Index of Archives]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux