From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755169AbdEKIpK (ORCPT ); Thu, 11 May 2017 04:45:10 -0400 Received: from mga07.intel.com ([134.134.136.100]:17632 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754796AbdEKIpJ (ORCPT ); Thu, 11 May 2017 04:45:09 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.38,323,1491289200"; d="scan'208";a="1146536417" From: "Chen, Xiaoguang" To: Alex Williamson , Gerd Hoffmann CC: "Tian, Kevin" , "intel-gfx@lists.freedesktop.org" , "linux-kernel@vger.kernel.org" , "zhenyuw@linux.intel.com" , "Lv, Zhiyuan" , "intel-gvt-dev@lists.freedesktop.org" , "Wang, Zhi A" Subject: RE: [RFC PATCH 6/6] drm/i915/gvt: support QEMU getting the dmabuf Thread-Topic: [RFC PATCH 6/6] drm/i915/gvt: support QEMU getting the dmabuf Thread-Index: AQHSwAN47y043l0J90m8wsAsHWts2aHgTQ8AgAGNjMCAAazCQIAAU9qAgAD30YCAAIqCgIAJhcZQ Date: Thu, 11 May 2017 08:45:03 +0000 Message-ID: References: <1493372130-27727-1-git-send-email-xiaoguang.chen@intel.com> <1493372130-27727-7-git-send-email-xiaoguang.chen@intel.com> <1493718658.8581.82.camel@redhat.com> <20170504100833.199bc8ba@t450s.home> <1493967331.371.53.camel@redhat.com> <20170505091115.7a680636@t450s.home> In-Reply-To: <20170505091115.7a680636@t450s.home> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 10.0.102.7 dlp-reaction: no-action 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 v4B8jLVI023496 Hi Alex, >-----Original Message----- >From: intel-gvt-dev [mailto:intel-gvt-dev-bounces@lists.freedesktop.org] On >Behalf Of Alex Williamson >Sent: Friday, May 05, 2017 11:11 PM >To: Gerd Hoffmann >Cc: Tian, Kevin ; intel-gfx@lists.freedesktop.org; linux- >kernel@vger.kernel.org; zhenyuw@linux.intel.com; Lv, Zhiyuan >; Chen, Xiaoguang ; intel- >gvt-dev@lists.freedesktop.org; Wang, Zhi A >Subject: Re: [RFC PATCH 6/6] drm/i915/gvt: support QEMU getting the dmabuf > >On Fri, 05 May 2017 08:55:31 +0200 >Gerd Hoffmann wrote: > >> Hi, >> >> > > >>Hmm, that looks like a rather strange way to return a file descriptor. >> > > >> >> > > >>What is the reason to not use ioctls on the vfio file handle, like >> > > >>older version of these patches did? >> > > >If I understood correctly that Alex prefer not to change the >> > > >ioctls on the vfio file handle like the old version. >> > > >So I used this way the smallest change to general vfio framework >> > > >only adding a subregion definition. >> > >> > I think I was hoping we could avoid a separate file descriptor >> > altogether and use a vfio region instead. >> >> What exactly did you have in mind? Put the framebuffer information >> (struct intel_vgpu_dmabuf) into the vfio region, then access it using >> read/write/mmap? > >Yeah, that was my hope. Adding a new file descriptor means we have one more >reference floating around complicating the life cycle of the device, group, and >container. Furthermore this one is really only visible to the mdev vendor driver, >so we can't rely on vfio-core, the vendor driver will need to consider the >reference when releasing the device. While read the framebuffer region we have to tell the vendor driver which framebuffer we want to read? There are two framebuffers now in KVMGT that is primary and cursor. There are two methods to implement this: 1) write the plane id first and then read the framebuffer. 2) create 2 vfio regions one for primary and one for cursor. Which method do you prefer? Or do you have other idea to handle this problem? chenxg