From patchwork Tue Apr 23 08:18:16 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans de Goede X-Patchwork-Id: 238778 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 91D9B2C0103 for ; Tue, 23 Apr 2013 18:14:58 +1000 (EST) Received: from localhost ([::1]:41781 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UUYNM-0005Zg-FA for incoming@patchwork.ozlabs.org; Tue, 23 Apr 2013 04:14:56 -0400 Received: from eggs.gnu.org ([208.118.235.92]:51763) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UUYN4-0005WY-Ay for qemu-devel@nongnu.org; Tue, 23 Apr 2013 04:14:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UUYMz-0003tY-JZ for qemu-devel@nongnu.org; Tue, 23 Apr 2013 04:14:38 -0400 Received: from mx1.redhat.com ([209.132.183.28]:47016) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UUYMz-0003r5-Cl for qemu-devel@nongnu.org; Tue, 23 Apr 2013 04:14:33 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r3N8EV77032163 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 23 Apr 2013 04:14:31 -0400 Received: from shalem.localdomain.com (vpn1-5-175.ams2.redhat.com [10.36.5.175]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r3N8ETVw009739; Tue, 23 Apr 2013 04:14:30 -0400 From: Hans de Goede To: Gerd Hoffmann Date: Tue, 23 Apr 2013 10:18:16 +0200 Message-Id: <1366705096-8018-1-git-send-email-hdegoede@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: spice-devel@lists.freedesktop.org, qemu-devel@nongnu.org, Hans de Goede Subject: [Qemu-devel] [PATCH] qxl: Call spice_qxl_driver_unload from qxl_enter_vga_mode X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org With a SPICE_DISPLAY_CAP_MONITORS_CONFIG capable client, the client needs to know what part of the primary to use for each monitor. If the guest driver does not support this, the server sends messages to the client for a single monitor spanning the entire primary. As soon as the guest calls spice_qxl_monitors_config_async once, the server sets the red_worker driver_has_monitors_config flag and stops doing this. This is a problem when the driver gets unloaded, for example after a reboot or when switching to a text vc with usermode mode-setting under Linux. To reproduce this start a multi-mon capable Linux guest which uses usermode mode-setting and then once X has started switch to a text vc. Note how the client window does not only not resize, if you try to resize it manually you always keep blackborders since the aspect is wrong. This patch calls a new spice-server method called spice_qxl_driver_unload which clears the driver_has_monitors_config flag inside the server, thereby fixing this. Signed-off-by: Hans de Goede --- hw/display/qxl.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hw/display/qxl.c b/hw/display/qxl.c index e679830..564eff2 100644 --- a/hw/display/qxl.c +++ b/hw/display/qxl.c @@ -1077,6 +1077,9 @@ static void qxl_enter_vga_mode(PCIQXLDevice *d) return; } trace_qxl_enter_vga_mode(d->id); +#if SPICE_SERVER_VERSION >= 0x000c03 /* release 0.12.3 */ + spice_qxl_driver_unload(&d->ssd.qxl); +#endif qemu_spice_create_host_primary(&d->ssd); d->mode = QXL_MODE_VGA; vga_dirty_log_start(&d->vga);