All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marcelo Tosatti <mtosatti@redhat.com>
To: qemu-devel@nongnu.org, Gerd Hoffmann <kraxel@redhat.com>
Cc: kvm@vger.kernel.org, Anthony Liguori <aliguori@us.ibm.com>,
	Marcelo Tosatti <mtosatti@redhat.com>
Subject: [patch 1/6] cirrus_vga: allow configurable vram size
Date: Wed, 03 Oct 2012 07:52:56 -0300	[thread overview]
Message-ID: <20121003105509.313495807@amt.cnet> (raw)
In-Reply-To: 20121003105255.972669952@amt.cnet

[-- Attachment #1: cirrus-add-configurable-memsize --]
[-- Type: text/plain, Size: 2982 bytes --]

Allow RAM size to be configurable for cirrus, to allow migration 
compatibility from qemu-kvm.

Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>

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 = {



WARNING: multiple messages have this Message-ID (diff)
From: Marcelo Tosatti <mtosatti@redhat.com>
To: qemu-devel@nongnu.org, Gerd Hoffmann <kraxel@redhat.com>
Cc: Anthony Liguori <aliguori@us.ibm.com>,
	Marcelo Tosatti <mtosatti@redhat.com>,
	kvm@vger.kernel.org
Subject: [Qemu-devel] [patch 1/6] cirrus_vga: allow configurable vram size
Date: Wed, 03 Oct 2012 07:52:56 -0300	[thread overview]
Message-ID: <20121003105509.313495807@amt.cnet> (raw)
In-Reply-To: 20121003105255.972669952@amt.cnet

[-- Attachment #1: cirrus-add-configurable-memsize --]
[-- Type: text/plain, Size: 2980 bytes --]

Allow RAM size to be configurable for cirrus, to allow migration 
compatibility from qemu-kvm.

Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>

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 = {

  reply	other threads:[~2012-10-03 10:55 UTC|newest]

Thread overview: 54+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-03 10:52 [patch 0/6] qemu-kvm compat Marcelo Tosatti
2012-10-03 10:52 ` [Qemu-devel] " Marcelo Tosatti
2012-10-03 10:52 ` Marcelo Tosatti [this message]
2012-10-03 10:52   ` [Qemu-devel] [patch 1/6] cirrus_vga: allow configurable vram size Marcelo Tosatti
2012-10-03 14:39   ` Anthony Liguori
2012-10-03 14:39     ` [Qemu-devel] " Anthony Liguori
2012-10-03 10:52 ` [patch 2/6] Use machine options to emulate -no-kvm-irqchip Marcelo Tosatti
2012-10-03 10:52   ` [Qemu-devel] " Marcelo Tosatti
2012-10-03 14:40   ` Anthony Liguori
2012-10-03 14:40     ` [Qemu-devel] " Anthony Liguori
2012-10-03 15:03     ` Marcelo Tosatti
2012-10-03 15:03       ` [Qemu-devel] " Marcelo Tosatti
2012-10-03 15:46       ` Jan Kiszka
2012-10-03 15:46         ` [Qemu-devel] " Jan Kiszka
2012-10-03 15:49         ` Jan Kiszka
2012-10-03 15:49           ` [Qemu-devel] " Jan Kiszka
2012-10-03 17:16         ` Anthony Liguori
2012-10-03 17:24           ` Jan Kiszka
2012-10-03 17:24             ` [Qemu-devel] " Jan Kiszka
2012-10-03 18:14             ` Anthony Liguori
2012-10-03 18:26             ` Marcelo Tosatti
2012-10-04  9:28               ` Jan Kiszka
2012-10-04 14:21                 ` Anthony Liguori
2012-10-04 14:30                   ` Jan Kiszka
2012-10-04 15:36                     ` Andreas Färber
2012-10-04 16:04                       ` Jan Kiszka
2012-10-04 16:13                         ` Andreas Färber
2012-10-04 16:40                           ` Jan Kiszka
2012-10-04 17:16                       ` Marcelo Tosatti
2012-10-04 17:14                     ` Marcelo Tosatti
2012-10-04 17:46                       ` Anthony Liguori
2012-10-03 18:54   ` Aurelien Jarno
2012-10-03 18:54     ` Aurelien Jarno
2012-10-03 10:52 ` [patch 3/6] Use machine options to emulate -no-kvm-pit Marcelo Tosatti
2012-10-03 10:52   ` [Qemu-devel] " Marcelo Tosatti
2012-10-03 14:40   ` Anthony Liguori
2012-10-03 14:40     ` [Qemu-devel] " Anthony Liguori
2012-10-03 10:52 ` [patch 4/6] Use global properties to emulate -no-kvm-pit-reinjection Marcelo Tosatti
2012-10-03 10:52   ` [Qemu-devel] " Marcelo Tosatti
2012-10-03 14:41   ` Anthony Liguori
2012-10-03 14:41     ` [Qemu-devel] " Anthony Liguori
2012-10-03 10:53 ` [patch 5/6] Emulate qemu-kvms drive parameter boot=on|off Marcelo Tosatti
2012-10-03 10:53   ` [Qemu-devel] " Marcelo Tosatti
2012-10-03 14:43   ` Anthony Liguori
2012-10-03 14:43     ` [Qemu-devel] " Anthony Liguori
2012-10-03 10:53 ` [patch 6/6] Emulate qemu-kvms -tdf option Marcelo Tosatti
2012-10-03 10:53   ` [Qemu-devel] " Marcelo Tosatti
2012-10-03 14:44   ` Anthony Liguori
2012-10-03 14:44     ` [Qemu-devel] " Anthony Liguori
2012-10-03 14:45 ` [patch 0/6] qemu-kvm compat Anthony Liguori
2012-10-03 14:45   ` [Qemu-devel] " Anthony Liguori
2012-10-03 15:05   ` Marcelo Tosatti
2012-10-03 15:05     ` [Qemu-devel] " Marcelo Tosatti
2012-10-03 15:34     ` Anthony Liguori

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20121003105509.313495807@amt.cnet \
    --to=mtosatti@redhat.com \
    --cc=aliguori@us.ibm.com \
    --cc=kraxel@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.