[PATCH v4 2/4] drm/i915: Wrap more accesses to i915.vma.node.start|size
Thomas Hellström
thomas.hellstrom at linux.intel.com
Mon Mar 21 20:11:41 UTC 2022
Some of the leftovers converted. Probably only one that matters.
Signed-off-by: Thomas Hellström <thomas.hellstrom at linux.intel.com>
---
drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c | 2 +-
drivers/gpu/drm/i915/gem/selftests/huge_pages.c | 16 ++++++++--------
drivers/gpu/drm/i915/i915_trace.h | 8 ++++----
drivers/gpu/drm/i915/selftests/i915_vma.c | 8 ++++----
4 files changed, 17 insertions(+), 17 deletions(-)
diff --git a/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
index 0f3c2f951990..b9c989e418d5 100644
--- a/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
+++ b/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
@@ -1386,7 +1386,7 @@ relocate_entry(struct i915_vma *vma,
goto repeat;
}
- return target->node.start | UPDATE;
+ return i915_vma_offset(vma) | UPDATE;
}
static u64
diff --git a/drivers/gpu/drm/i915/gem/selftests/huge_pages.c b/drivers/gpu/drm/i915/gem/selftests/huge_pages.c
index fcb2e3004c62..157692ac79d5 100644
--- a/drivers/gpu/drm/i915/gem/selftests/huge_pages.c
+++ b/drivers/gpu/drm/i915/gem/selftests/huge_pages.c
@@ -786,18 +786,18 @@ static int igt_mock_ppgtt_huge_fill(void *arg)
i915_vma_unpin(vma);
if (vma->page_sizes.sg & I915_GTT_PAGE_SIZE_64K) {
- if (!IS_ALIGNED(vma->node.start,
+ if (!IS_ALIGNED(i915_vma_offset(vma),
I915_GTT_PAGE_SIZE_2M)) {
pr_err("node.start(%llx) not aligned to 2M\n",
- vma->node.start);
+ i915_vma_offset(vma));
err = -EINVAL;
break;
}
- if (!IS_ALIGNED(vma->node.size,
+ if (!IS_ALIGNED(i915_vma_size(vma),
I915_GTT_PAGE_SIZE_2M)) {
pr_err("node.size(%llx) not aligned to 2M\n",
- vma->node.size);
+ i915_vma_size(vma));
err = -EINVAL;
break;
}
@@ -942,18 +942,18 @@ static int igt_mock_ppgtt_64K(void *arg)
goto out_vma_unpin;
if (!offset && vma->page_sizes.sg & I915_GTT_PAGE_SIZE_64K) {
- if (!IS_ALIGNED(vma->node.start,
+ if (!IS_ALIGNED(i915_vma_offset(vma),
I915_GTT_PAGE_SIZE_2M)) {
pr_err("node.start(%llx) not aligned to 2M\n",
- vma->node.start);
+ i915_vma_offset(vma));
err = -EINVAL;
goto out_vma_unpin;
}
- if (!IS_ALIGNED(vma->node.size,
+ if (!IS_ALIGNED(i915_vma_size(vma),
I915_GTT_PAGE_SIZE_2M)) {
pr_err("node.size(%llx) not aligned to 2M\n",
- vma->node.size);
+ i915_vma_size(vma));
err = -EINVAL;
goto out_vma_unpin;
}
diff --git a/drivers/gpu/drm/i915/i915_trace.h b/drivers/gpu/drm/i915/i915_trace.h
index 37b5c9e9d260..b92cd364e8f9 100644
--- a/drivers/gpu/drm/i915/i915_trace.h
+++ b/drivers/gpu/drm/i915/i915_trace.h
@@ -71,8 +71,8 @@ TRACE_EVENT(i915_vma_bind,
TP_fast_assign(
__entry->obj = vma->obj;
__entry->vm = vma->vm;
- __entry->offset = vma->node.start;
- __entry->size = vma->node.size;
+ __entry->offset = i915_vma_offset(vma);
+ __entry->size = i915_vma_size(vma);
__entry->flags = flags;
),
@@ -96,8 +96,8 @@ TRACE_EVENT(i915_vma_unbind,
TP_fast_assign(
__entry->obj = vma->obj;
__entry->vm = vma->vm;
- __entry->offset = vma->node.start;
- __entry->size = vma->node.size;
+ __entry->offset = i915_vma_offset(vma);
+ __entry->size = i915_vma_size(vma);
),
TP_printk("obj=%p, offset=0x%016llx size=0x%llx vm=%p",
diff --git a/drivers/gpu/drm/i915/selftests/i915_vma.c b/drivers/gpu/drm/i915/selftests/i915_vma.c
index 6921ba128015..e00a9e45a077 100644
--- a/drivers/gpu/drm/i915/selftests/i915_vma.c
+++ b/drivers/gpu/drm/i915/selftests/i915_vma.c
@@ -653,9 +653,9 @@ static int igt_vma_rotate_remap(void *arg)
goto out_object;
}
- if (vma->node.size < vma->size) {
+ if (i915_vma_size(vma) < vma->size) {
pr_err("VMA binding too small, expected %llu, found %llu\n",
- vma->size, vma->node.size);
+ vma->size, i915_vma_size(vma));
err = -EINVAL;
goto out_object;
}
@@ -753,9 +753,9 @@ static bool assert_pin(struct i915_vma *vma,
ok = false;
}
- if (vma->node.size < vma->size) {
+ if (i915_vma_size(vma) < vma->size) {
pr_err("(%s) VMA binding too small, expected %llu, found %llu\n",
- name, vma->size, vma->node.size);
+ name, vma->size, i915_vma_size(vma));
ok = false;
}
--
2.34.1
More information about the Intel-gfx-trybot
mailing list