diff --git a/server.c b/server.c index 1677672..21795c8 100644 --- a/server.c +++ b/server.c @@ -422,9 +422,24 @@ int main(int argc, const char **argv) mmap_size = open_arg.size; mmap_offset = mmap_arg.out.addr_ptr; } - else if (strcmp(drm_ver->name, "nvidia-drm") == 0) { - convert_func = &convert_nv_stripe; - vblank_func = &drm_wait_vblank_noop; + else { + if (strcmp(drm_ver->name, "nvidia-drm") == 0) { + // quirky + convert_func = &convert_nv_stripe; + 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; memset(&mreq, 0, sizeof(mreq)); @@ -436,10 +451,6 @@ int main(int argc, const char **argv) mmap_size = open_arg.size; mmap_offset = mreq.offset; } - else { - fprintf(stderr, "Unimplemented drm driver\n"); - goto cleanup; - } if (!mapped) { 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);