Ok, so count was variable, how about something like this. By my back of the paper calcs this should reduce it from 408 bytes to 272 bytes.
--- drivers/gpu/drm/selftests/test-drm_mm.c | 42 ++++++++++++------------- 1 file changed, 20 insertions(+), 22 deletions(-) diff --git a/drivers/gpu/drm/selftests/test-drm_mm.c b/drivers/gpu/drm/selftests/test-drm_mm.c index 9aabe82dcd3a..fa643cc54b0b 100644 --- a/drivers/gpu/drm/selftests/test-drm_mm.c +++ b/drivers/gpu/drm/selftests/test-drm_mm.c @@ -323,32 +323,30 @@ static bool expect_reserve_fail(struct drm_mm *mm, struct drm_mm_node *node) return false; } -static bool check_reserve_boundaries(struct drm_mm *mm, - unsigned int count, - u64 size) +static bool check_reserve_boundaries(struct drm_mm *mm, int count, u64 size) { const struct boundary { - u64 start, size; + int start, size; const char *name; } boundaries[] = { #define B(st, sz) { (st), (sz), "{ " #st ", " #sz "}" } B(0, 0), - B(-size, 0), - B(size, 0), - B(size * count, 0), - B(-size, size), - B(-size, -size), - B(-size, 2*size), - B(0, -size), - B(size, -size), - B(count*size, size), - B(count*size, -size), - B(count*size, count*size), - B(count*size, -count*size), - B(count*size, -(count+1)*size), - B((count+1)*size, size), - B((count+1)*size, -size), - B((count+1)*size, -2*size), + B(-1, 0), + B(1, 0), + B(count, 0), + B(-1, 1), + B(-1, -1), + B(-1, 2), + B(0, -1), + B(1, -1), + B(count, 1), + B(count, -1), + B(count, count), + B(count, -count), + B(count, -(count + 1)), + B(count + 1, 1), + B(count + 1, -1), + B(count + 1, -2), #undef B }; struct drm_mm_node tmp = {}; @@ -357,8 +355,8 @@ static bool check_reserve_boundaries(struct drm_mm *mm, for (n = 0; n < ARRAY_SIZE(boundaries); n++) { if (!expect_reserve_fail(mm, set_node(&tmp, - boundaries[n].start, - boundaries[n].size))) { + boundaries[n].start * size, + boundaries[n].size * size))) { pr_err("boundary[%d:%s] failed, count=%u, size=%lld\n", n, boundaries[n].name, count, size); return false; -- 2.27.0.rc2 _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx