Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758761AbbKTGM4 (ORCPT ); Fri, 20 Nov 2015 01:12:56 -0500 Received: from mga09.intel.com ([134.134.136.24]:58090 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752027AbbKTGMz (ORCPT ); Fri, 20 Nov 2015 01:12:55 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,321,1444719600"; d="scan'208";a="824761675" From: "Tian, Kevin" To: Gerd Hoffmann CC: Alex Williamson , "Song, Jike" , "xen-devel@lists.xen.org" , "igvt-g@ml01.01.org" , "intel-gfx@lists.freedesktop.org" , "linux-kernel@vger.kernel.org" , "White, Michael L" , "Dong, Eddie" , "Li, Susie" , "Cowperthwaite, David J" , "Reddy, Raghuveer" , "Zhu, Libo" , "Zhou, Chao" , "Wang, Hongbo" , "Lv, Zhiyuan" , qemu-devel , Paolo Bonzini Subject: RE: [Intel-gfx] [Announcement] 2015-Q3 release of XenGT - a Mediated Graphics Passthrough Solution from Intel Thread-Topic: [Intel-gfx] [Announcement] 2015-Q3 release of XenGT - a Mediated Graphics Passthrough Solution from Intel Thread-Index: AQHRIiyyOpjII2o6BEOu3O6YRHHGpJ6imYIg///oBwCAAewboA== Date: Fri, 20 Nov 2015 06:12:50 +0000 Message-ID: References: <53D215D3.50608@intel.com> <547FCAAD.2060406@intel.com> <54AF967B.3060503@intel.com> <5527CEC4.9080700@intel.com> <559B3E38.1080707@intel.com> <562F4311.9@intel.com> <1447870341.4697.92.camel@redhat.com> <1447922452.25140.39.camel@redhat.com> In-Reply-To: <1447922452.25140.39.camel@redhat.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by mail.home.local id tAK6DjjS030879 Content-Length: 4508 Lines: 106 > From: Gerd Hoffmann [mailto:kraxel@redhat.com] > Sent: Thursday, November 19, 2015 4:41 PM > > Hi, > > > > Another area of extension is how to expose a framebuffer to QEMU for > > > seamless integration into a SPICE/VNC channel. For this I believe we > > > could use a new region, much like we've done to expose VGA access > > > through a vfio device file descriptor. An area within this new > > > framebuffer region could be directly mappable in QEMU while a > > > non-mappable page, at a standard location with standardized format, > > > provides a description of framebuffer and potentially even a > > > communication channel to synchronize framebuffer captures. This would > > > be new code for QEMU, but something we could share among all vGPU > > > implementations. > > > > Now GVT-g already provides an interface to decode framebuffer information, > > w/ an assumption that the framebuffer will be further composited into > > OpenGL APIs. > > Can I have a pointer to docs / code? > > iGVT-g_Setup_Guide.txt mentions a "Indirect Display Mode", but doesn't > explain how the guest framebuffer can be accessed then. You can check "fb_decoder.h". One thing to clarify. Its format is actually based on drm definition, instead of OpenGL. Sorry for that. > > > So the format is defined according to OpenGL definition. > > Does that meet SPICE requirement? > > Yes and no ;) > > Some more background: We basically have two rendering paths in qemu. > The classic one, without opengl, and a new, still emerging one, using > opengl and dma-bufs (gtk support merged for qemu 2.5, sdl2 support will > land in 2.6, spice support still WIP, hopefully 2.6 too). For best > performance you probably want use the new opengl-based rendering > whenever possible. However I do *not* expect the classic rendering path > disappear, we'll continue to need that in various cases, most prominent > one being vnc support. > > So, for non-opengl rendering qemu needs the guest framebuffer data so it > can feed it into the vnc server. The vfio framebuffer region is meant > to support this use case. what's the format requirement on that framebuffer? If you are familiar with Intel Graphics, there's a so-called tiling feature applied on frame buffer so it can't be used as a raw input to vnc server. w/o opengl you need do some conversion on CPU first. > > > Another thing to be added. Framebuffers are frequently switched in > > reality. So either Qemu needs to poll or a notification mechanism is required. > > The idea is to have qemu poll (and adapt poll rate, i.e. without vnc > client connected qemu will poll alot less frequently). > > > And since it's dynamic, having framebuffer page directly exposed in the > > new region might be tricky. We can just expose framebuffer information > > (including base, format, etc.) and let Qemu to map separately out of VFIO > > interface. > > Allocate some memory, ask gpu to blit the guest framebuffer there, i.e. > provide a snapshot of the current guest display instead of playing > mapping tricks? yes it works but better to be completed in user level. > > > And... this works fine with vGPU model since software knows all the > > detail about framebuffer. However in pass-through case, who do you expect > > to provide that information? Is it OK to introduce vGPU specific APIs in > > VFIO? > > It will only be used in the vgpu case, not for pass-though. > > We think it is better to extend the vfio interface to improve vgpu > support rather than inventing something new while vfio can satisfy 90% > of the vgpu needs already. We want avoid vendor-specific extensions > though, the vgpu extension should work across vendors. it's fine, as long as vgpu specific interface is allowed. :-) > > > Now there is no standard. We expose vGPU life-cycle mgmt. APIs through > > sysfs (under i915 node), which is very Intel specific. In reality different > > vendors have quite different capabilities for their own vGPUs, so not sure > > how standard we can define such a mechanism. > > Agree when it comes to create vGPU instances. > > > But this code should be > > minor to be maintained in libvirt. > > As far I know libvirt only needs to discover those devices. If they > look like sr/iov devices in sysfs this might work without any changes to > libvirt. > > cheers, > Gerd > ????{.n?+???????+%?????ݶ??w??{.n?+????{??G?????{ay?ʇڙ?,j??f???h?????????z_??(?階?ݢj"???m??????G????????????&???~???iO???z??v?^?m???? ????????I?