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:

committed by
Marge Bot

parent
f2c06d0813
commit
b554c09399
@@ -4,8 +4,16 @@
|
|||||||
* SPDX-License-Identifier: MIT
|
* SPDX-License-Identifier: MIT
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <assert.h>
|
||||||
|
#include <stdbool.h>
|
||||||
#include <stdio.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
|
* Mapping of texture feature bits to compressed formats on Mali-G57, other
|
||||||
@@ -61,11 +69,13 @@ main(void)
|
|||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
void *ctx = ralloc_context(NULL);
|
struct pan_kmod_dev *dev =
|
||||||
struct panfrost_device dev = {0};
|
pan_kmod_dev_create(fd, PAN_KMOD_DEV_FLAG_OWNS_FD, NULL);
|
||||||
panfrost_open_device(ctx, fd, &dev);
|
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;
|
bool all_ok = true;
|
||||||
|
|
||||||
printf("System-on-chip compressed texture support:"
|
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");
|
"Unsupported formats will be emulated at a performance and memory cost.\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
panfrost_close_device(&dev);
|
pan_kmod_dev_destroy(dev);
|
||||||
ralloc_free(ctx);
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user