|
Hans de Goede |
56753f |
From eff66c7db18e9a3ef0b6ce5deb9a49b61090d809 Mon Sep 17 00:00:00 2001
|
|
Hans de Goede |
56753f |
From: Gerd Hoffmann <kraxel@redhat.com>
|
|
Hans de Goede |
56753f |
Date: Fri, 17 Feb 2012 15:03:24 +0100
|
|
Hans de Goede |
56753f |
Subject: [PATCH 411/434] qxl: add user-friendly bar size properties
|
|
Hans de Goede |
56753f |
|
|
Hans de Goede |
56753f |
Add two properties to specify bar sizes in megabytes instead of bytes,
|
|
Hans de Goede |
56753f |
which is alot more user-friendly.
|
|
Hans de Goede |
56753f |
|
|
Hans de Goede |
56753f |
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
|
|
Hans de Goede |
56753f |
---
|
|
Hans de Goede |
56753f |
hw/qxl.c | 8 ++++++++
|
|
Hans de Goede |
56753f |
hw/qxl.h | 4 ++++
|
|
Hans de Goede |
56753f |
2 files changed, 12 insertions(+)
|
|
Hans de Goede |
56753f |
|
|
Hans de Goede |
56753f |
diff --git a/hw/qxl.c b/hw/qxl.c
|
|
Hans de Goede |
56753f |
index df8efbc..c8839c3 100644
|
|
Hans de Goede |
56753f |
--- a/hw/qxl.c
|
|
Hans de Goede |
56753f |
+++ b/hw/qxl.c
|
|
Hans de Goede |
56753f |
@@ -1560,11 +1560,17 @@ static DisplayChangeListener display_listener = {
|
|
Hans de Goede |
56753f |
static void qxl_init_ramsize(PCIQXLDevice *qxl, uint32_t ram_min_mb)
|
|
Hans de Goede |
56753f |
{
|
|
Hans de Goede |
56753f |
/* vga ram (bar 0) */
|
|
Hans de Goede |
56753f |
+ if (qxl->ram_size_mb != -1) {
|
|
Hans de Goede |
56753f |
+ qxl->vga.vram_size = qxl->ram_size_mb * 1024 * 1024;
|
|
Hans de Goede |
56753f |
+ }
|
|
Hans de Goede |
56753f |
if (qxl->vga.vram_size < ram_min_mb * 1024 * 1024) {
|
|
Hans de Goede |
56753f |
qxl->vga.vram_size = ram_min_mb * 1024 * 1024;
|
|
Hans de Goede |
56753f |
}
|
|
Hans de Goede |
56753f |
|
|
Hans de Goede |
56753f |
/* vram (surfaces, bar 1) */
|
|
Hans de Goede |
56753f |
+ if (qxl->vram_size_mb != -1) {
|
|
Hans de Goede |
56753f |
+ qxl->vram_size = qxl->vram_size_mb * 1024 * 1024;
|
|
Hans de Goede |
56753f |
+ }
|
|
Hans de Goede |
56753f |
if (qxl->vram_size < 4096) {
|
|
Hans de Goede |
56753f |
qxl->vram_size = 4096;
|
|
Hans de Goede |
56753f |
}
|
|
Hans de Goede |
56753f |
@@ -1863,6 +1869,8 @@ static Property qxl_properties[] = {
|
|
Hans de Goede |
56753f |
DEFINE_PROP_UINT32("debug", PCIQXLDevice, debug, 0),
|
|
Hans de Goede |
56753f |
DEFINE_PROP_UINT32("guestdebug", PCIQXLDevice, guestdebug, 0),
|
|
Hans de Goede |
56753f |
DEFINE_PROP_UINT32("cmdlog", PCIQXLDevice, cmdlog, 0),
|
|
Hans de Goede |
56753f |
+ DEFINE_PROP_UINT32("ram_size_mb", PCIQXLDevice, ram_size_mb, -1),
|
|
Hans de Goede |
56753f |
+ DEFINE_PROP_UINT32("vram_size_mb", PCIQXLDevice, vram_size_mb, -1),
|
|
Hans de Goede |
56753f |
DEFINE_PROP_END_OF_LIST(),
|
|
Hans de Goede |
56753f |
};
|
|
Hans de Goede |
56753f |
|
|
Hans de Goede |
56753f |
diff --git a/hw/qxl.h b/hw/qxl.h
|
|
Hans de Goede |
56753f |
index 766aa6d..d062991 100644
|
|
Hans de Goede |
56753f |
--- a/hw/qxl.h
|
|
Hans de Goede |
56753f |
+++ b/hw/qxl.h
|
|
Hans de Goede |
56753f |
@@ -89,6 +89,10 @@ typedef struct PCIQXLDevice {
|
|
Hans de Goede |
56753f |
|
|
Hans de Goede |
56753f |
/* io bar */
|
|
Hans de Goede |
56753f |
MemoryRegion io_bar;
|
|
Hans de Goede |
56753f |
+
|
|
Hans de Goede |
56753f |
+ /* user-friendly properties (in megabytes) */
|
|
Hans de Goede |
56753f |
+ uint32_t ram_size_mb;
|
|
Hans de Goede |
56753f |
+ uint32_t vram_size_mb;
|
|
Hans de Goede |
56753f |
} PCIQXLDevice;
|
|
Hans de Goede |
56753f |
|
|
Hans de Goede |
56753f |
#define PANIC_ON(x) if ((x)) { \
|
|
Hans de Goede |
56753f |
--
|
|
Hans de Goede |
56753f |
1.7.10
|
|
Hans de Goede |
56753f |
|