linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Gerd Hoffmann <kraxel@redhat.com>
To: Dave Airlie <airlied@gmail.com>
Cc: dri-devel <dri-devel@lists.freedesktop.org>,
	Dave Airlie <airlied@linux.ie>,
	LKML <linux-kernel@vger.kernel.org>,
	"open list:VIRTIO CORE,
	NET..."  <virtualization@lists.linux-foundation.org>
Subject: Re: [PATCH 7/8] drm/virtio: move virtio_gpu_object_{attach, detach} calls.
Date: Thu, 18 Oct 2018 09:00:04 +0200	[thread overview]
Message-ID: <20181018070004.mplea3ozamph6uzu@sirius.home.kraxel.org> (raw)
In-Reply-To: <CAPM=9tzwcPtOfNuoKdbSY0=EBsbsKgM04HZpzAazPEmDbQOXSw@mail.gmail.com>

> > > This to me feels more like a bind/unbind operation rather than a
> > > populate/unpopulate operation,
> > >
> > > bind is " Bind the backend pages into the aperture in the location"
> > >
> > > whereas populate is
> > >
> > > allocate pages for a ttm.
> >
> > I ran into that trap too ;)
> >
> > My first attempt was to map this to bind/unbind.  But this is not
> > correct and therefore didn't work very well.
> >
> > virtio_gpu_object_attach() will send a scatter list of the pages
> > allocated for the object to the host (so the host knows where to
> > copy from/to when processing the transfer_from/to calls).  So IMO
> > it should be done on population not when binding.
> 
> Well bind on AGP is the same thing, we'd fill the AGP GART table on
> bind, so that the AGP GPU could access the pages.

> So I'm interested in why using bind/unbind failed if you have some more info?

Need to try again to be sure, but IIRC I saw multiple bind/unbind calls
for the same object.  ttm probably does it to not waste AGB GART address
space for objects not in use.  But for virtio it is pointless overhead.
But maybe it is just a matter of taking a reference and keeping it for
the whole lifetime of the object to make the binding permanent ...

cheers,
  Gerd


  reply	other threads:[~2018-10-18  7:00 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20181001103222.11924-1-kraxel@redhat.com>
2018-10-01 10:32 ` [PATCH 1/8] drm/virtio: use virtio_gpu_object->hw_res_handle in virtio_gpufb_create() Gerd Hoffmann
2018-10-01 10:32 ` [PATCH 2/8] drm/virtio: use virtio_gpu_object->hw_res_handle in virtio_gpu_mode_dumb_create() Gerd Hoffmann
2018-10-01 10:32 ` [PATCH 3/8] drm/virtio: use virtio_gpu_object->hw_res_handle in virtio_gpu_resource_create_ioctl() Gerd Hoffmann
2018-10-01 10:32 ` [PATCH 4/8] drm/virtio: drop resource_id argument from virtio_gpu_object_attach() Gerd Hoffmann
2018-10-01 10:32 ` [PATCH 5/8] drm/virtio: track created object state Gerd Hoffmann
2018-10-18  1:25   ` Dave Airlie
2018-10-18  5:57     ` Gerd Hoffmann
2018-10-01 10:32 ` [PATCH 6/8] drm/virtio: fix resource id handling Gerd Hoffmann
2018-10-01 10:32 ` [PATCH 7/8] drm/virtio: move virtio_gpu_object_{attach,detach} calls Gerd Hoffmann
2018-10-18  1:41   ` [PATCH 7/8] drm/virtio: move virtio_gpu_object_{attach, detach} calls Dave Airlie
2018-10-18  6:10     ` Gerd Hoffmann
2018-10-18  6:36       ` Dave Airlie
2018-10-18  7:00         ` Gerd Hoffmann [this message]
2018-10-19  0:33           ` Dave Airlie
2018-10-01 10:32 ` [PATCH 8/8] drm/virtio: move objects to TTM_PL_TT after creation Gerd Hoffmann

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=20181018070004.mplea3ozamph6uzu@sirius.home.kraxel.org \
    --to=kraxel@redhat.com \
    --cc=airlied@gmail.com \
    --cc=airlied@linux.ie \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=virtualization@lists.linux-foundation.org \
    /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).