intel-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Zhi Wang <zhi.a.wang@intel.com>
To: Gerd Hoffmann <kraxel@redhat.com>,
	Alex Williamson <alex.williamson@redhat.com>
Cc: "Wang, Zhenyu Z" <zhenyu.z.wang@intel.com>,
	"intel-gfx@lists.freedesktop.org"
	<intel-gfx@lists.freedesktop.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"Chen, Xiaoguang" <xiaoguang.chen@intel.com>,
	"Zhang, Tina" <tina.zhang@intel.com>,
	Kirti Wankhede <kwankhede@nvidia.com>,
	"Lv, Zhiyuan" <zhiyuan.lv@intel.com>,
	"intel-gvt-dev@lists.freedesktop.org"
	<intel-gvt-dev@lists.freedesktop.org>
Subject: Re: [Intel-gfx] [PATCH v9 5/7] vfio: Define vfio based dma-buf operations
Date: Fri, 23 Jun 2017 15:49:10 +0800	[thread overview]
Message-ID: <594CC7F6.7050507@intel.com> (raw)
In-Reply-To: <1498202819.24807.3.camel@redhat.com>

Hi:
     Thanks for the discussions! If the userspace application has 
already maintained a LRU list, it looks like we don't need generation 
anymore, as userspace application will lookup the guest framebuffer from 
the LRU list by "offset". No matter how, it would know if this is a new 
guest framebuffer or not. If it's a new guest framebuffer, a new dmabuf 
fd should be generated. If it's an old framebuffer, it can just show 
that framebuffer.

Thanks,
Zhi.

On 06/23/17 15:26, Gerd Hoffmann wrote:
>    Hi,
>
>> Is this only going to support accelerated driver output, not basic
>> VGA
>> modes for BIOS interaction?
> Right now there is no vgabios or uefi support for the vgpu.
>
> But even with that in place there still is the problem that the display
> device initialization happens before the guest runs and therefore there
> isn't an plane yet ...
>
>>> Right now the experimental intel patches throw errors in case no
>>> plane
>>> exists (yet).  Maybe we should have a "bool is_enabled" field in
>>> the
>>> plane_info struct, so drivers can use that to signal whenever the
>>> guest
>>> has programmed a valid video mode or not (likewise for the cursor,
>>> which doesn't exist with fbcon, only when running xorg).  With that
>>> in
>>> place using the QUERY_PLANE ioctl also for probing looks
>>> reasonable.
>> Sure, or -ENOTTY for ioctl not implemented vs -EINVAL for no
>> available
>> plane, but then that might not help the user know how a plane would
>> be
>> available if it were available.
> So maybe a "enum plane_state" (instead of "bool is_enabled")?  So we
> can clearly disturgish ENABLED, DISABLED, NOT_SUPPORTED cases?
>
>>> Yes, I'd leave that to userspace.  So, when the generation changes
>>> userspace knows the guest changed the plane.  It could be a
>>> configuration the guest has used before (and where userspace could
>>> have
>>> a cached dma-buf handle for), or it could be something new.
>> But userspace also doesn't know that a dmabuf generation will ever be
>> visited again,
> kernel wouldn't know either, only the guest knows ...
>
>> so they're bound to have some stale descriptors.  Are
>> we thinking userspace would have some LRU list of dmabufs so that
>> they
>> don't collect too many?  Each uses some resources,  do we just rely
>> on
>> open file handles to set an upper limit?
> Yep, this is exactly what my qemu patches are doing, keep a LRU list.
>   
>>>> What happens to
>>>> existing dmabuf fds when the generation updates, do they stop
>>>> refreshing?
>>> Depends on what the guest is doing ;)
>>>
>>> The dma-buf is just a host-side handle for the piece of video
>>> memory
>>> where the guest stored the framebuffer.
>> So the resources the user is holding if they don't release their
>> dmabuf
>> are potentially non-trivial.
> Not really.  Host IGD has a certain amount of memory, some of it is
> assigned to the guest, guest stores the framebuffer there, the dma-buf
> is a host handle (drm object, usable for rendering ops) for the guest
> framebuffer.  So it doesn't use much ressources.  Some memory is needed
> for management structs, but not for the actual data as this in the
> video memory dedicated to the guest.
>
>>> Ok, if we want support multiple regions.  Do we?  Using the offset
>>> we
>>> can place multiple planes in a single region.  And I'm not sure
>>> nvidia
>>> plans to use multiple planes in the first place ...
>> I don't want to take a driver ioctl interface as a throw away, one
>> time
>> use exercise.  If we can think of such questions now, let's define
>> how
>> they work.  A device could have multiple graphics regions with
>> multiple
>> planes within each region.
> I'd suggest to settle for one of these two.  Either one region and
> multiple planes inside (using offset) or one region per plane.  I'd
> prefer the former.  When going for the latter then yes we have to
> specify the region.  I'd name the field region_id then to make clear
> what it is.
>
> What would be the use case for multiple planes?
>
> cursor support?  We already have plane_type for that.
>
> multihead support?  We'll need (at minimum) a head_id field for that
> (for both dma-buf and region)
>
> pageflipping support?  Nothing needed, query_plane will simply return
> the currently visible plane.  Region only needs to be big enough to fit
> the framebuffer twice.  Then the driver can flip between two buffers,
> point to the one qemu should display using "offset".
>
>> Do we also want to exclude that device
>> needs to be strictly region or dmabuf?  Maybe it does both.
> Very unlikely IMHO.
>
>> Or maybe
>> it supports dmabuf-ng (ie. whatever comes next).
> Possibly happens some day, but who knows what interfaces we'll need to
> support that ...
>
>>> vfio_device_query {
>>>      u32 argsz;
>>>      u32 flags;
>>>      enum query_type;  /* or use flags for that */
>> We don't have an infinite number of ioctls
> The limited ioctl number space is a good reason indeed.
> Ok, lets take this route then.
>
> cheers,
>    Gerd
>
> _______________________________________________
> intel-gvt-dev mailing list
> intel-gvt-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gvt-dev

  reply	other threads:[~2017-06-23  7:49 UTC|newest]

Thread overview: 56+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-15  8:00 [PATCH v9 0/7] drm/i915/gvt: Dma-buf support for GVT-g Xiaoguang Chen
2017-06-15  8:00 ` [PATCH v9 1/7] drm/i915/gvt: Extend the GVT-g architecture Xiaoguang Chen
2017-06-15  8:00 ` [PATCH v9 2/7] drm/i915/gvt: OpRegion support for GVT-g Xiaoguang Chen
2017-06-15  8:00 ` [PATCH v9 3/7] drm: Extend the drm format Xiaoguang Chen
2017-06-15 10:21   ` Ville Syrjälä
2017-06-20  9:01     ` [Intel-gfx] " Zhang, Tina
2017-06-15  8:00 ` [PATCH v9 4/7] drm/i915/gvt: Frame buffer decoder support for GVT-g Xiaoguang Chen
2017-06-15  8:00 ` [PATCH v9 5/7] vfio: Define vfio based dma-buf operations Xiaoguang Chen
2017-06-15 14:51   ` Kirti Wankhede
2017-06-15 16:00     ` Gerd Hoffmann
2017-06-15 20:38       ` Alex Williamson
2017-06-16 10:24         ` Gerd Hoffmann
2017-06-16 12:52           ` Alex Williamson
2017-06-16 13:32         ` Kirti Wankhede
2017-06-16 16:39           ` Alex Williamson
2017-06-16 18:28             ` Kirti Wankhede
2017-06-19  6:34             ` Gerd Hoffmann
2017-06-19 14:54               ` Alex Williamson
2017-06-20  8:35                 ` Gerd Hoffmann
2017-06-20 13:55                   ` Kirti Wankhede
2017-06-21  7:22                     ` Gerd Hoffmann
2017-07-12 13:18                       ` Kirti Wankhede
2017-07-14  9:58                         ` Gerd Hoffmann
2017-06-19  6:38           ` Gerd Hoffmann
2017-06-19 14:55             ` Alex Williamson
2017-06-20  8:41               ` Zhang, Tina
2017-06-20 10:57                 ` Gerd Hoffmann
2017-06-20 15:00                   ` [Intel-gfx] " Alex Williamson
2017-06-20 17:07                     ` Kirti Wankhede
2017-06-20 23:01                     ` Zhang, Tina
2017-06-20 23:22                       ` Alex Williamson
2017-06-21  9:20                         ` Zhang, Tina
2017-06-21 11:03                           ` [Intel-gfx] " Gerd Hoffmann
2017-06-21 18:59                             ` Alex Williamson
2017-06-22  8:30                               ` Gerd Hoffmann
2017-06-22 18:54                                 ` Alex Williamson
2017-06-23  7:26                                   ` Gerd Hoffmann
2017-06-23  7:49                                     ` Zhi Wang [this message]
2017-06-23  8:31                                       ` [Intel-gfx] " Gerd Hoffmann
2017-06-23 16:40                                         ` Alex Williamson
2017-06-23 17:15                                     ` Alex Williamson
2017-06-26  6:17                                       ` Gerd Hoffmann
2017-06-22  0:21                             ` Zhang, Tina
2017-06-21  7:34                     ` Gerd Hoffmann
2017-06-23 21:58                   ` Zhang, Tina
2017-06-26  6:39                     ` Gerd Hoffmann
2017-06-26 17:28                       ` Alex Williamson
2017-06-27  6:12                         ` Gerd Hoffmann
2017-06-28 12:48                           ` Zhang, Tina
2017-06-29  6:41                             ` Gerd Hoffmann
2017-06-29  8:39                               ` Daniel Vetter
2017-07-04  0:47                                 ` Zhang, Tina
2017-06-20 13:35               ` Kirti Wankhede
2017-06-15  8:00 ` [PATCH v9 6/7] drm/i915/gvt: Dmabuf support for GVT-g Xiaoguang Chen
2017-06-15  8:00 ` [PATCH v9 7/7] drm/i915/gvt: Adding user interface for dma-buf Xiaoguang Chen
2017-06-15  8:03 ` ✗ Fi.CI.BAT: failure for drm/i915/gvt: dma-buf support for GVT-g (rev9) Patchwork

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=594CC7F6.7050507@intel.com \
    --to=zhi.a.wang@intel.com \
    --cc=alex.williamson@redhat.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=intel-gvt-dev@lists.freedesktop.org \
    --cc=kraxel@redhat.com \
    --cc=kwankhede@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tina.zhang@intel.com \
    --cc=xiaoguang.chen@intel.com \
    --cc=zhenyu.z.wang@intel.com \
    --cc=zhiyuan.lv@intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).