This commit is contained in:
JerryXiao 2023-04-26 00:18:33 +08:00
parent ad6154021e
commit eb8bcbad8b
Signed by: Jerry
GPG key ID: 22618F758B5BE2E5

View file

@ -422,9 +422,24 @@ int main(int argc, const char **argv)
mmap_size = open_arg.size; mmap_size = open_arg.size;
mmap_offset = mmap_arg.out.addr_ptr; mmap_offset = mmap_arg.out.addr_ptr;
} }
else if (strcmp(drm_ver->name, "nvidia-drm") == 0) { else {
if (strcmp(drm_ver->name, "nvidia-drm") == 0) {
// quirky
convert_func = &convert_nv_stripe; convert_func = &convert_nv_stripe;
vblank_func = &drm_wait_vblank_noop; vblank_func = &drm_wait_vblank_noop;
}
else if (strcmp(drm_ver->name, "vmwgfx") == 0) {
}
else if (strcmp(drm_ver->name, "vboxvideo") == 0) {
vblank_func = &drm_wait_vblank_noop;
}
else if (strcmp(drm_ver->name, "virtio_gpu") == 0) {
// virgl does not work
vblank_func = &drm_wait_vblank_noop;
}
else {
fprintf(stderr, "Untested drm driver, use at your own risk!\n");
}
struct drm_mode_map_dumb mreq; struct drm_mode_map_dumb mreq;
memset(&mreq, 0, sizeof(mreq)); memset(&mreq, 0, sizeof(mreq));
@ -436,10 +451,6 @@ int main(int argc, const char **argv)
mmap_size = open_arg.size; mmap_size = open_arg.size;
mmap_offset = mreq.offset; mmap_offset = mreq.offset;
} }
else {
fprintf(stderr, "Unimplemented drm driver\n");
goto cleanup;
}
if (!mapped) { if (!mapped) {
printf("mapping with size = %d, offset = %d, drmfd = %d\n", mmap_size, mmap_offset, drmfd); printf("mapping with size = %d, offset = %d, drmfd = %d\n", mmap_size, mmap_offset, drmfd);
mapped = mmap(NULL, mmap_size, PROT_READ, MAP_SHARED, drmfd, mmap_offset); mapped = mmap(NULL, mmap_size, PROT_READ, MAP_SHARED, drmfd, mmap_offset);