From patchwork Fri Dec 4 10:13:32 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 7766981 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 19F88BEEE1 for ; Fri, 4 Dec 2015 10:13:40 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 39DED20602 for ; Fri, 4 Dec 2015 10:13:39 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 57BE320601 for ; Fri, 4 Dec 2015 10:13:38 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5CD926E437; Fri, 4 Dec 2015 02:13:37 -0800 (PST) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by gabe.freedesktop.org (Postfix) with ESMTPS id CF3B76E437 for ; Fri, 4 Dec 2015 02:13:35 -0800 (PST) Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (Postfix) with ESMTPS id 382FF28A4B; Fri, 4 Dec 2015 10:13:35 +0000 (UTC) Received: from nilsson.home.kraxel.org (ovpn-116-128.ams2.redhat.com [10.36.116.128]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id tB4ADX56017637; Fri, 4 Dec 2015 05:13:34 -0500 Received: by nilsson.home.kraxel.org (Postfix, from userid 500) id F035E819B1; Fri, 4 Dec 2015 11:13:32 +0100 (CET) Message-ID: <1449224012.18669.55.camel@redhat.com> From: Gerd Hoffmann To: "Tian, Kevin" Date: Fri, 04 Dec 2015 11:13:32 +0100 In-Reply-To: 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> <1448007960.6904.22.camel@redhat.com> Mime-Version: 1.0 X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 Cc: "igvt-g@ml01.01.org" , "Reddy, Raghuveer" , "White, Michael L" , "Cowperthwaite, David J" , "intel-gfx@lists.freedesktop.org" , "Li, Susie" , "Dong, Eddie" , "linux-kernel@vger.kernel.org" , "xen-devel@lists.xen.org" , qemu-devel , "Zhou, Chao" , Paolo Bonzini , "Zhu, Libo" , "Wang, Hongbo" Subject: Re: [Intel-gfx] [Announcement] 2015-Q3 release of XenGT - a Mediated Graphics Passthrough Solution from Intel X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Hi, > btw some questions here: > > for non-gl and gl rendering in Qemu, are they based on dma-buf already? > once we can export guest framebuffer in dma-buf, is there additional work > required or just straightforward to integrate with SPICE? Right now we are busy integrating dma-buf support into spice, which will be used for the gl rendering path, for virtio-gpu. For intel-vgpu the wireup inside qemu will be slightly different: We'll get a dma-buf handle from the igd driver, whereas virtio-gpu renders into a texture, then exports that texture as dma-buf. But in both cases we'll go pass the dma-buf with the guest framebuffer (and meta-data such as fourcc and size) to spice-server, which in turn will pass on the dma-buf to spice-client for (local) display. So we have a common code path in spice for both virtio-gpu and intel-vgpu, based on dma-bufs. spice-server even doesn't need to know what kind of graphics device the guest has, it'll go just process the dma-bufs. longer-term we also plan to support video-encoding for a remote display. Again based on dma-bufs, by sending them to the gpu video encoder. The non-gl rendering path needs to be figured out. With virtio-gpu we'll go simply turn off 3d support, so the guest will fallback to do software rendering, we'll get a classic DisplaySurface and the vnc server can work with that. That isn't going to fly with intel-vgpu though, so we need something else. Import dma-buf, then glReadPixels into a DisplaySurface would work. But as mentioned before I'd prefer a code path which doesn't require opengl support in qemu, and one option for that would be the special vfio region. I've written up a quick draft meanwhile: #endif /* _UAPIVFIO_H */ cheers, Gerd diff --git a/include/uapi/linux/vfio.h b/include/uapi/linux/vfio.h index 751b69f..91b928d 100644 --- a/include/uapi/linux/vfio.h +++ b/include/uapi/linux/vfio.h @@ -596,6 +596,28 @@ struct vfio_iommu_spapr_tce_remove { }; #define VFIO_IOMMU_SPAPR_TCE_REMOVE _IO(VFIO_TYPE, VFIO_BASE + 20) +/* -------- Additional API for vGPU -------- */ + +/* + * framebuffer meta data + * subregion located at the end of the framebuffer region + */ +struct vfio_framebuffer { + __u32 argsz; + + /* out */ + __u32 format; /* drm fourcc */ + __u32 offset; /* relative to region start */ + __u32 width; /* in pixels */ + __u32 height; /* in pixels */ + __u32 stride; /* in bytes */ + + /* in+out */ +#define VFIO_FB_STATE_REQUEST_UPDATE 1 /* userspace requests update */ +#define VFIO_FB_STATE_UPDATE_COMPLETE 2 /* kernel signals completion */ + __u32 state; /* VFIO_FB_STATE_ */ +}; + /* ***************************************************************** */