From b554c093996284872f91d9c1ed791f4bda6d913b Mon Sep 17 00:00:00 2001 From: Boris Brezillon Date: Tue, 12 Dec 2023 15:26:39 +0100 Subject: [PATCH] panfrost: Make panfrost_texfeatures.c panfrost_device agnostic Signed-off-by: Boris Brezillon Reviewed-by: Erik Faye-Lund Part-of: --- src/panfrost/tools/panfrost_texfeatures.c | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/src/panfrost/tools/panfrost_texfeatures.c b/src/panfrost/tools/panfrost_texfeatures.c index f64a962aec0..b5696816fdc 100644 --- a/src/panfrost/tools/panfrost_texfeatures.c +++ b/src/panfrost/tools/panfrost_texfeatures.c @@ -4,8 +4,16 @@ * SPDX-License-Identifier: MIT */ +#include +#include #include -#include +#include +#include +#include +#include + +#include +#include /* * Mapping of texture feature bits to compressed formats on Mali-G57, other @@ -61,11 +69,13 @@ main(void) exit(1); } - void *ctx = ralloc_context(NULL); - struct panfrost_device dev = {0}; - panfrost_open_device(ctx, fd, &dev); + struct pan_kmod_dev *dev = + pan_kmod_dev_create(fd, PAN_KMOD_DEV_FLAG_OWNS_FD, NULL); + struct pan_kmod_dev_props props; - uint32_t supported = dev.compressed_formats; + pan_kmod_dev_query_props(dev, &props); + + uint32_t supported = panfrost_query_compressed_formats(&props); bool all_ok = true; printf("System-on-chip compressed texture support:" @@ -93,6 +103,5 @@ main(void) "Unsupported formats will be emulated at a performance and memory cost.\n"); } - panfrost_close_device(&dev); - ralloc_free(ctx); + pan_kmod_dev_destroy(dev); }