qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH] hw/qxl: allow vram to be sized to 4096 bytes


From: Alon Levy
Subject: [Qemu-devel] [PATCH] hw/qxl: allow vram to be sized to 4096 bytes
Date: Wed, 9 Nov 2011 15:37:52 +0200

This allows us to reduce the size of the surfaces bar minimally while
not breaking current drivers. To completely disable the bar, or make it
zero sized, would break them.

Signed-off-by: Alon Levy <address@hidden>
---
Causes endless ooms for the linux driver, but it's mainly meant for the
windows driver, where it was tested (with a previous patch I can't find,
but this one is simple enough and equivalent).

 hw/qxl.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/hw/qxl.c b/hw/qxl.c
index 41500e9..592842b 100644
--- a/hw/qxl.c
+++ b/hw/qxl.c
@@ -1559,10 +1559,12 @@ static int qxl_init_common(PCIQXLDevice *qxl)
     init_qxl_rom(qxl);
     init_qxl_ram(qxl);
 
-    if (qxl->vram_size < 16 * 1024 * 1024) {
+    /* a request of 0 vram_size is translated to the smallest vram that doesn't
+     * break current off screen surfaces using drivers */
+    if (qxl->vram_size > 0 && qxl->vram_size < 16 * 1024 * 1024) {
         qxl->vram_size = 16 * 1024 * 1024;
     }
-    if (qxl->revision == 1) {
+    if (qxl->revision == 1 || qxl->vram_size == 0) {
         qxl->vram_size = 4096;
     }
     qxl->vram_size = msb_mask(qxl->vram_size * 2 - 1);
-- 
1.7.7.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]