mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 07:13:54 -06:00
vhost-user-gpu: fix vugbm_device_init fallback
vugbm implements GBM device wrapping, udmabuf and memory fallback. However, the fallback/detection logic is flawed, as if "/dev/udmabuf" failed to be opened, it will not initialize vugbm and crash later. Rework the vugbm_device_init() logic to initialize correctly in all cases. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20210312100108.2706195-4-marcandre.lureau@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
This commit is contained in:
parent
0c27b9c568
commit
96ee096a13
3 changed files with 22 additions and 30 deletions
|
@ -1186,11 +1186,7 @@ main(int argc, char *argv[])
|
|||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
if (g.drm_rnode_fd >= 0) {
|
||||
if (!vugbm_device_init(&g.gdev, g.drm_rnode_fd)) {
|
||||
g_warning("Failed to init DRM device, using fallback path");
|
||||
}
|
||||
}
|
||||
vugbm_device_init(&g.gdev, g.drm_rnode_fd);
|
||||
|
||||
if ((!!opt_socket_path + (opt_fdnum != -1)) != 1) {
|
||||
g_printerr("Please specify either --fd or --socket-path\n");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue