[Intel-gfx] [PATCH 2/2] drm/mm: Convert to drm_printer
Chris Wilson
chris at chris-wilson.co.uk
Wed Dec 28 17:01:17 UTC 2016
On Wed, Dec 28, 2016 at 05:42:10PM +0100, Daniel Vetter wrote:
> static int ttm_pl_vram = TTM_PL_VRAM;
> diff --git a/drivers/gpu/drm/selftests/test-drm_mm.c b/drivers/gpu/drm/selftests/test-drm_mm.c
> index 2ce92f4dcfc7..598fde492863 100644
> --- a/drivers/gpu/drm/selftests/test-drm_mm.c
> +++ b/drivers/gpu/drm/selftests/test-drm_mm.c
> @@ -249,8 +249,10 @@ static int igt_init(void *ignored)
> }
>
> out:
> - if (ret)
> - drm_mm_debug_table(&mm, __func__);
> + if (ret) {
> + struct drm_printer p = drm_debug_printer(__func__);
> + drm_mm_print_table(&p, &mm);
> + }
drm_mm_print_table(&drm_debug_printer(__func__), &mm);
But that says the parameters are reversed. Either this should be
drm_print_mm(&printer, &mm);
or
drm_mm_print(&mm, &printer);
Then here we would want a
#define show_mm(mm) drm_mm_print((mm), &drm_debug_printer(__func__))
for similarity with show_scan(), show_holes(), with the exception of
igt_debug where we still ultimately want to redirect the output to a
stringbuf.
-Chris
--
Chris Wilson, Intel Open Source Technology Centre
More information about the dri-devel
mailing list