From patchwork Thu May 9 10:02:56 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 242747 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 236252C00E2 for ; Thu, 9 May 2013 20:03:26 +1000 (EST) Received: from localhost ([::1]:54394 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UaNh6-00076r-4S for incoming@patchwork.ozlabs.org; Thu, 09 May 2013 06:03:24 -0400 Received: from eggs.gnu.org ([208.118.235.92]:54442) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UaNgk-00076d-46 for qemu-devel@nongnu.org; Thu, 09 May 2013 06:03:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UaNgh-0007nY-Ue for qemu-devel@nongnu.org; Thu, 09 May 2013 06:03:02 -0400 Received: from mx1.redhat.com ([209.132.183.28]:1607) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UaNgh-0007n8-NB for qemu-devel@nongnu.org; Thu, 09 May 2013 06:02:59 -0400 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r49A2wu3010400 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 9 May 2013 06:02:58 -0400 Received: from rincewind.home.kraxel.org (ovpn-116-50.ams2.redhat.com [10.36.116.50]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r49A2voE011467; Thu, 9 May 2013 06:02:57 -0400 Received: by rincewind.home.kraxel.org (Postfix, from userid 500) id 29E73414BD; Thu, 9 May 2013 12:02:56 +0200 (CEST) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Thu, 9 May 2013 12:02:56 +0200 Message-Id: <1368093776-8949-2-git-send-email-kraxel@redhat.com> In-Reply-To: <1368093776-8949-1-git-send-email-kraxel@redhat.com> References: <1368093776-8949-1-git-send-email-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: Hans de Goede , Gerd Hoffmann 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 From: Hans de Goede 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 Signed-off-by: Gerd Hoffmann --- hw/display/qxl.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hw/display/qxl.c b/hw/display/qxl.c index 2d49e9a..c475cb1 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);