From patchwork Wed May 5 20:35:09 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Shah X-Patchwork-Id: 51741 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from bilbo.ozlabs.org (localhost [127.0.0.1]) by ozlabs.org (Postfix) with ESMTP id 03C7CB82BB for ; Thu, 6 May 2010 06:38:28 +1000 (EST) Received: by ozlabs.org (Postfix) id 43371B7DEE; Thu, 6 May 2010 06:38:08 +1000 (EST) Delivered-To: linuxppc-dev@ozlabs.org Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by ozlabs.org (Postfix) with ESMTP id CC44EB7DBD for ; Thu, 6 May 2010 06:38:07 +1000 (EST) Received: from int-mx03.intmail.prod.int.phx2.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o45Kb5BQ026406 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 5 May 2010 16:37:06 -0400 Received: from localhost (vpn-240-233.phx2.redhat.com [10.3.240.233]) by int-mx03.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o45Kb4MB019249; Wed, 5 May 2010 16:37:04 -0400 From: Amit Shah To: Rusty Russell Subject: [PATCH 3/3] virtio: console: Accept console size along with resize control message Date: Thu, 6 May 2010 02:05:09 +0530 Message-Id: <1273091709-19963-4-git-send-email-amit.shah@redhat.com> In-Reply-To: <1273091709-19963-3-git-send-email-amit.shah@redhat.com> References: <1273091709-19963-1-git-send-email-amit.shah@redhat.com> <1273091709-19963-2-git-send-email-amit.shah@redhat.com> <1273091709-19963-3-git-send-email-amit.shah@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.16 Cc: Amit Shah , Christian Borntraeger , Kusanagi Kouichi , linuxppc-dev@ozlabs.org, Virtualization List X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org The VIRTIO_CONSOLE_RESIZE control message sent to us by the host now contains the new {rows, cols} values for the console. This ensures each console port gets its own size, and we don't depend on the config-space rows and cols values at all now. Signed-off-by: Amit Shah CC: Christian Borntraeger CC: linuxppc-dev@ozlabs.org CC: Kusanagi Kouichi --- drivers/char/virtio_console.c | 13 ++++++++++++- 1 files changed, 12 insertions(+), 1 deletions(-) diff --git a/drivers/char/virtio_console.c b/drivers/char/virtio_console.c index ccfe68a..5cab839 100644 --- a/drivers/char/virtio_console.c +++ b/drivers/char/virtio_console.c @@ -1194,12 +1194,23 @@ static void handle_control_message(struct ports_device *portdev, * have to notify the host first. */ break; - case VIRTIO_CONSOLE_RESIZE: + case VIRTIO_CONSOLE_RESIZE: { + struct { + __u16 rows; + __u16 cols; + } size; + if (!is_console_port(port)) break; + + memcpy(&size, buf->buf + buf->offset + sizeof(*cpkt), + sizeof(size)); + set_console_size(port, size.rows, size.cols); + port->cons.hvc->irq_requested = 1; resize_console(port); break; + } case VIRTIO_CONSOLE_PORT_OPEN: port->host_connected = cpkt->value; wake_up_interruptible(&port->waitqueue);