From: Fabio Fantoni Subject: Re: [PATCH] Allow 4 MB of video RAM for Cirrus graphics on traditional QEMU Date: Fri, 20 Sep 2013 13:48:30 +0200 Message-ID: <523C360E.6060103@m2r.biz> References: <1379522660-20060-1-git-send-email-rob.hoes@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1379522660-20060-1-git-send-email-rob.hoes@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Rob Hoes Cc: Stefano Stabellini , Ian Jackson , Ian Campbell , xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org Il 18/09/2013 18:44, Rob Hoes ha scritto: > Signed-off-by: Rob Hoes > --- > docs/man/xl.cfg.pod.5 | 18 +++++++------- > tools/libxl/libxl_create.c | 57 ++++++++++++++++++++++++++++++++++---------- > 2 files changed, 55 insertions(+), 20 deletions(-) > > diff --git a/docs/man/xl.cfg.pod.5 b/docs/man/xl.cfg.pod.5 > index 769767b..c18604d 100644 > --- a/docs/man/xl.cfg.pod.5 > +++ b/docs/man/xl.cfg.pod.5 > @@ -1009,14 +1009,16 @@ in the B 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. > -The default amount of video ram for stdvga is 8MB which is sufficient > -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) > -the amount of video ram is fixed at 4MB which is sufficient > -for 1024x768 at 32 bpp and videoram option is currently working > -only when using the upstream qemu-xen device-model. > + > +When using the qemu-xen-traditional device-model, the default as well as > +minimum amount of video RAM for stdvga is 8 MB, which is sufficient for e.g. > +1600x1200 at 32bpp. For the upstream qemu-xen device-model, the default and > +minimum is 16 MB. > + > +When using the emulated Cirrus graphics card (B) and the > +qemu-xen-traditional device-model, the amount of video RAM is fixed at 4 MB, > +which is sufficient for 1024x768 at 32 bpp. For the upstream qemu-xen > +device-model, the default and minimum is 8 MB. > > =item B > > diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c > index 7567238..e4cb602 100644 > --- a/tools/libxl/libxl_create.c > +++ b/tools/libxl/libxl_create.c > @@ -213,20 +213,55 @@ int libxl__domain_build_info_setdefault(libxl__gc *gc, > if (b_info->shadow_memkb == LIBXL_MEMKB_DEFAULT) > b_info->shadow_memkb = 0; > > - if (b_info->u.hvm.vga.kind == LIBXL_VGA_INTERFACE_TYPE_STD && > - b_info->device_model_version == > - LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN) { > + if (!b_info->u.hvm.vga.kind) > + b_info->u.hvm.vga.kind = LIBXL_VGA_INTERFACE_TYPE_CIRRUS; > + > + switch (b_info->device_model_version) { > + case LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL: > + switch (b_info->u.hvm.vga.kind) { > + case LIBXL_VGA_INTERFACE_TYPE_STD: > + if (b_info->video_memkb == LIBXL_MEMKB_DEFAULT) > + b_info->video_memkb = 8 * 1024; > + if (b_info->video_memkb < (8 * 1024) ){ > + LOG(ERROR,"videoram must be at least 8 MB for STDVGA " > + "on QEMU_XEN_TRADITIONAL"); > + return ERROR_INVAL; > + } > + break; > + case LIBXL_VGA_INTERFACE_TYPE_CIRRUS: > + default: > + if (b_info->video_memkb == LIBXL_MEMKB_DEFAULT) > + b_info->video_memkb = 4 * 1024; > + if (b_info->video_memkb != (4 * 1024) ){ > + LOG(WARN,"videoram other than 4 MB for CIRRUS on " > + "QEMU_XEN_TRADITIONAL will be ignored"); } > + break; > + } > + break; > + case LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN: > + default: > + switch (b_info->u.hvm.vga.kind) { > + case LIBXL_VGA_INTERFACE_TYPE_STD: > if (b_info->video_memkb == LIBXL_MEMKB_DEFAULT) > b_info->video_memkb = 16 * 1024; > - else if (b_info->video_memkb < (16 * 1024) ){ > - LOG(ERROR, "videoram must be at least 16 mb with stdvga"); > + if (b_info->video_memkb < (16 * 1024) ){ > + LOG(ERROR,"videoram must be at least 16 MB for STDVGA " > + "on QEMU_XEN"); > + return ERROR_INVAL; > + } > + break; > + case LIBXL_VGA_INTERFACE_TYPE_CIRRUS: > + default: > + if (b_info->video_memkb == LIBXL_MEMKB_DEFAULT) > + b_info->video_memkb = 8 * 1024; > + if (b_info->video_memkb < (8 * 1024) ){ > + LOG(ERROR,"videoram must be at least 8 MB for CIRRUS " > + "on QEMU_XEN"); > return ERROR_INVAL; > } > - } else if (b_info->video_memkb == LIBXL_MEMKB_DEFAULT) > - b_info->video_memkb = 8 * 1024; > - else if (b_info->video_memkb < (8 * 1024) ){ > - LOG(ERROR,"videoram must be at least 8 mb"); > - return ERROR_INVAL; > + break; > + } > + break; > } > > if (b_info->u.hvm.timer_mode == LIBXL_TIMER_MODE_DEFAULT) > @@ -251,8 +286,6 @@ int libxl__domain_build_info_setdefault(libxl__gc *gc, > if (!b_info->u.hvm.boot) return ERROR_NOMEM; > } > > - if (!b_info->u.hvm.vga.kind) > - b_info->u.hvm.vga.kind = LIBXL_VGA_INTERFACE_TYPE_CIRRUS; > libxl_defbool_setdefault(&b_info->u.hvm.vnc.enable, true); > if (libxl_defbool_val(b_info->u.hvm.vnc.enable)) { > libxl_defbool_setdefault(&b_info->u.hvm.vnc.findunused, true); I not tested it for now but seems good, I cc'ed the maintainers.