aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2012-02-17 15:03:24 +0100
committerGerd Hoffmann <kraxel@redhat.com>2012-02-21 10:36:05 +0100
commit017438eeb17d62d74e181e32f996e5805302693e (patch)
treefea96f83eb5cc9ffe1aa02d8dc8a0adb35900764
parenta974192c8011102c2db670341e6bb8de22e242ad (diff)
qxl: add user-friendly bar size properties
Add two properties to specify bar sizes in megabytes instead of bytes, which is alot more user-friendly. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
-rw-r--r--hw/qxl.c8
-rw-r--r--hw/qxl.h4
2 files changed, 12 insertions, 0 deletions
diff --git a/hw/qxl.c b/hw/qxl.c
index 38bb90eab7..87ad49ad8b 100644
--- a/hw/qxl.c
+++ b/hw/qxl.c
@@ -1557,11 +1557,17 @@ static DisplayChangeListener display_listener = {
static void qxl_init_ramsize(PCIQXLDevice *qxl, uint32_t ram_min_mb)
{
/* vga ram (bar 0) */
+ if (qxl->ram_size_mb != -1) {
+ qxl->vga.vram_size = qxl->ram_size_mb * 1024 * 1024;
+ }
if (qxl->vga.vram_size < ram_min_mb * 1024 * 1024) {
qxl->vga.vram_size = ram_min_mb * 1024 * 1024;
}
/* vram (surfaces, bar 1) */
+ if (qxl->vram_size_mb != -1) {
+ qxl->vram_size = qxl->vram_size_mb * 1024 * 1024;
+ }
if (qxl->vram_size < 4096) {
qxl->vram_size = 4096;
}
@@ -1860,6 +1866,8 @@ static Property qxl_properties[] = {
DEFINE_PROP_UINT32("debug", PCIQXLDevice, debug, 0),
DEFINE_PROP_UINT32("guestdebug", PCIQXLDevice, guestdebug, 0),
DEFINE_PROP_UINT32("cmdlog", PCIQXLDevice, cmdlog, 0),
+ DEFINE_PROP_UINT32("ram_size_mb", PCIQXLDevice, ram_size_mb, -1),
+ DEFINE_PROP_UINT32("vram_size_mb", PCIQXLDevice, vram_size_mb, -1),
DEFINE_PROP_END_OF_LIST(),
};
diff --git a/hw/qxl.h b/hw/qxl.h
index 766aa6d68e..d0629916ad 100644
--- a/hw/qxl.h
+++ b/hw/qxl.h
@@ -89,6 +89,10 @@ typedef struct PCIQXLDevice {
/* io bar */
MemoryRegion io_bar;
+
+ /* user-friendly properties (in megabytes) */
+ uint32_t ram_size_mb;
+ uint32_t vram_size_mb;
} PCIQXLDevice;
#define PANIC_ON(x) if ((x)) { \