panfrost: Make panfrost_texfeatures.c panfrost_device agnostic

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26698>
This commit is contained in:
Boris Brezillon
2023-12-12 15:26:39 +01:00
committed by Marge Bot
parent f2c06d0813
commit b554c09399

View File

@@ -4,8 +4,16 @@
* SPDX-License-Identifier: MIT
*/
#include <assert.h>
#include <stdbool.h>
#include <stdio.h>
#include <lib/pan_device.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <xf86drm.h>
#include <lib/kmod/pan_kmod.h>
#include <lib/pan_props.h>
/*
* 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);
}