Received: from eggs.gnu.org ([140.186.70.92]:37638) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RyTel-00048R-2x for qemu-devel@nongnu.org; Fri, 17 Feb 2012 14:39:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RyTej-0001Rq-MX for qemu-devel@nongnu.org; Fri, 17 Feb 2012 14:39:46 -0500 Received: from mx1.redhat.com ([209.132.183.28]:15876) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RyTej-0001Rk-7G for qemu-devel@nongnu.org; Fri, 17 Feb 2012 14:39:45 -0500 Date: Fri, 17 Feb 2012 21:39:38 +0200 From: Alon Levy Message-ID: <20120217193938.GI23926@garlic.redhat.com> References: <1329491433-31446-1-git-send-email-kraxel@redhat.com> <1329491433-31446-4-git-send-email-kraxel@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1329491433-31446-4-git-send-email-kraxel@redhat.com> Subject: Re: [Qemu-devel] [Spice-devel] [PATCH 3/4] qxl: add user-friendly bar size properties List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gerd Hoffmann Cc: spice-devel@lists.freedesktop.org, qemu-devel@nongnu.org On Fri, Feb 17, 2012 at 04:10:32PM +0100, Gerd Hoffmann wrote: > Add two properties to specify bar sizes in megabytes instead of bytes, > which is alot more user-friendly. > ACK. > Signed-off-by: Gerd Hoffmann > --- > 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 > > _______________________________________________ > Spice-devel mailing list > Spice-devel@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/spice-devel