aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2021-02-04 14:52:13 +0400
committerGerd Hoffmann <kraxel@redhat.com>2021-02-04 15:58:54 +0100
commit326a51f32dfa56a63815c06c2ba3b14b371cef35 (patch)
tree7ded4e54225f2238ef6b69e164db344f939f8b91
parenta652b120130e89850edb18cebd222310b77218f7 (diff)
downloadqemu-326a51f32dfa56a63815c06c2ba3b14b371cef35.zip
qemu-326a51f32dfa56a63815c06c2ba3b14b371cef35.tar.gz
qemu-326a51f32dfa56a63815c06c2ba3b14b371cef35.tar.bz2
vhost-user-gpu: check backend for EDID support
EDID has been enabled by default, but the backend may not implement it (such as the contrib backend). This results in extra warnings and potentially other issues in the guest. The option shouldn't probably have been added to VIRTIO_GPU_BASE, but it's a bit too late now, report an error and disable EDID when it's not available. Fixes: 0a7196625 ("edid: flip the default to enabled") Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20210204105232.834642-2-marcandre.lureau@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
-rw-r--r--hw/display/vhost-user-gpu.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/hw/display/vhost-user-gpu.c b/hw/display/vhost-user-gpu.c
index 51f1747..55b0ed1 100644
--- a/hw/display/vhost-user-gpu.c
+++ b/hw/display/vhost-user-gpu.c
@@ -555,6 +555,12 @@ vhost_user_gpu_device_realize(DeviceState *qdev, Error **errp)
if (virtio_has_feature(g->vhost->dev.features, VIRTIO_GPU_F_VIRGL)) {
g->parent_obj.conf.flags |= 1 << VIRTIO_GPU_FLAG_VIRGL_ENABLED;
}
+ if (virtio_has_feature(g->vhost->dev.features, VIRTIO_GPU_F_EDID)) {
+ g->parent_obj.conf.flags |= 1 << VIRTIO_GPU_FLAG_EDID_ENABLED;
+ } else {
+ error_report("EDID requested but the backend doesn't support it.");
+ g->parent_obj.conf.flags &= ~(1 << VIRTIO_GPU_FLAG_EDID_ENABLED);
+ }
if (!virtio_gpu_base_device_realize(qdev, NULL, NULL, errp)) {
return;