OSDN Git Service

vhost-user-gpu: fix vugbm_device_init fallback
authorMarc-André Lureau <marcandre.lureau@redhat.com>
Fri, 12 Mar 2021 10:00:44 +0000 (14:00 +0400)
committerGerd Hoffmann <kraxel@redhat.com>
Fri, 26 Mar 2021 05:37:03 +0000 (06:37 +0100)
commit96ee096a1332086285c98d92f750ea0c3cb32564
treeb161ba3a1b5d066a1957865eb342047b42e49f38
parent0c27b9c5687fd276e26c3a95ca6d89f792fc7a1c
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>
contrib/vhost-user-gpu/vhost-user-gpu.c
contrib/vhost-user-gpu/vugbm.c
contrib/vhost-user-gpu/vugbm.h