#include <string.h>
#include <errno.h>
#include <stdint.h>
#include "drmtap_internal.h"
int drmtap_gpu_generic_match(const char *driver) {
if (!driver) {
return 0;
}
if (strcmp(driver, "vkms") == 0 ||
strcmp(driver, "vmwgfx") == 0 ||
strcmp(driver, "vboxvideo") == 0 ||
strcmp(driver, "virtio_gpu") == 0 ||
strcmp(driver, "bochs-drm") == 0 ||
strcmp(driver, "cirrus") == 0 ||
strcmp(driver, "simpledrm") == 0 ||
strcmp(driver, "qxl") == 0) {
return 1;
}
return 0;
}
int drmtap_gpu_generic_process(drmtap_ctx *ctx, void *data,
uint32_t width, uint32_t height,
uint32_t stride, uint32_t format,
uint64_t modifier) {
(void)data;
(void)width;
(void)height;
(void)stride;
(void)format;
if (modifier != 0) {
drmtap_debug_log(ctx, "generic backend: unexpected modifier 0x%lx",
(unsigned long)modifier);
return -ENOTSUP;
}
drmtap_debug_log(ctx, "generic backend: linear data, no conversion needed");
return 0;
}