qxl: allow to specify head limit to qxl driver
PATCH v3 1/1 qxl: allow to specify head limit to qxl driver
This patch allow to limit number of heads using qxl driver. By default qxl driver is not limited on any kind on head use so can decide to use as much heads.
libvirt has this as a video card parameter (actually set to 1 but not used). This parameter will allow to limit setting a use can do (which could be confusing).
This patch rely on some change in spice-protocol which are not still accepted. See
http://lists.freedesktop.org/archives/spice-devel/2015-June/020221.html.
--- hw/display/qxl.c | 26 +++++++++++++++++++++----- hw/display/qxl.h | 3 +++ 2 files changed, 24 insertions(+), 5 deletions(-)
Changes from v2:
- removed the RPC after spice-server upstream
- rebased
hw/display/qxl.c +21 -5
@@ -271,6 +271,12 @@ static void qxl_spice_monitors_config_async(PCIQXLDevice *qxl, int replay)QXL_COOKIE_TYPE_POST_LOAD_MONITORS_CONFIG , 0)); }else { +#if SPICE_SERVER_VERSION >=0x000c06 /* release 0.12.6 */ +if (qxl->max_outputs) { +spice_qxl_set_monitors_config_limit (&qxl->ssd.qxl, + qxl->max_outputs); + } +#endif qxl->guest_monitors_config = qxl->ram->monitors_config; spice_qxl_monitors_config_async(&qxl->ssd.qxl, qxl->ram->monitors_config,
@@ -991,6 +997,7 @@ static int interface_client_monitors_config(QXLInstance *sin,PCIQXLDevice *qxl =container_of (sin, PCIQXLDevice, ssd.qxl);QXLRom *rom =memory_region_get_ram_ptr (&qxl->rom_bar);int i; +unsigned max_outputs =ARRAY_SIZE (rom->client_monitors_config.heads);if (qxl->revision <4 ) { trace_qxl_client_monitors_config_unsupported_by_device(qxl->id,
@@ -1013,17 +1020,23 @@ static int interface_client_monitors_config(QXLInstance *sin,if (!monitors_config) {return 1 ; } + +#if SPICE_SERVER_VERSION >=0x000c06 /* release 0.12.6 */ +/* limit number of outputs based on setting limit */ +if (qxl->max_outputs && qxl->max_outputs <= max_outputs) { + max_outputs = qxl->max_outputs; + } +#endif +memset (&rom->client_monitors_config,0 ,sizeof (rom->client_monitors_config)); rom->client_monitors_config.count = monitors_config->num_of_monitors;/* monitors_config->flags ignored */ -if (rom->client_monitors_config.count >= -ARRAY_SIZE (rom->client_monitors_config.heads)) { +if (rom->client_monitors_config.count >= max_outputs) {trace_qxl_client_monitors_config_capped (qxl->id, monitors_config->num_of_monitors, -ARRAY_SIZE (rom->client_monitors_config.heads)); - rom->client_monitors_config.count = -ARRAY_SIZE (rom->client_monitors_config.heads); + max_outputs); + rom->client_monitors_config.count = max_outputs; }for (i =0 ; i < rom->client_monitors_config.count ; ++i) {VDAgentMonConfig *monitor = &monitors_config->monitors[i];
@@ -2274,6 +2287,9 @@ static Property qxl_properties[] = {DEFINE_PROP_UINT32 ("vram64_size_mb" , PCIQXLDevice, vram_size_mb,-1 ),DEFINE_PROP_UINT32 ("vgamem_mb" , PCIQXLDevice, vgamem_size_mb,16 ),DEFINE_PROP_INT32 ("surfaces" , PCIQXLDevice, ssd.num_surfaces,1024 ), +#if SPICE_SERVER_VERSION >= 0x000c06 /* release 0.12.6 */ +DEFINE_PROP_UINT16 ("max_outputs" , PCIQXLDevice, max_outputs,0 ), +#endif DEFINE_PROP_END_OF_LIST(), };
hw/display/qxl.h +3 -0
@@ -99,6 +99,9 @@ typedef struct PCIQXLDevice {QXLModes *modes;uint32_t rom_size;MemoryRegion rom_bar; +#if SPICE_SERVER_VERSION >=0x000c06 /* release 0.12.6 */ +uint16_t max_outputs; +#endif /* vram pci bar */ uint32_t vram_size;
Signature · 1 line
2.1.0
Ping
----- Original Message -----
Quoted 116 lines
From: "Frediano Ziglio" <[email protected]>
To: [email protected], [email protected], [email protected]
Cc: [email protected], "Frediano Ziglio" <[email protected]>
Sent: Monday, July 6, 2015 7:56:38 AM
Subject: [Qemu-devel] [PATCH v3] qxl: allow to specify head limit to qxl driverThis patch allow to limit number of heads using qxl driver. By default qxl driver is not limited on any kind on head use so can decide to use as much heads.
libvirt has this as a video card parameter (actually set to 1 but not used). This parameter will allow to limit setting a use can do (which could be confusing).
This patch rely on some change in spice-protocol which are not still accepted. See
http://lists.freedesktop.org/archives/spice-devel/2015-June/020221.html.Signed-off-by Frediano Ziglio <[email protected]>--- hw/display/qxl.c | 26 +++++++++++++++++++++----- hw/display/qxl.h | 3 +++ 2 files changed, 24 insertions(+), 5 deletions(-)Changes from v2:
- removed the RPC after spice-server upstream
- rebasedhw/display/qxl.c +6
-0@@ -271,6 +271,12 @@ static void qxl_spice_monitors_config_async(PCIQXLDevice *qxl, int replay)QXL_COOKIE_TYPE_POST_LOAD_MONITORS_CONFIG , 0)); }else { +#if SPICE_SERVER_VERSION >=0x000c06 /* release 0.12.6 */ +if (qxl->max_outputs) { +spice_qxl_set_monitors_config_limit (&qxl->ssd.qxl, + qxl->max_outputs); + } +#endif qxl->guest_monitors_config = qxl->ram->monitors_config; spice_qxl_monitors_config_async(&qxl->ssd.qxl,qxl->ram->monitors_config,hw/display/qxl.c +1
-0@@ -991,6 +997,7 @@ static int interface_client_monitors_config(QXLInstance *sin, PCIQXLDevice *qxl =container_of (sin, PCIQXLDevice, ssd.qxl);QXLRom *rom =memory_region_get_ram_ptr (&qxl->rom_bar);int i; +unsigned max_outputs =ARRAY_SIZE (rom->client_monitors_config.heads);if (qxl->revision <4 ) {trace_qxl_client_monitors_config_unsupported_by_device(qxl->id,hw/display/qxl.c +11
-5@@ -1013,17 +1020,23 @@ static int interface_client_monitors_config(QXLInstance *sin, if (!monitors_config) { return 1; } + +#if SPICE_SERVER_VERSION >=0x000c06 /* release 0.12.6 */ +/* limit number of outputs based on setting limit */ +if (qxl->max_outputs && qxl->max_outputs <= max_outputs) { + max_outputs = qxl->max_outputs; + } +#endif +memset (&rom->client_monitors_config,0 ,sizeof (rom->client_monitors_config)); rom->client_monitors_config.count = monitors_config->num_of_monitors;/* monitors_config->flags ignored */ -if (rom->client_monitors_config.count >= -ARRAY_SIZE (rom->client_monitors_config.heads)) { +if (rom->client_monitors_config.count >= max_outputs) {trace_qxl_client_monitors_config_capped (qxl->id, monitors_config->num_of_monitors, -ARRAY_SIZE (rom->client_monitors_config.heads)); - rom->client_monitors_config.count = -ARRAY_SIZE (rom->client_monitors_config.heads); + max_outputs); + rom->client_monitors_config.count = max_outputs; }for (i = 0 ; i < rom->client_monitors_config.count ; ++i) { VDAgentMonConfig *monitor = &monitors_config->monitors[i];hw/display/qxl.c +3
-0@@ -2274,6 +2287,9 @@ static Property qxl_properties[] = {DEFINE_PROP_UINT32 ("vram64_size_mb" , PCIQXLDevice, vram_size_mb,-1 ),DEFINE_PROP_UINT32 ("vgamem_mb" , PCIQXLDevice, vgamem_size_mb,16 ),DEFINE_PROP_INT32 ("surfaces" , PCIQXLDevice, ssd.num_surfaces,1024 ), +#if SPICE_SERVER_VERSION >= 0x000c06 /* release 0.12.6 */ +DEFINE_PROP_UINT16 ("max_outputs" , PCIQXLDevice, max_outputs,0 ), +#endif DEFINE_PROP_END_OF_LIST(), };hw/display/qxl.h +3
-1@@ -99,6 +99,9 @@ typedef struct PCIQXLDevice {QXLModes *modes;uint32_t rom_size;MemoryRegion rom_bar; +#if SPICE_SERVER_VERSION >=0x000c06 /* release 0.12.6 */ +uint16_t max_outputs; +#endif /* vram pci bar */ uint32_t vram_size; --2.1.0
Hi,
Quoted 3 lines
Quoted 3 lines
This patch rely on some change in spice-protocol which are not still accepted. See
http://lists.freedesktop.org/archives/spice-devel/2015-June/020221.html.
What is the upstream status here? accepted meanwhile?
cheers,
Gerd
Quoted 12 lines
Hi,
Quoted 3 lines
Quoted 3 lines
This patch rely on some change in spice-protocol which are not still accepted. See
http://lists.freedesktop.org/archives/spice-devel/2015-June/020221.html.What is the upstream status here? accepted meanwhile?
cheers,
Gerd
Accepted and merged, see patch at
http://cgit.freedesktop.org/spice/spice/commit/?id=6d4e58f70ddf9c178e2cc20dd5a3ade8b95fd142
Frediano
Hi,
Quoted 13 lines · Frediano Ziglio
Quoted 12 lines
Hi,
Quoted 3 lines
Quoted 3 lines
This patch rely on some change in spice-protocol which are not still accepted. See
http://lists.freedesktop.org/archives/spice-devel/2015-June/020221.html.What is the upstream status here? accepted meanwhile?
cheers,
Gerd
Quoted 5 lines
Accepted and merged, see patch at
http://cgit.freedesktop.org/spice/spice/commit/?id=6d4e58f70ddf9c178e2cc20dd5a3ade8b95fd142Frediano
That commit introduced 'spice_qxl_set_max_monitors' not 'spice_qxl_set_monitors_config_limit'
Pavel