summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/selftests
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2016-12-29 12:09:24 +0100
committerDaniel Vetter <daniel.vetter@ffwll.ch>2016-12-30 12:08:28 +0100
commitb5c3714fe8789745521d8351d75049b9c6a0d26b (patch)
tree1bc123a6bd27cd37f222c5d0ab90b1f4d20d6b19 /drivers/gpu/drm/selftests
parent3d387d923c18afbacef8f14ccaa2ace2a297df74 (diff)
downloadlinux-stable-b5c3714fe8789745521d8351d75049b9c6a0d26b.tar.gz
linux-stable-b5c3714fe8789745521d8351d75049b9c6a0d26b.tar.bz2
linux-stable-b5c3714fe8789745521d8351d75049b9c6a0d26b.zip
drm/mm: Convert to drm_printer
Including all drivers. I thought about keeping small compat functions to avoid having to change all drivers. But I really like the drm_printer idea, so figured spreading it more widely is a good thing. v2: Review from Chris: - Natural argument order and better name for drm_mm_print. - show_mm() macro in the selftest. Cc: Rob Clark <robdclark@gmail.com> Cc: Russell King <rmk+kernel@armlinux.org.uk> Cc: Alex Deucher <alexander.deucher@amd.com> Cc: Christian König <christian.koenig@amd.com> Cc: Lucas Stach <l.stach@pengutronix.de> Cc: Tomi Valkeinen <tomi.valkeinen@ti.com> Cc: Thierry Reding <thierry.reding@gmail.com> Cc: Jyri Sarha <jsarha@ti.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> Link: http://patchwork.freedesktop.org/patch/msgid/1483009764-8281-1-git-send-email-daniel.vetter@ffwll.ch
Diffstat (limited to 'drivers/gpu/drm/selftests')
-rw-r--r--drivers/gpu/drm/selftests/test-drm_mm.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/gpu/drm/selftests/test-drm_mm.c b/drivers/gpu/drm/selftests/test-drm_mm.c
index 2ce92f4dcfc7..6d2a5cd211f3 100644
--- a/drivers/gpu/drm/selftests/test-drm_mm.c
+++ b/drivers/gpu/drm/selftests/test-drm_mm.c
@@ -194,6 +194,10 @@ static bool assert_node(struct drm_mm_node *node, struct drm_mm *mm,
return ok;
}
+#define show_mm(mm) do { \
+ struct drm_printer __p = drm_debug_printer(__func__); \
+ drm_mm_print((mm), &__p); } while (0)
+
static int igt_init(void *ignored)
{
const unsigned int size = 4096;
@@ -250,7 +254,7 @@ static int igt_init(void *ignored)
out:
if (ret)
- drm_mm_debug_table(&mm, __func__);
+ show_mm(&mm);
drm_mm_takedown(&mm);
return ret;
}
@@ -286,7 +290,7 @@ static int igt_debug(void *ignored)
return ret;
}
- drm_mm_debug_table(&mm, __func__);
+ show_mm(&mm);
return 0;
}
@@ -2031,7 +2035,7 @@ static int igt_color_evict(void *ignored)
ret = 0;
out:
if (ret)
- drm_mm_debug_table(&mm, __func__);
+ show_mm(&mm);
drm_mm_for_each_node_safe(node, next, &mm)
drm_mm_remove_node(node);
drm_mm_takedown(&mm);
@@ -2130,7 +2134,7 @@ static int igt_color_evict_range(void *ignored)
ret = 0;
out:
if (ret)
- drm_mm_debug_table(&mm, __func__);
+ show_mm(&mm);
drm_mm_for_each_node_safe(node, next, &mm)
drm_mm_remove_node(node);
drm_mm_takedown(&mm);