@@ -64,6 +64,10 @@ virtio_gpu_base_generate_edid(VirtIOGPUBase *g, int scanout,
.refresh_rate = g->req_state[scanout].refresh_rate,
};
+ if (virtio_gpu_edid_name_enabled(g->conf)) {
+ info.name = qemu_console_get_name(g->scanout[scanout].con, NULL);
+ }
+
edid->size = cpu_to_le32(sizeof(edid->edid));
qemu_edid_generate(edid->edid, sizeof(edid->edid), &info);
}
@@ -97,6 +97,7 @@ enum virtio_gpu_base_conf_flags {
VIRTIO_GPU_FLAG_BLOB_ENABLED,
VIRTIO_GPU_FLAG_CONTEXT_INIT_ENABLED,
VIRTIO_GPU_FLAG_RUTABAGA_ENABLED,
+ VIRTIO_GPU_FLAG_EDID_NAME_ENABLED,
};
#define virtio_gpu_virgl_enabled(_cfg) \
@@ -115,6 +116,8 @@ enum virtio_gpu_base_conf_flags {
(_cfg.flags & (1 << VIRTIO_GPU_FLAG_RUTABAGA_ENABLED))
#define virtio_gpu_hostmem_enabled(_cfg) \
(_cfg.hostmem > 0)
+#define virtio_gpu_edid_name_enabled(_cfg) \
+ (_cfg.flags & (1 << VIRTIO_GPU_FLAG_EDID_NAME_ENABLED))
struct virtio_gpu_base_conf {
uint32_t max_outputs;
@@ -163,6 +166,8 @@ struct VirtIOGPUBaseClass {
DEFINE_PROP_UINT32("max_outputs", _state, _conf.max_outputs, 1), \
DEFINE_PROP_BIT("edid", _state, _conf.flags, \
VIRTIO_GPU_FLAG_EDID_ENABLED, true), \
+ DEFINE_PROP_BIT("edid_name", _state, _conf.flags, \
+ VIRTIO_GPU_FLAG_EDID_NAME_ENABLED, false), \
DEFINE_PROP_UINT32("xres", _state, _conf.xres, 1280), \
DEFINE_PROP_UINT32("yres", _state, _conf.yres, 800)
@@ -408,6 +408,7 @@ int qemu_console_get_index(QemuConsole *con);
uint32_t qemu_console_get_head(QemuConsole *con);
int qemu_console_get_width(QemuConsole *con, int fallback);
int qemu_console_get_height(QemuConsole *con, int fallback);
+const char *qemu_console_get_name(QemuConsole *con, const char *fallback);
void qemu_console_set_name(QemuConsole *con, const char *name);
/* Return the low-level window id for the console */
int qemu_console_get_window_id(QemuConsole *con);
@@ -1452,6 +1452,14 @@ int qemu_console_get_height(QemuConsole *con, int fallback)
}
}
+const char *qemu_console_get_name(QemuConsole *con, const char *fallback)
+{
+ if (con == NULL) {
+ return fallback;
+ }
+ return con->name;
+}
+
void qemu_console_set_name(QemuConsole *con, const char *name)
{
if (con == NULL) {