qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Gerd Hoffmann <kraxel@redhat.com>
To: qemu-devel@nongnu.org
Cc: spice-devel@lists.freedesktop.org, Gerd Hoffmann <kraxel@redhat.com>
Subject: [Qemu-devel] [PATCH 3/4] qxl: add user-friendly bar size properties
Date: Fri, 17 Feb 2012 16:10:32 +0100	[thread overview]
Message-ID: <1329491433-31446-4-git-send-email-kraxel@redhat.com> (raw)
In-Reply-To: <1329491433-31446-1-git-send-email-kraxel@redhat.com>

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>
---
 hw/qxl.c |    8 ++++++++
 hw/qxl.h |    4 ++++
 2 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/hw/qxl.c b/hw/qxl.c
index 38bb90e..87ad49a 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 766aa6d..d062991 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)) {                         \
-- 
1.7.1

  parent reply	other threads:[~2012-02-17 15:10 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-17 15:10 [Qemu-devel] [PATCH 0/4] qxl: memory config patches Gerd Hoffmann
2012-02-17 15:10 ` [Qemu-devel] [PATCH 1/4] qxl: drop vram bar minimum size Gerd Hoffmann
2012-02-17 19:27   ` Alon Levy
2012-02-17 19:28   ` Alon Levy
2012-02-17 15:10 ` [Qemu-devel] [PATCH 2/4] qxl: move ram size init to new function Gerd Hoffmann
2012-02-17 19:29   ` [Qemu-devel] [Spice-devel] " Alon Levy
2012-02-17 15:10 ` Gerd Hoffmann [this message]
2012-02-17 19:39   ` [Qemu-devel] [Spice-devel] [PATCH 3/4] qxl: add user-friendly bar size properties Alon Levy
2012-02-17 15:10 ` [Qemu-devel] [PATCH 4/4] [experimental] add optinal 64bit vram bar to qxl Gerd Hoffmann
2012-02-17 19:39   ` [Qemu-devel] [Spice-devel] " Alon Levy
2012-02-20  8:00     ` Gerd Hoffmann
2012-02-20  8:19       ` Alon Levy

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=1329491433-31446-4-git-send-email-kraxel@redhat.com \
    --to=kraxel@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=spice-devel@lists.freedesktop.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).