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

Re: [Xen-devel] [PATCH v16] libxl: Add qxl vga interface support for upstream qemu



Il 27/05/2014 17:05, Fabio Fantoni ha scritto:
Usage:
   vga="qxl"

Qxl vga support many resolutions that not supported by stdvga,
mainly the 16:9 ones and other high up to 2560x1600.
With QXL you can get improved performance and smooth video also
with high resolutions and high quality.
Require their drivers installed in the domU and spice used
otherwise act as a simple stdvga.

Signed-off-by: Fabio Fantoni <fabio.fantoni@xxxxxxx>
Signed-off-by: Zhou Peng <zpengxen@xxxxxxxxx>
Acked-by: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
Acked-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
Acked-by: George Dunlap <george.dunlap@xxxxxxxxxxxxx>

---

Changes in v16:
- refresh
- improved commit description

Changes in v15:
- refresh
- small code improvements in libxl_dm.c

Changes in v14:
- refresh
- update qemu parameters (from -vga to -device)

NOTES:
Works correctly with windows domUs, tested on windows 7 64 bit
with qxl driver from spice guest tools 0.74.
I tested some resolution not supported by stdvga (1366x768, 1600x900
and 1920x1080) with 32 bit color and all works good equal to kvm.
For now not works on linux domUs when xorg have 100% cpu and black
screen with qxl driver installed.
Seems needed other changes/fixes on xen and/or xorg/qxl driver side
before have it full working with linux domUs.

The big performance issue with qxl on windows 7 seems now full solved on my unstable testing of latest week and works good on xen (equal to kvm).
Mainly part of problem seems solved by qemu 2.0 and spice server 0.12.5.
The latest part by recent xen-unstable, today I tried also with latest stable-4.4 (with qemu 2.0) but problem is still partially present (even if notable only on big resolution, for example 1920x1080), I not know which xen-unstable commit/s solves the problem.
The exact source used in my tests:
stable-4.4 (with still some performance problem): https://github.com/Fantu/Xen/commits/rebase/m2r-testing unstable (working equal to kvm): https://github.com/Fantu/Xen/commits/rebase/m2r-next

About linux domUs this is my latest test with xorg backtrace included:
http://lists.xen.org/archives/html/xen-devel/2014-06/msg00342.html

I hope this information is helpful to anyone who wants to try/use qxl on xen.

Can someone take a look at the problem remained on linux domUsplease? Unfortunately, recently I have no time for in-depth debugging and most probably I not be able to solve the problem.

---
  docs/man/xl.cfg.pod.5       |   10 +++++++++-
  tools/libxl/libxl_create.c  |   13 +++++++++++++
  tools/libxl/libxl_dm.c      |    8 ++++++++
  tools/libxl/libxl_types.idl |    1 +
  tools/libxl/xl_cmdimpl.c    |    2 ++
  5 files changed, 33 insertions(+), 1 deletion(-)

diff --git a/docs/man/xl.cfg.pod.5 b/docs/man/xl.cfg.pod.5
index 0ca37bc..972fc37 100644
--- a/docs/man/xl.cfg.pod.5
+++ b/docs/man/xl.cfg.pod.5
@@ -1097,6 +1097,9 @@ 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.
+For B<qxl> vga, the default is both default and minimal 128MB.
+If B<videoram> is set less than 128MB, an error will be triggered.
+
  =item B<stdvga=BOOLEAN>
Select a standard VGA card with VBE (VESA BIOS Extensions) as the
@@ -1108,9 +1111,14 @@ This option is deprecated, use vga="stdvga" instead.
=item B<vga="STRING"> -Selects the emulated video card (none|stdvga|cirrus).
+Selects the emulated video card (none|stdvga|cirrus|qxl).
  The default is cirrus.
+In general, QXL should work with the Spice remote display protocol
+for acceleration, and QXL driver is necessary in guest in this case.
+QXL can also work with the VNC protocol, but it will be like a standard
+VGA without acceleration.
+
  =item B<vnc=BOOLEAN>
Allow access to the display via the VNC protocol. This enables the
diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c
index 9a82684..f57611e 100644
--- a/tools/libxl/libxl_create.c
+++ b/tools/libxl/libxl_create.c
@@ -230,6 +230,10 @@ int libxl__domain_build_info_setdefault(libxl__gc *gc,
                  if (b_info->video_memkb == LIBXL_MEMKB_DEFAULT)
                      b_info->video_memkb = 0;
                  break;
+            case LIBXL_VGA_INTERFACE_TYPE_QXL:
+                LOG(ERROR,"qemu upstream required for qxl vga");
+                return ERROR_INVAL;
+                break;
              case LIBXL_VGA_INTERFACE_TYPE_STD:
                  if (b_info->video_memkb == LIBXL_MEMKB_DEFAULT)
                      b_info->video_memkb = 8 * 1024;
@@ -254,6 +258,15 @@ int libxl__domain_build_info_setdefault(libxl__gc *gc,
                  if (b_info->video_memkb == LIBXL_MEMKB_DEFAULT)
                      b_info->video_memkb = 0;
                  break;
+            case LIBXL_VGA_INTERFACE_TYPE_QXL:
+                if (b_info->video_memkb == LIBXL_MEMKB_DEFAULT) {
+                    b_info->video_memkb = (128 * 1024);
+                } else if (b_info->video_memkb < (128 * 1024)) {
+                    LOG(ERROR,
+                        "128 Mib videoram is the minimum for qxl default");
+                    return ERROR_INVAL;
+                }
+                break;
              case LIBXL_VGA_INTERFACE_TYPE_STD:
                  if (b_info->video_memkb == LIBXL_MEMKB_DEFAULT)
                      b_info->video_memkb = 16 * 1024;
diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c
index 51ab2bf..d2530ab 100644
--- a/tools/libxl/libxl_dm.c
+++ b/tools/libxl/libxl_dm.c
@@ -220,6 +220,8 @@ static char ** libxl__build_device_model_args_old(libxl__gc 
*gc,
          case LIBXL_VGA_INTERFACE_TYPE_NONE:
              flexarray_append_pair(dm_args, "-vga", "none");
              break;
+        case LIBXL_VGA_INTERFACE_TYPE_QXL:
+            break;
          }
if (b_info->u.hvm.boot) {
@@ -516,6 +518,12 @@ static char ** 
libxl__build_device_model_args_new(libxl__gc *gc,
              break;
          case LIBXL_VGA_INTERFACE_TYPE_NONE:
              break;
+        case LIBXL_VGA_INTERFACE_TYPE_QXL:
+            /* QXL have 2 ram regions, ram and vram */
+            flexarray_append_pair(dm_args, "-device",
+                GCSPRINTF("qxl-vga,vram_size_mb=%"PRIu64",ram_size_mb=%"PRIu64,
+                (b_info->video_memkb/2/1024), (b_info->video_memkb/2/1024) ) );
+            break;
          }
if (b_info->u.hvm.boot) {
diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl
index 52f1aa9..798f85a 100644
--- a/tools/libxl/libxl_types.idl
+++ b/tools/libxl/libxl_types.idl
@@ -154,6 +154,7 @@ libxl_vga_interface_type = 
Enumeration("vga_interface_type", [
      (1, "CIRRUS"),
      (2, "STD"),
      (3, "NONE"),
+    (4, "QXL"),
      ], init_val = 1)
libxl_vendor_device = Enumeration("vendor_device", [
diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index 5195914..a5a4cc6 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -1682,6 +1682,8 @@ skip_vfb:
                  b_info->u.hvm.vga.kind = LIBXL_VGA_INTERFACE_TYPE_CIRRUS;
              } else if (!strcmp(buf, "none")) {
                  b_info->u.hvm.vga.kind = LIBXL_VGA_INTERFACE_TYPE_NONE;
+            } else if (!strcmp(buf, "qxl")) {
+                b_info->u.hvm.vga.kind = LIBXL_VGA_INTERFACE_TYPE_QXL;
              } else {
                  fprintf(stderr, "Unknown vga \"%s\" specified\n", buf);
                  exit(1);


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.