Patchwork hw/qxl: allow vram to be sized to 4096 bytes

login
register
mail settings
Submitter Alon Levy
Date Feb. 16, 2012, 5:45 p.m.
Message ID <1329414355-26909-1-git-send-email-alevy@redhat.com>
Download mbox | patch
Permalink /patch/141651/
State New
Headers show

Comments

Alon Levy - Feb. 16, 2012, 5:45 p.m.
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 <alevy@redhat.com>
---
 hw/qxl.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
Gerd Hoffmann - Feb. 17, 2012, 3:11 p.m.
Hi,

> -    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) {

Is there any reason to keep the 16MB minimum size?  I think we can just
drop it and simplify the logic here.  See the patch series just sent.

cheers,
  Gerd
Alon Levy - Feb. 17, 2012, 7:15 p.m.
On Fri, Feb 17, 2012 at 04:11:59PM +0100, Gerd Hoffmann wrote:
>   Hi,
> 
> > -    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) {
> 
> Is there any reason to keep the 16MB minimum size?  I think we can just
> drop it and simplify the logic here.  See the patch series just sent.

I agree. Will review your patchset.

> 
> cheers,
>   Gerd
>

Patch

diff --git a/hw/qxl.c b/hw/qxl.c
index ac69125..b1a2daa 100644
--- a/hw/qxl.c
+++ b/hw/qxl.c
@@ -1556,10 +1556,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);