[PATCH v2 6/6] [DEBUG] hunt for the nospace
Robert Beckett
bob.beckett at collabora.com
Wed Feb 2 17:53:17 UTC 2022
---
drivers/gpu/drm/i915/selftests/i915_gem_gtt.c | 22 ++++++++++++++++---
1 file changed, 19 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c b/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c
index 9afea008192d..1564df533bd5 100644
--- a/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c
+++ b/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c
@@ -1078,18 +1078,23 @@ static int misaligned_case(struct i915_address_space *vm, struct intel_memory_re
u64 expected_vma_size, expected_node_size;
obj = i915_gem_object_create_region(mr, size, 0, 0);
- if (IS_ERR(obj))
+ if (IS_ERR(obj)) {
+ pr_info("BOB_DEBUG: %s(): i915_gem_object_create_region returned %ld\n", __func__, PTR_ERR(obj));
return PTR_ERR(obj);
+ }
vma = i915_vma_instance(obj, vm, NULL);
if (IS_ERR(vma)) {
err = PTR_ERR(vma);
+ pr_info("BOB_DEBUG: %s(): i915_vma_instance returned %d\n", __func__, err);
goto err_put;
}
err = i915_vma_pin(vma, 0, 0, addr | flags);
- if (err)
+ if (err) {
+ pr_info("BOB_DEBUG: %s(): i915_vma_pin returned %d\n", __func__, err);
goto err_put;
+ }
i915_vma_unpin(vma);
if (!drm_mm_node_allocated(&vma->node)) {
@@ -1118,8 +1123,10 @@ static int misaligned_case(struct i915_address_space *vm, struct intel_memory_re
}
err = i915_vma_unbind_unlocked(vma);
- if (err)
+ if (err) {
+ pr_info("BOB_DEBUG: %s(): i915_vma_unbind_unlocked returned %d\n", __func__, err);
goto err_put;
+ }
GEM_BUG_ON(drm_mm_node_allocated(&vma->node));
@@ -1147,10 +1154,15 @@ static int misaligned_pin(struct i915_address_space *vm,
u64 size = min_alignment;
u64 addr = round_up(hole_start + (hole_size / 2), min_alignment);
+ pr_info("BOB_DEBUG: %s(): id=%d hole_start=0x%llx hole_end=0x%llx hole_size=0x%llx min_alignment=0x%llx size=0x%llx addr=0x%llx ggtt=%d\n",
+ __func__, (int)id, hole_start, hole_end, hole_size, min_alignment, size, addr, i915_is_ggtt(vm));
+
/* 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);
/* misaligned should error with -EINVAL*/
+ if (err == -ENOSPC)
+ pr_info("BOB_DEBUG: %s(): misaligned case returned %d\n", __func__, err);
if (!err)
err = -EBADSLT;
if (err != -EINVAL)
@@ -1165,6 +1177,8 @@ static int misaligned_pin(struct i915_address_space *vm,
else if (err == -ENOSPC)
err = 0;
}
+ if (err == -ENOSPC)
+ pr_info("BOB_DEBUG: %s(): min page size case returned %d\n", __func__, err);
if (err)
return err;
@@ -1176,6 +1190,8 @@ static int misaligned_pin(struct i915_address_space *vm,
else if (err == -ENOSPC)
err = 0;
}
+ if (err == -ENOSPC)
+ pr_info("BOB_DEBUG: %s(): min page size case returned %d\n", __func__, err);
if (err)
return err;
}
--
2.25.1
More information about the Intel-gfx-trybot
mailing list