summaryrefslogtreecommitdiff
path: root/tests/i915/gem_spin_batch.c
diff options
context:
space:
mode:
authorArkadiusz Hiler <arkadiusz.hiler@intel.com>2019-11-11 10:30:54 +0200
committerArkadiusz Hiler <arkadiusz.hiler@intel.com>2019-11-12 17:45:47 +0200
commit602003c3d751c72fc309a0e64d4193f6da720f6b (patch)
tree5e29d9b685f8268a9ad56f52ad788f4300ddc289 /tests/i915/gem_spin_batch.c
parent5997df31db10f190fe8b70d920b6a6b8d3b24126 (diff)
lib/igt_list: Update, clean-up and document igt_list
Our list was something between Wayland and Linux Kernel list implementations, right in the uncanny valley. On top of that it falsely claimed that it's a straight copy from the Wayland project. Let's make our impl more akin to the kernel one to ease the cognitive dissonance for the developers working on all those projects. This patch: * mimics the current kernel list interface * separates IGT helpers in the source files * adds brief explanation and code example for igt-doc * introduces igt_list.c as static inlines are not visible in the docs v2: mimic the kernel instead of wayland (Chris) - _head suffix for the sentinel/link struct - _entry_ in iterator names that go over the elements v3: I forgot to merge this in time and there was another call site that had to be converted in gem_spin_batch.c Cc: Petri Latvala <petri.latvala@intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Acked-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Petri Latvala <petri.latvala@intel.com>
Diffstat (limited to 'tests/i915/gem_spin_batch.c')
-rw-r--r--tests/i915/gem_spin_batch.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/i915/gem_spin_batch.c b/tests/i915/gem_spin_batch.c
index a172a6b4..c67f015f 100644
--- a/tests/i915/gem_spin_batch.c
+++ b/tests/i915/gem_spin_batch.c
@@ -140,7 +140,7 @@ static void spin_all(int i915, unsigned int flags)
#define PARALLEL_SPIN_NEW_CTX BIT(0)
{
struct igt_spin *spin, *n;
- IGT_LIST(list);
+ IGT_LIST_HEAD(list);
for_each_physical_engine(e, i915) {
uint32_t ctx;
@@ -162,7 +162,7 @@ static void spin_all(int i915, unsigned int flags)
igt_list_move(&spin->link, &list);
}
- igt_list_for_each_safe(spin, n, &list, link) {
+ igt_list_for_each_entry_safe(spin, n, &list, link) {
igt_assert(gem_bo_busy(i915, spin->handle));
igt_spin_free(i915, spin);
}