[PATCH 2/4] brute
Andi Shyti
andi.shyti at linux.intel.com
Fri Nov 4 10:04:42 UTC 2022
From: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
---
.../drm/i915/display/skl_universal_plane.c | 2 +-
.../gpu/drm/i915/gem/i915_gem_execbuffer.c | 2 +-
.../gpu/drm/i915/gem/selftests/huge_pages.c | 24 +++++------
drivers/gpu/drm/i915/i915_trace.h | 8 ++--
drivers/gpu/drm/i915/selftests/i915_gem_gtt.c | 40 +++++++++----------
5 files changed, 38 insertions(+), 38 deletions(-)
diff --git a/drivers/gpu/drm/i915/display/skl_universal_plane.c b/drivers/gpu/drm/i915/display/skl_universal_plane.c
index 46e10b369a3d..10e772964162 100644
--- a/drivers/gpu/drm/i915/display/skl_universal_plane.c
+++ b/drivers/gpu/drm/i915/display/skl_universal_plane.c
@@ -996,7 +996,7 @@ static u32 skl_surf_address(const struct intel_plane_state *plane_state,
* The DPT object contains only one vma, so the VMA's offset
* within the DPT is always 0.
*/
- drm_WARN_ON(&i915->drm, plane_state->dpt_vma->node.start);
+ drm_WARN_ON(&i915->drm, i915_vma_offset(plane_state->dpt_vma));
drm_WARN_ON(&i915->drm, offset & 0x1fffff);
return offset >> 9;
} else {
diff --git a/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
index 5f09d33f1c83..867e1677ec52 100644
--- a/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
+++ b/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
@@ -441,7 +441,7 @@ eb_pin_vma(struct i915_execbuffer *eb,
u64 pin_flags;
int err;
- if (vma->node.size)
+ if (i915_vma_size(vma))
pin_flags = __i915_vma_offset(vma);
else
pin_flags = entry->offset & PIN_OFFSET_MASK;
diff --git a/drivers/gpu/drm/i915/gem/selftests/huge_pages.c b/drivers/gpu/drm/i915/gem/selftests/huge_pages.c
index 51d286c14f76..c60a8747b918 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);
+ pr_err("vma offset(%llx) not aligned to 2M\n",
+ 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);
+ pr_err("vma size(%llx) not aligned to 2M\n",
+ 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);
+ pr_err("vma start(%llx) not aligned to 2M\n",
+ 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);
+ pr_err("vma size(%llx) not aligned to 2M\n",
+ 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 c70a02517e02..883c134149da 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_gem_gtt.c b/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c
index 27c733b00976..f4ca3e68d4a8 100644
--- a/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c
+++ b/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c
@@ -473,7 +473,7 @@ static int fill_hole(struct i915_address_space *vm,
if (!drm_mm_node_allocated(&vma->node) ||
i915_vma_misplaced(vma, 0, 0, offset | flags)) {
pr_err("%s(%s) (forward) insert failed: vma.node=%llx + %llx [allocated? %d], expected offset %llx\n",
- __func__, p->name, vma->node.start, vma->node.size, drm_mm_node_allocated(&vma->node),
+ __func__, p->name, i915_vma_offset(vma), i915_vma_size(vma), drm_mm_node_allocated(&vma->node),
offset);
err = -EINVAL;
goto err;
@@ -506,7 +506,7 @@ static int fill_hole(struct i915_address_space *vm,
if (!drm_mm_node_allocated(&vma->node) ||
i915_vma_misplaced(vma, 0, 0, offset | flags)) {
pr_err("%s(%s) (forward) moved vma.node=%llx + %llx, expected offset %llx\n",
- __func__, p->name, vma->node.start, vma->node.size,
+ __func__, p->name, i915_vma_offset(vma), i915_vma_size(vma),
offset);
err = -EINVAL;
goto err;
@@ -515,7 +515,7 @@ static int fill_hole(struct i915_address_space *vm,
err = i915_vma_unbind_unlocked(vma);
if (err) {
pr_err("%s(%s) (forward) unbind of vma.node=%llx + %llx failed with err=%d\n",
- __func__, p->name, vma->node.start, vma->node.size,
+ __func__, p->name, i915_vma_offset(vma), i915_vma_size(vma),
err);
goto err;
}
@@ -552,7 +552,7 @@ static int fill_hole(struct i915_address_space *vm,
if (!drm_mm_node_allocated(&vma->node) ||
i915_vma_misplaced(vma, 0, 0, offset | flags)) {
pr_err("%s(%s) (backward) insert failed: vma.node=%llx + %llx [allocated? %d], expected offset %llx\n",
- __func__, p->name, vma->node.start, vma->node.size, drm_mm_node_allocated(&vma->node),
+ __func__, p->name, i915_vma_offset(vma), i915_vma_size(vma), drm_mm_node_allocated(&vma->node),
offset);
err = -EINVAL;
goto err;
@@ -585,7 +585,7 @@ static int fill_hole(struct i915_address_space *vm,
if (!drm_mm_node_allocated(&vma->node) ||
i915_vma_misplaced(vma, 0, 0, offset | flags)) {
pr_err("%s(%s) (backward) moved vma.node=%llx + %llx [allocated? %d], expected offset %llx\n",
- __func__, p->name, vma->node.start, vma->node.size, drm_mm_node_allocated(&vma->node),
+ __func__, p->name, i915_vma_offset(vma), i915_vma_size(vma), drm_mm_node_allocated(&vma->node),
offset);
err = -EINVAL;
goto err;
@@ -594,7 +594,7 @@ static int fill_hole(struct i915_address_space *vm,
err = i915_vma_unbind_unlocked(vma);
if (err) {
pr_err("%s(%s) (backward) unbind of vma.node=%llx + %llx failed with err=%d\n",
- __func__, p->name, vma->node.start, vma->node.size,
+ __func__, p->name, i915_vma_offset(vma), i915_vma_size(vma),
err);
goto err;
}
@@ -1118,7 +1118,7 @@ static int misaligned_case(struct i915_address_space *vm, struct intel_memory_re
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 || i915_vma_size(vma) != expected_node_size) {
err = i915_vma_unbind_unlocked(vma);
err = -EBADSLT;
goto err_put;
@@ -1569,10 +1569,10 @@ static int igt_gtt_reserve(void *arg)
track_vma_bind(vma);
GEM_BUG_ON(!drm_mm_node_allocated(&vma->node));
- if (vma->node.start != total ||
- vma->node.size != 2*I915_GTT_PAGE_SIZE) {
+ if (i915_vma_offset(vma) != total ||
+ i915_vma_size(vma) != 2*I915_GTT_PAGE_SIZE) {
pr_err("i915_gem_gtt_reserve (pass 1) placement failed, found (%llx + %llx), expected (%llx + %llx)\n",
- vma->node.start, vma->node.size,
+ i915_vma_offset(vma), i915_vma_size(vma),
total, 2*I915_GTT_PAGE_SIZE);
err = -EINVAL;
goto out;
@@ -1615,10 +1615,10 @@ static int igt_gtt_reserve(void *arg)
track_vma_bind(vma);
GEM_BUG_ON(!drm_mm_node_allocated(&vma->node));
- if (vma->node.start != total ||
- vma->node.size != 2*I915_GTT_PAGE_SIZE) {
+ if (i915_vma_offset(vma) != total ||
+ i915_vma_size(vma) != 2*I915_GTT_PAGE_SIZE) {
pr_err("i915_gem_gtt_reserve (pass 2) placement failed, found (%llx + %llx), expected (%llx + %llx)\n",
- vma->node.start, vma->node.size,
+ i915_vma_offset(vma), i915_vma_size(vma),
total, 2*I915_GTT_PAGE_SIZE);
err = -EINVAL;
goto out;
@@ -1656,10 +1656,10 @@ static int igt_gtt_reserve(void *arg)
track_vma_bind(vma);
GEM_BUG_ON(!drm_mm_node_allocated(&vma->node));
- if (vma->node.start != offset ||
- vma->node.size != 2*I915_GTT_PAGE_SIZE) {
+ if (i915_vma_offset(vma) != offset ||
+ i915_vma_size(vma) != 2*I915_GTT_PAGE_SIZE) {
pr_err("i915_gem_gtt_reserve (pass 3) placement failed, found (%llx + %llx), expected (%llx + %llx)\n",
- vma->node.start, vma->node.size,
+ i915_vma_offset(vma), i915_vma_size(vma),
offset, 2*I915_GTT_PAGE_SIZE);
err = -EINVAL;
goto out;
@@ -1830,7 +1830,7 @@ static int igt_gtt_insert(void *arg)
}
GEM_BUG_ON(!drm_mm_node_allocated(&vma->node));
- offset = vma->node.start;
+ offset = i915_vma_offset(vma);
err = i915_vma_unbind_unlocked(vma);
if (err) {
@@ -1847,9 +1847,9 @@ static int igt_gtt_insert(void *arg)
track_vma_bind(vma);
GEM_BUG_ON(!drm_mm_node_allocated(&vma->node));
- if (vma->node.start != offset) {
+ if (i915_vma_offset(vma) != offset) {
pr_err("i915_gem_gtt_insert did not return node to its previous location (the only hole), expected address %llx, found %llx\n",
- offset, vma->node.start);
+ offset, i915_vma_offset(vma));
err = -EINVAL;
goto out;
}
@@ -2097,7 +2097,7 @@ static int igt_cs_tlb(void *arg)
(vm->total - PAGE_SIZE));
if (err)
goto out_put_out;
- GEM_BUG_ON(vma->node.start != vm->total - PAGE_SIZE);
+ GEM_BUG_ON(i915_vma_offset(vma) != vm->total - PAGE_SIZE);
result = i915_gem_object_pin_map_unlocked(out, I915_MAP_WB);
if (IS_ERR(result)) {
--
2.34.1
More information about the Intel-gfx-trybot
mailing list