qxl: allow to specify head limit to qxl driver
-----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) iQIcBAABAgAGBQJVp85cAAoJEEy22O7T6HE4c3UP/0D60uiY5IypOcyVMvXPsOsB 0ry2Bq/f6IE0EmD1xLvyedRNjaVeOE7GHRycZBkkzk1LEmeYCov3qXAsYCC0U6d8 CYYSMpm0kyHpnaTzHVuK/w+FX8M1QiYJKLgs67foBNn/JzIto/X4/VJAnT4MaaaQ 5Qaml8LfD4WFNrsZ1XwMtpYwZnd75OS1BZ/D98o0TGBHUDyPvJRP8bAQgdvKMP5S yHnD1O2eyPVDhIpENh74Id7j2PYd/Q8xmnfFYqIWLZBqks+EbAp7813UXQ54H7XL 81JHXSS/KGMLmQOEUreWuyxivY8hbzXWR1HWzBk3xqcDa6vsoTFBJUgUTEq4nwXw jKtqw5cInNgQrPVq0ctuuENxv8YGgb3wHpZiTzNyLeNySljk4toQQROV1gG7KNOA xrEE3UYvEL4+Cu8+fL7Vz9ZXefxhdqQHBo7yNgNidw2knQpmehxjX8GeRlUc2Vbv K3yyx8HVblFfbYOik3qwo3DKKJgJUI/yq0gnhBxl79ExZtQmt+RwrjYp06+PpQtm 7XsJH6yBEQTOaZNIUIFf8b4NzuRoO3t5dGY1GB1Gir7s9cdDVj20AyYFLUYsHUUy r5L60Fd1deYi6bkZaVLg48w080hdxWL4zioQiTQIRgRPh9KGmrgZZRZsBuE+FkYu VqHaHU8EPC6D9B3rbjYy =QNro -----END PGP SIGNATURE----- Merge remote-tracking branch 'remotes/spice/tags/pull-spice-20150716-1' into staging qxl: allow to specify head limit to qxl driver # gpg: Signature made Thu Jul 16 16:31:40 2015 BST using RSA key ID D3E87138 # gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>" # gpg: aka "Gerd Hoffmann <gerd@kraxel.org>" # gpg: aka "Gerd Hoffmann (private) <kraxel@gmail.com>" * remotes/spice/tags/pull-spice-20150716-1: qxl: allow to specify head limit to qxl driver Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
commit
67ff64e082
@ -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(),
|
||||
};
|
||||
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user