All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sergey Tovpeko <tsv.devel@gmail.com>
To: Ian Campbell <Ian.Campbell@citrix.com>
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: xl and GFX passthrough
Date: Thu, 13 Jan 2011 13:05:14 +0300	[thread overview]
Message-ID: <4D2ECE5A.8070807@gmail.com> (raw)
In-Reply-To: <1294910794.8240.9.camel@zakaz.uk.xensource.com>

[-- Attachment #1: Type: text/plain, Size: 490 bytes --]

Ian Campbell wrote:
>
>
> I think gfx_passthrough is actually a boolean, right? In that case it
> should be declared as "bool" in the idl.
>   

Well, the integer value of gfx_passthru had meaning in 2009, I suspect. 
It differentiated between IGD adapter and discrete adapter.
http://xen.1045712.n5.nabble.com/PATCH-0-2-v2-graphics-passthrough-with-VT-d-td2534811.html

At now, I didn't notice integer meaning of this variable in the code. I 
changed it to bool in the new patch.

Sergey.

[-- Attachment #2: xl_gfx_passthru.patch --]
[-- Type: text/x-patch, Size: 2905 bytes --]

commit 258e2a6cbccea92bd4d11cbe15963f139e8810cc
Author: Sergey Tovpeko <tovpeko@altell.ru>
Date:   Fri Jul 9 20:33:39 2010 +0400

    Pass gfx_passthru option to the device_model.
    
    To enable gfx passthru, xl should parse 'gfx_passthru' parameter from config file, and pass it to qemu-dm.

diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index 2c3fb0f..c630193 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -1208,6 +1208,11 @@ static char ** libxl_build_device_model_args_old(libxl__gc *gc,
             flexarray_set(dm_args, num++, "-vcpu_avail");
             flexarray_set(dm_args, num++, libxl__sprintf(gc, "0x%x", info->vcpu_avail));
         }
+        if (info->gfx_passthru) {
+            flexarray_set(dm_args, num++, "-gfx_passthru");
+            flexarray_set(dm_args, num++, libxl__sprintf(gc, "%d", info->gfx_passthru));
+        }
+
         for (i = 0; i < num_vifs; i++) {
             if (vifs[i].nictype == NICTYPE_IOEMU) {
                 char *smac = libxl__sprintf(gc, "%02x:%02x:%02x:%02x:%02x:%02x",
diff --git a/tools/libxl/libxl.idl b/tools/libxl/libxl.idl
index 81fcfd9..8059328 100644
--- a/tools/libxl/libxl.idl
+++ b/tools/libxl/libxl.idl
@@ -96,6 +96,7 @@ libxl_domain_build_info = Struct("domain_build_info",[
     ("disable_migrate", bool),
     ("kernel",          libxl_file_reference),
     ("cpuid",           libxl_cpuid_policy_list),
+    ("gfx_passthru",    bool),
     ("hvm",             integer),
     ("u", KeyedUnion(None, "hvm",
                 [("hvm", "%s", Struct(None,
@@ -161,6 +162,7 @@ libxl_device_model_info = Struct("device_model_info",[
     ("vcpu_avail",       integer,           False, "vcpus actually available"),
     ("xen_platform_pci", integer,           False, "enable/disable the xen platform pci device"),
     ("extra",            libxl_string_list, False, "extra parameters pass directly to qemu, NULL terminated"),
+    ("gfx_passthru",     bool,              False, "GFX passthrough enabled or disabled"),
     ],
     comment=
 """Device Model information.
diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index 1eace78..415b9b8 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -363,6 +363,7 @@ static void init_dm_info(libxl_device_model_info *dm_info,
     dm_info->apic = b_info->u.hvm.apic;
     dm_info->vcpus = b_info->max_vcpus;
     dm_info->vcpu_avail = b_info->cur_vcpus;
+    dm_info->gfx_passthru = b_info->gfx_passthru;
 
     dm_info->stdvga = 0;
     dm_info->vnc = 1;
@@ -900,6 +901,9 @@ static void parse_config_data(const char *configfile_filename_report,
 
     xlu_cfg_replace_string (config, "kernel", &b_info->kernel.path);
 
+    if (!xlu_cfg_get_long (config, "gfx_passthru", &l))
+        b_info->gfx_passthru = l;
+
     if (c_info->hvm == 1) {
         if (!xlu_cfg_get_long (config, "pae", &l))
             b_info->u.hvm.pae = l;

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

  reply	other threads:[~2011-01-13 10:05 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-13  9:12 xl and GFX passthrough Sergey Tovpeko
2011-01-13  9:26 ` Ian Campbell
2011-01-13 10:05   ` Sergey Tovpeko [this message]
2011-01-13 10:24     ` Ian Campbell
2011-01-13 11:17       ` Sergey Tovpeko
2011-01-13 11:28         ` Ian Campbell
2011-01-13 11:33           ` Ian Jackson
2011-01-17 17:48             ` Ian Jackson
2011-01-26  2:49         ` Kay, Allen M
2011-01-26 10:24           ` Stefano Stabellini
2011-01-26 15:01           ` Daniel De Graaf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4D2ECE5A.8070807@gmail.com \
    --to=tsv.devel@gmail.com \
    --cc=Ian.Campbell@citrix.com \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.