From mboxrd@z Thu Jan 1 00:00:00 1970 From: Anthony Liguori Subject: Re: [patch 1/6] cirrus_vga: allow configurable vram size Date: Wed, 03 Oct 2012 09:39:31 -0500 Message-ID: <87iparhb6k.fsf@codemonkey.ws> References: <20121003105255.972669952@amt.cnet> <20121003105509.313495807@amt.cnet> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: kvm@vger.kernel.org, Marcelo Tosatti To: Marcelo Tosatti , qemu-devel@nongnu.org, Gerd Hoffmann Return-path: Received: from e9.ny.us.ibm.com ([32.97.182.139]:35667 "EHLO e9.ny.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754225Ab2JCOjq (ORCPT ); Wed, 3 Oct 2012 10:39:46 -0400 Received: from /spool/local by e9.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 3 Oct 2012 10:39:45 -0400 Received: from d01av04.pok.ibm.com (d01av04.pok.ibm.com [9.56.224.64]) by d01relay05.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q93Edgvs097898 for ; Wed, 3 Oct 2012 10:39:42 -0400 Received: from d01av04.pok.ibm.com (loopback [127.0.0.1]) by d01av04.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q93EdfJX009525 for ; Wed, 3 Oct 2012 10:39:42 -0400 In-Reply-To: <20121003105509.313495807@amt.cnet> Sender: kvm-owner@vger.kernel.org List-ID: Marcelo Tosatti writes: > Allow RAM size to be configurable for cirrus, to allow migration > compatibility from qemu-kvm. > > Signed-off-by: Marcelo Tosatti Reviewed-by: Anthony Liguori Regards, Anthony Liguori > > Index: qemu-compat-kvm/hw/cirrus_vga.c > =================================================================== > --- qemu-compat-kvm.orig/hw/cirrus_vga.c > +++ qemu-compat-kvm/hw/cirrus_vga.c > @@ -43,8 +43,6 @@ > //#define DEBUG_CIRRUS > //#define DEBUG_BITBLT > > -#define VGA_RAM_SIZE (8192 * 1024) > - > /*************************************** > * > * definitions > @@ -2853,7 +2851,8 @@ static void cirrus_init_common(CirrusVGA > > /* I/O handler for LFB */ > memory_region_init_io(&s->cirrus_linear_io, &cirrus_linear_io_ops, s, > - "cirrus-linear-io", VGA_RAM_SIZE); > + "cirrus-linear-io", s->vga.vram_size_mb > + * 1024 * 1024); > > /* I/O handler for LFB */ > memory_region_init_io(&s->cirrus_linear_bitblt_io, > @@ -2893,7 +2892,6 @@ static int vga_initfn(ISADevice *dev) > ISACirrusVGAState *d = DO_UPCAST(ISACirrusVGAState, dev, dev); > VGACommonState *s = &d->cirrus_vga.vga; > > - s->vram_size_mb = VGA_RAM_SIZE >> 20; > vga_common_init(s); > cirrus_init_common(&d->cirrus_vga, CIRRUS_ID_CLGD5430, 0, > isa_address_space(dev)); > @@ -2906,6 +2904,12 @@ static int vga_initfn(ISADevice *dev) > return 0; > } > > +static Property isa_vga_cirrus_properties[] = { > + DEFINE_PROP_UINT32("vgamem_mb", struct ISACirrusVGAState, > + cirrus_vga.vga.vram_size_mb, 8), > + DEFINE_PROP_END_OF_LIST(), > +}; > + > static void isa_cirrus_vga_class_init(ObjectClass *klass, void *data) > { > ISADeviceClass *k = ISA_DEVICE_CLASS(klass); > @@ -2913,6 +2917,7 @@ static void isa_cirrus_vga_class_init(Ob > > dc->vmsd = &vmstate_cirrus_vga; > k->init = vga_initfn; > + dc->props = isa_vga_cirrus_properties; > } > > static TypeInfo isa_cirrus_vga_info = { > @@ -2936,7 +2941,6 @@ static int pci_cirrus_vga_initfn(PCIDevi > int16_t device_id = pc->device_id; > > /* setup VGA */ > - s->vga.vram_size_mb = VGA_RAM_SIZE >> 20; > vga_common_init(&s->vga); > cirrus_init_common(s, device_id, 1, pci_address_space(dev)); > s->vga.ds = graphic_console_init(s->vga.update, s->vga.invalidate, > @@ -2968,6 +2972,12 @@ DeviceState *pci_cirrus_vga_init(PCIBus > return &pci_create_simple(bus, -1, "cirrus-vga")->qdev; > } > > +static Property pci_vga_cirrus_properties[] = { > + DEFINE_PROP_UINT32("vgamem_mb", struct PCICirrusVGAState, > + cirrus_vga.vga.vram_size_mb, 8), > + DEFINE_PROP_END_OF_LIST(), > +}; > + > static void cirrus_vga_class_init(ObjectClass *klass, void *data) > { > DeviceClass *dc = DEVICE_CLASS(klass); > @@ -2981,6 +2991,7 @@ static void cirrus_vga_class_init(Object > k->class_id = PCI_CLASS_DISPLAY_VGA; > dc->desc = "Cirrus CLGD 54xx VGA"; > dc->vmsd = &vmstate_pci_cirrus_vga; > + dc->props = pci_vga_cirrus_properties; > } > > static TypeInfo cirrus_vga_info = { > > > -- > To unsubscribe from this list: send the line "unsubscribe kvm" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:53664) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TJQF1-0007PA-Qr for qemu-devel@nongnu.org; Wed, 03 Oct 2012 10:48:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TJQEv-00048T-V9 for qemu-devel@nongnu.org; Wed, 03 Oct 2012 10:48:03 -0400 Received: from e5.ny.us.ibm.com ([32.97.182.145]:44502) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TJQEv-00048O-Kc for qemu-devel@nongnu.org; Wed, 03 Oct 2012 10:47:57 -0400 Received: from /spool/local by e5.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 3 Oct 2012 10:47:56 -0400 Received: from d01av04.pok.ibm.com (d01av04.pok.ibm.com [9.56.224.64]) by d01relay03.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q93EdgwL122418 for ; Wed, 3 Oct 2012 10:39:42 -0400 Received: from d01av04.pok.ibm.com (loopback [127.0.0.1]) by d01av04.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q93EdfJT009525 for ; Wed, 3 Oct 2012 10:39:41 -0400 From: Anthony Liguori In-Reply-To: <20121003105509.313495807@amt.cnet> References: <20121003105255.972669952@amt.cnet> <20121003105509.313495807@amt.cnet> Date: Wed, 03 Oct 2012 09:39:31 -0500 Message-ID: <87iparhb6k.fsf@codemonkey.ws> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Subject: Re: [Qemu-devel] [patch 1/6] cirrus_vga: allow configurable vram size List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Marcelo Tosatti , qemu-devel@nongnu.org, Gerd Hoffmann Cc: kvm@vger.kernel.org Marcelo Tosatti writes: > Allow RAM size to be configurable for cirrus, to allow migration > compatibility from qemu-kvm. > > Signed-off-by: Marcelo Tosatti Reviewed-by: Anthony Liguori Regards, Anthony Liguori > > Index: qemu-compat-kvm/hw/cirrus_vga.c > =================================================================== > --- qemu-compat-kvm.orig/hw/cirrus_vga.c > +++ qemu-compat-kvm/hw/cirrus_vga.c > @@ -43,8 +43,6 @@ > //#define DEBUG_CIRRUS > //#define DEBUG_BITBLT > > -#define VGA_RAM_SIZE (8192 * 1024) > - > /*************************************** > * > * definitions > @@ -2853,7 +2851,8 @@ static void cirrus_init_common(CirrusVGA > > /* I/O handler for LFB */ > memory_region_init_io(&s->cirrus_linear_io, &cirrus_linear_io_ops, s, > - "cirrus-linear-io", VGA_RAM_SIZE); > + "cirrus-linear-io", s->vga.vram_size_mb > + * 1024 * 1024); > > /* I/O handler for LFB */ > memory_region_init_io(&s->cirrus_linear_bitblt_io, > @@ -2893,7 +2892,6 @@ static int vga_initfn(ISADevice *dev) > ISACirrusVGAState *d = DO_UPCAST(ISACirrusVGAState, dev, dev); > VGACommonState *s = &d->cirrus_vga.vga; > > - s->vram_size_mb = VGA_RAM_SIZE >> 20; > vga_common_init(s); > cirrus_init_common(&d->cirrus_vga, CIRRUS_ID_CLGD5430, 0, > isa_address_space(dev)); > @@ -2906,6 +2904,12 @@ static int vga_initfn(ISADevice *dev) > return 0; > } > > +static Property isa_vga_cirrus_properties[] = { > + DEFINE_PROP_UINT32("vgamem_mb", struct ISACirrusVGAState, > + cirrus_vga.vga.vram_size_mb, 8), > + DEFINE_PROP_END_OF_LIST(), > +}; > + > static void isa_cirrus_vga_class_init(ObjectClass *klass, void *data) > { > ISADeviceClass *k = ISA_DEVICE_CLASS(klass); > @@ -2913,6 +2917,7 @@ static void isa_cirrus_vga_class_init(Ob > > dc->vmsd = &vmstate_cirrus_vga; > k->init = vga_initfn; > + dc->props = isa_vga_cirrus_properties; > } > > static TypeInfo isa_cirrus_vga_info = { > @@ -2936,7 +2941,6 @@ static int pci_cirrus_vga_initfn(PCIDevi > int16_t device_id = pc->device_id; > > /* setup VGA */ > - s->vga.vram_size_mb = VGA_RAM_SIZE >> 20; > vga_common_init(&s->vga); > cirrus_init_common(s, device_id, 1, pci_address_space(dev)); > s->vga.ds = graphic_console_init(s->vga.update, s->vga.invalidate, > @@ -2968,6 +2972,12 @@ DeviceState *pci_cirrus_vga_init(PCIBus > return &pci_create_simple(bus, -1, "cirrus-vga")->qdev; > } > > +static Property pci_vga_cirrus_properties[] = { > + DEFINE_PROP_UINT32("vgamem_mb", struct PCICirrusVGAState, > + cirrus_vga.vga.vram_size_mb, 8), > + DEFINE_PROP_END_OF_LIST(), > +}; > + > static void cirrus_vga_class_init(ObjectClass *klass, void *data) > { > DeviceClass *dc = DEVICE_CLASS(klass); > @@ -2981,6 +2991,7 @@ static void cirrus_vga_class_init(Object > k->class_id = PCI_CLASS_DISPLAY_VGA; > dc->desc = "Cirrus CLGD 54xx VGA"; > dc->vmsd = &vmstate_pci_cirrus_vga; > + dc->props = pci_vga_cirrus_properties; > } > > static TypeInfo cirrus_vga_info = { > > > -- > To unsubscribe from this list: send the line "unsubscribe kvm" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html