[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 7/9] qxl: use graphic_* variables.
From: |
Gerd Hoffmann |
Subject: |
[Qemu-devel] [PATCH 7/9] qxl: use graphic_* variables. |
Date: |
Tue, 21 Feb 2017 23:14:57 +0100 |
If graphic_* variables are set (via -g switch), pass on
that information to the guest so the driver can use it.
Also move up qxl_crc32() function so we don't need a
forward declaration.
Additionally guest driver updates are needed so the
guest driver will actually pick this up, which will
probably land in linux kernel 4.12.
Signed-off-by: Gerd Hoffmann <address@hidden>
---
hw/display/qxl.c | 32 ++++++++++++++++++++++----------
1 file changed, 22 insertions(+), 10 deletions(-)
diff --git a/hw/display/qxl.c b/hw/display/qxl.c
index af4c0ca..37c84a8 100644
--- a/hw/display/qxl.c
+++ b/hw/display/qxl.c
@@ -304,6 +304,16 @@ void qxl_spice_reset_cursor(PCIQXLDevice *qxl)
qxl->ssd.cursor = cursor_builtin_hidden();
}
+static uint32_t qxl_crc32(const uint8_t *p, unsigned len)
+{
+ /*
+ * zlib xors the seed with 0xffffffff, and xors the result
+ * again with 0xffffffff; Both are not done with linux's crc32,
+ * which we want to be compatible with, so undo that.
+ */
+ return crc32(0xffffffff, p, len) ^ 0xffffffff;
+}
+
static ram_addr_t qxl_rom_size(void)
{
#define QXL_REQUIRED_SZ (sizeof(QXLRom) + sizeof(QXLModes) + sizeof(qxl_modes))
@@ -368,6 +378,18 @@ static void init_qxl_rom(PCIQXLDevice *d)
rom->num_pages = cpu_to_le32(num_pages);
rom->ram_header_offset = cpu_to_le32(d->vga.vram_size - ram_header_size);
+ if (graphic_width && graphic_height) {
+ /* needs linux kernel 4.12+ to work */
+ rom->client_monitors_config.count = 1;
+ rom->client_monitors_config.heads[0].left = 0;
+ rom->client_monitors_config.heads[0].top = 0;
+ rom->client_monitors_config.heads[0].right =
cpu_to_le32(graphic_width);
+ rom->client_monitors_config.heads[0].bottom =
cpu_to_le32(graphic_height);
+ rom->client_monitors_config_crc = qxl_crc32(
+ (const uint8_t *)&rom->client_monitors_config,
+ sizeof(rom->client_monitors_config));
+ }
+
d->shadow_rom = *rom;
d->rom = rom;
d->modes = modes;
@@ -981,16 +1003,6 @@ static void interface_set_client_capabilities(QXLInstance
*sin,
qxl_send_events(qxl, QXL_INTERRUPT_CLIENT);
}
-static uint32_t qxl_crc32(const uint8_t *p, unsigned len)
-{
- /*
- * zlib xors the seed with 0xffffffff, and xors the result
- * again with 0xffffffff; Both are not done with linux's crc32,
- * which we want to be compatible with, so undo that.
- */
- return crc32(0xffffffff, p, len) ^ 0xffffffff;
-}
-
static bool qxl_rom_monitors_config_changed(QXLRom *rom,
VDAgentMonitorsConfig *monitors_config,
unsigned int max_outputs)
--
1.8.3.1
- [Qemu-devel] [PATCH 6/9] virtio-gpu: use graphic_* variables., (continued)
- [Qemu-devel] [PATCH 6/9] virtio-gpu: use graphic_* variables., Gerd Hoffmann, 2017/02/21
- [Qemu-devel] [PATCH 5/9] enable -g command line switch for all archs, Gerd Hoffmann, 2017/02/21
- [Qemu-devel] [PATCH 8/9] update -g command line switch documentation, Gerd Hoffmann, 2017/02/21
- [Qemu-devel] [PATCH 3/9] ppc: use ppc_graphic_* defines, Gerd Hoffmann, 2017/02/21
- [Qemu-devel] [PATCH 7/9] qxl: use graphic_* variables.,
Gerd Hoffmann <=
- [Qemu-devel] [PATCH 2/9] sparc: use sparc_graphic_* defines, Gerd Hoffmann, 2017/02/21
- [Qemu-devel] [PATCH 4/9] drop arch-specific graphic_* initialization., Gerd Hoffmann, 2017/02/21
- [Qemu-devel] [PATCH 1/9] sysemu: add defines for sparc & ppc graphics_*, Gerd Hoffmann, 2017/02/21
- [Qemu-devel] [PATCH 9/9] [RfC] stdvga: use graphic_* variables., Gerd Hoffmann, 2017/02/21
- Re: [Qemu-devel] [PATCH 0/9] wire up -g <width>x<height> switch for virtio and qxl., Mark Cave-Ayland, 2017/02/24