Skip to contentSkip to conversation

tools/libxl: Improve videoram setting

PATCH RESEND Superseded Fabio Fantoni 2 participants 3 messages Jan 28, 2013 – Feb 5, 2013

v4 of 6 Superseded Latest is v6 →

lore
Share & tools
lore
#0 lore raw

PATCH RESEND v4 1/1 tools/libxl: Improve videoram setting

tools/libxl: Improve videoram setting

- If videoram setting is less than 8 mb shows error and exit.
- Added videoram setting for qemu upstream with cirrus (added in qemu 1.3).
- Updated xl.cfg man.

---
 docs/man/xl.cfg.pod.5      |   14 +++++---------
 tools/libxl/libxl_create.c |    4 ++++
 tools/libxl/libxl_dm.c     |    6 ++++++
 3 files changed, 15 insertions(+), 9 deletions(-)
docs/man/xl.cfg.pod.5 +5 -9
index caba162..9c5cdcd 100644
@@ -974,19 +974,15 @@ in the B<VFB_SPEC_STRING> for configuring virtual frame buffer devices
 
 Sets the amount of RAM which the emulated video card will contain,
 which in turn limits the resolutions and bit depths which will be
-available. This option is only available when using the B<stdvga>
-option (see below).
+available.
 The default amount of video ram for stdvga is 8MB which is sufficient
-for e.g. 1600x1200 at 32bpp.
+for e.g. 1600x1200 at 32bpp and videoram option is currently working
+only when using the qemu-xen-traditional device-model.
 
 When using the emulated Cirrus graphics card (B<stdvga=0>)
 the amount of video ram is fixed at 4MB which is sufficient
-for 1024x768 at 32 bpp.
-
-videoram option is currently only available when using the
-qemu-xen-traditional device-model. Upstream qemu-xen device-model
-currently does not support changing the amount of video memory for the
-emulated graphics device.
+for 1024x768 at 32 bpp and videoram option is currently working
+only when using the upstream qemu-xen device-model.
 
 =item B<stdvga=BOOLEAN>
 
tools/libxl/libxl_create.c +4 -0
index a8dfe61..55014e5 100644
@@ -199,6 +199,10 @@ int libxl__domain_build_info_setdefault(libxl__gc *gc,
             b_info->shadow_memkb = 0;
         if (b_info->video_memkb == LIBXL_MEMKB_DEFAULT)
             b_info->video_memkb = 8 * 1024;
+        else if (b_info->video_memkb < 8192){
+            LIBXL__LOG(CTX, LIBXL__LOG_ERROR,"videoram must be at least 8 mb");
+            return ERROR_INVAL;
+        }
         if (b_info->u.hvm.timer_mode == LIBXL_TIMER_MODE_DEFAULT)
             b_info->u.hvm.timer_mode =
                 LIBXL_TIMER_MODE_NO_DELAY_FOR_MISSED_TICKS;
tools/libxl/libxl_dm.c +6 -0
index 51f9914..465b1fd 100644
@@ -430,6 +430,12 @@ static char ** libxl__build_device_model_args_new(libxl__gc *gc,
             break;
         case LIBXL_VGA_INTERFACE_TYPE_CIRRUS:
             flexarray_vappend(dm_args, "-vga", "cirrus", NULL);
+            if (b_info->video_memkb) {
+                flexarray_vappend(dm_args, "-global",
+                libxl__sprintf(gc, "vga.vram_size_mb=%d",
+                libxl__sizekb_to_mb(b_info->video_memkb)),
+                NULL);
+            }
             break;
         }
 
Signature · 1 line
1.7.9.5

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#1 lore raw
Quoted 4 lines · Fabio Fantoni

tools/libxl: Improve videoram setting

- If videoram setting is less than 8 mb shows error and exit.
- Added videoram setting for qemu upstream with cirrus (added in qemu 1.3).

Which version of qemu does Xen currently ship? Do we need some compat code with work with e.g. qemu 1.2 or do older versions silently accept + ignore this option?

Quoted 44 lines

- Updated xl.cfg man.

---
  docs/man/xl.cfg.pod.5      |   14 +++++---------
  tools/libxl/libxl_create.c |    4 ++++
  tools/libxl/libxl_dm.c     |    6 ++++++
  3 files changed, 15 insertions(+), 9 deletions(-)
docs/man/xl.cfg.pod.5 +0 -0
index caba162..9c5cdcd 100644
@@ -974,19 +974,15 @@ in the B<VFB_SPEC_STRING> for configuring virtual 

frame buffer devices

Sets the amount of RAM which the emulated video card will contain, which in turn limits the resolutions and bit depths which will be

docs/man/xl.cfg.pod.5 +5 -9
-available. This option is only available when using the B<stdvga>
-option (see below).
+available.
  The default amount of video ram for stdvga is 8MB which is sufficient
-for e.g. 1600x1200 at 32bpp.
+for e.g. 1600x1200 at 32bpp and videoram option is currently working
+only when using the qemu-xen-traditional device-model.
 
  When using the emulated Cirrus graphics card (B<stdvga=0>)
  the amount of video ram is fixed at 4MB which is sufficient
-for 1024x768 at 32 bpp.
-
-videoram option is currently only available when using the
-qemu-xen-traditional device-model. Upstream qemu-xen device-model
-currently does not support changing the amount of video memory for the
-emulated graphics device.
+for 1024x768 at 32 bpp and videoram option is currently working
+only when using the upstream qemu-xen device-model.
 
  =item B<stdvga=BOOLEAN>
tools/libxl/libxl_create.c +0 -0
index a8dfe61..55014e5 100644

tools/libxl/libxl_create.c int libxl__domain_build_info_setdefault(libxl__gc *gc, · line 204

Quoted 6 lines
tools/libxl/libxl_create.c +2 -0
@@ -199,6 +199,10 @@ int libxl__domain_build_info_setdefault(libxl__gc *gc,
              b_info->shadow_memkb = 0;
          if (b_info->video_memkb == LIBXL_MEMKB_DEFAULT)
              b_info->video_memkb = 8 * 1024;
+        else if (b_info->video_memkb < 8192){
+            LIBXL__LOG(CTX, LIBXL__LOG_ERROR,"videoram must be at least 
 8 mb");

Unfortunately the patch is whitespace damaged and doesn't apply. The indentation is off too (might be related to the whitespace damage?)

Quoted 10 lines
tools/libxl/libxl_create.c +2 -0
+            return ERROR_INVAL;
+        }
          if (b_info->u.hvm.timer_mode == LIBXL_TIMER_MODE_DEFAULT)
              b_info->u.hvm.timer_mode =
                  LIBXL_TIMER_MODE_NO_DELAY_FOR_MISSED_TICKS;
tools/libxl/libxl_dm.c +0 -0
index 51f9914..465b1fd 100644

tools/libxl/libxl_dm.c static char ** · line 439

Quoted 10 lines
tools/libxl/libxl_dm.c +6 -0
@@ -430,6 +430,12 @@ static char ** 
 libxl__build_device_model_args_new(libxl__gc *gc,
              break;
          case LIBXL_VGA_INTERFACE_TYPE_CIRRUS:
              flexarray_vappend(dm_args, "-vga", "cirrus", NULL);
+            if (b_info->video_memkb) {
+                flexarray_vappend(dm_args, "-global",
+                libxl__sprintf(gc, "vga.vram_size_mb=%d",
+                libxl__sizekb_to_mb(b_info->video_memkb)),
+                NULL);
+            }

The indentation here is wrong as well.

Ian.

#2 lore raw

Il 05/02/2013 11:25, Ian Campbell ha scritto:

Quoted 8 lines · Fabio Fantoni
Quoted 4 lines

tools/libxl: Improve videoram setting

- If videoram setting is less than 8 mb shows error and exit.
- Added videoram setting for qemu upstream with cirrus (added in qemu 1.3).

Which version of qemu does Xen currently ship? Do we need some compat code with work with e.g. qemu 1.2 or do older versions silently accept + ignore this option?

For now not tried with older qemu, I'll try with xen 4.2 that has older qemu.

Quoted 39 lines
Quoted 39 lines

- Updated xl.cfg man.

---
   docs/man/xl.cfg.pod.5      |   14 +++++---------
   tools/libxl/libxl_create.c |    4 ++++
   tools/libxl/libxl_dm.c     |    6 ++++++
   3 files changed, 15 insertions(+), 9 deletions(-)
docs/man/xl.cfg.pod.5 +0 -0
index caba162..9c5cdcd 100644
@@ -974,19 +974,15 @@ in the B<VFB_SPEC_STRING> for configuring virtual

frame buffer devices

Sets the amount of RAM which the emulated video card will contain, which in turn limits the resolutions and bit depths which will be

docs/man/xl.cfg.pod.5 +5 -9
-available. This option is only available when using the B<stdvga>
-option (see below).
+available.
   The default amount of video ram for stdvga is 8MB which is sufficient
-for e.g. 1600x1200 at 32bpp.
+for e.g. 1600x1200 at 32bpp and videoram option is currently working
+only when using the qemu-xen-traditional device-model.
 
   When using the emulated Cirrus graphics card (B<stdvga=0>)
   the amount of video ram is fixed at 4MB which is sufficient
-for 1024x768 at 32 bpp.
-
-videoram option is currently only available when using the
-qemu-xen-traditional device-model. Upstream qemu-xen device-model
-currently does not support changing the amount of video memory for the
-emulated graphics device.
+for 1024x768 at 32 bpp and videoram option is currently working
+only when using the upstream qemu-xen device-model.
 
   =item B<stdvga=BOOLEAN>
Quoted 13 lines

tools/libxl/libxl_create.c int libxl__domain_build_info_setdefault(libxl__gc *gc, · line 204

Quoted 11 lines
tools/libxl/libxl_create.c +2 -0
index a8dfe61..55014e5 100644
@@ -199,6 +199,10 @@ int libxl__domain_build_info_setdefault(libxl__gc *gc,
               b_info->shadow_memkb = 0;
           if (b_info->video_memkb == LIBXL_MEMKB_DEFAULT)
               b_info->video_memkb = 8 * 1024;
+        else if (b_info->video_memkb < 8192){
+            LIBXL__LOG(CTX, LIBXL__LOG_ERROR,"videoram must be at least
 8 mb");

Unfortunately the patch is whitespace damaged and doesn't apply. The indentation is off too (might be related to the whitespace damage?)

Do not apply this patch now, I'll improve it before following your advices.

Quoted 27 lines
Quoted 10 lines
tools/libxl/libxl_create.c +2 -0
+            return ERROR_INVAL;
+        }
           if (b_info->u.hvm.timer_mode == LIBXL_TIMER_MODE_DEFAULT)
               b_info->u.hvm.timer_mode =
                   LIBXL_TIMER_MODE_NO_DELAY_FOR_MISSED_TICKS;
tools/libxl/libxl_dm.c +0 -0
index 51f9914..465b1fd 100644

tools/libxl/libxl_dm.c static char ** · line 439

Quoted 10 lines
tools/libxl/libxl_dm.c +6 -0
@@ -430,6 +430,12 @@ static char **
 libxl__build_device_model_args_new(libxl__gc *gc,
               break;
           case LIBXL_VGA_INTERFACE_TYPE_CIRRUS:
               flexarray_vappend(dm_args, "-vga", "cirrus", NULL);
+            if (b_info->video_memkb) {
+                flexarray_vappend(dm_args, "-global",
+                libxl__sprintf(gc, "vga.vram_size_mb=%d",
+                libxl__sizekb_to_mb(b_info->video_memkb)),
+                NULL);
+            }

The indentation here is wrong as well.

Ian.

Quoted 6 lines

-----
Nessun virus nel messaggio.
Controllato da AVG - www.avg.com
Versione: 2013.0.2897 / Database dei virus: 2639/6080 - Data di rilascio: 04/02/2013

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel