[RFC 3/9] drm/i915: Clarify colour choices in eviction mock test
Tvrtko Ursulin
tvrtko.ursulin at linux.intel.com
Mon Jul 31 13:57:52 UTC 2023
From: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
Clarify that the colours used in the mock test do not have to have any
connection to real values from a working driver and simplify the code by
doing so.
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
---
drivers/gpu/drm/i915/selftests/i915_gem_evict.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/i915/selftests/i915_gem_evict.c b/drivers/gpu/drm/i915/selftests/i915_gem_evict.c
index f8fe3681c3dc..94122d5e56ea 100644
--- a/drivers/gpu/drm/i915/selftests/i915_gem_evict.c
+++ b/drivers/gpu/drm/i915/selftests/i915_gem_evict.c
@@ -246,7 +246,11 @@ static int igt_evict_for_cache_color(void *arg)
struct drm_mm_node target = {
.start = I915_GTT_PAGE_SIZE * 2,
.size = I915_GTT_PAGE_SIZE,
- .color = i915_gem_get_pat_index(gt->i915, I915_CACHE_LLC),
+ /*
+ * Here and later in the test we just need two different but
+ * can be made up colors so eviction can be tested.
+ */
+ .color = 13,
};
struct drm_i915_gem_object *obj;
struct i915_vma *vma;
@@ -309,7 +313,7 @@ static int igt_evict_for_cache_color(void *arg)
/* Attempt to remove the first *pinned* vma, by removing the (empty)
* neighbour -- this should fail.
*/
- target.color = i915_gem_get_pat_index(gt->i915, I915_CACHE_L3_LLC);
+ target.color = 29;
mutex_lock(&ggtt->vm.mutex);
err = i915_gem_evict_for_node(&ggtt->vm, NULL, &target, 0);
--
2.39.2
More information about the Intel-gfx-trybot
mailing list