All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Wilson <chris@chris-wilson.co.uk>
To: Dave Airlie <airlied@gmail.com>, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 6/7] i915: add dmabuf/prime buffer sharing support.
Date: Tue, 22 May 2012 14:28:54 +0100	[thread overview]
Message-ID: <1337693344_180887@CP5-2952> (raw)
In-Reply-To: <1337691004-13202-6-git-send-email-airlied@gmail.com>

On Tue, 22 May 2012 13:50:03 +0100, Dave Airlie <airlied@gmail.com> wrote:
> From: Daniel Vetter <daniel.vetter@ffwll.ch>
> 
> This adds handle->fd and fd->handle support to i915, this is to allow
> for offloading of rendering in one direction and outputs in the other.
> 
> v2 from Daniel Vetter:
> - fixup conflicts with the prepare/finish gtt prep work.
> - implement ppgtt binding support.
> 
> Note that we have squat i-g-t testcoverage for any of the lifetime and
> access rules dma_buf/prime support brings along. And there are quite a
> few intricate situations here.
> 
> Also note that the integration with the existing code is a bit
> hackish, especially around get_gtt_pages and put_gtt_pages. It imo
> would be easier with the prep code from Chris Wilson's unbound series,
> but that is for 3.6.
> 
> Also note that I didn't bother to put the new prepare/finish gtt hooks
> to good use by moving the dma_buf_map/unmap_attachment calls in there
> (like we've originally planned for).
> 
> Last but not least this patch is only compile-tested, but I've changed
> very little compared to Dave Airlie's version. So there's a decent
> chance v2 on drm-next works as well as v1 on 3.4-rc.
> 
> v3: Right when I've hit sent I've noticed that I've screwed up one
> obj->sg_list (for dmar support) and obj->sg_table (for prime support)
> disdinction. We should be able to merge these 2 paths, but that's
> material for another patch.
> 
> v4: fix the error reporting bugs pointed out by ickle.
> 
> v5: fix another error, and stop non-gtt mmaps on shared objects
> stop pread/pwrite on imported objects, add fake kmap

Everything up to this point looks reasonable wrt i915. We obviously need
to lift a few of the restrictions for i915 introduced here and protect
dma-buf objects from the shrinker/truncate.  In fact we need to add a
guard to i915_gem_object_truncate in this patch to prevent one such
explosion. Wrt to the shrinker and the leak of exported pages, that
should be managed by the unbound page tracking which is queued for
review this cycle (right Daniel? ;). That just leaves fixing up
pread/pwrite and fixing the other guards that will interact sorely with
stolen (also non-shmem backed) objects.
-Chris

> Signed-off-by: Dave Airlie <airlied@redhat.com>
> Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> ---
>  drivers/gpu/drm/i915/Makefile          |    3 +-
>  drivers/gpu/drm/i915/i915_drv.c        |    8 ++-
>  drivers/gpu/drm/i915/i915_drv.h        |   11 ++
>  drivers/gpu/drm/i915/i915_gem.c        |   37 +++++++-
>  drivers/gpu/drm/i915/i915_gem_dmabuf.c |  171 ++++++++++++++++++++++++++++++++
>  drivers/gpu/drm/i915/i915_gem_gtt.c    |   15 +++-
>  6 files changed, 239 insertions(+), 6 deletions(-)
>  create mode 100644 drivers/gpu/drm/i915/i915_gem_dmabuf.c
> 
> diff --git a/drivers/gpu/drm/i915/Makefile b/drivers/gpu/drm/i915/Makefile
> index 0ca7f76..2e9268d 100644
> --- a/drivers/gpu/drm/i915/Makefile
> +++ b/drivers/gpu/drm/i915/Makefile
> @@ -38,7 +38,8 @@ i915-y := i915_drv.o i915_dma.o i915_irq.o \
>  	  dvo_ch7017.o \
>  	  dvo_ivch.o \
>  	  dvo_tfp410.o \
> -	  dvo_sil164.o
> +	  dvo_sil164.o \
> +	  i915_gem_dmabuf.o

Since we need another chunk to this patch, can you please add this file
in the i915_gem_*.c block.

-- 
Chris Wilson, Intel Open Source Technology Centre

  reply	other threads:[~2012-05-22 13:29 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-22 12:49 [PATCH 1/7] drm/prime: introduce sg->pages/addr arrays helper Dave Airlie
2012-05-22 12:49 ` [PATCH 2/7] drm/prime: add exported buffers to current fprivs imported buffer list (v2) Dave Airlie
2012-05-22 12:50 ` [PATCH 3/7] udl: add prime fd->handle support Dave Airlie
2012-05-22 21:11   ` Alex Deucher
2012-05-22 12:50 ` [PATCH 4/7] ttm: add prime sharing support to TTM (v2) Dave Airlie
2012-05-22 20:55   ` Jerome Glisse
2012-05-22 21:09   ` Alex Deucher
2012-05-22 12:50 ` [PATCH 5/7] nouveau: add PRIME support Dave Airlie
2012-05-22 21:13   ` Alex Deucher
2012-05-22 12:50 ` [PATCH 6/7] i915: add dmabuf/prime buffer sharing support Dave Airlie
2012-05-22 13:28   ` Chris Wilson [this message]
2012-05-22 12:50 ` [PATCH 7/7] drm/radeon: add PRIME support (v2) Dave Airlie
2012-05-22 20:56   ` Jerome Glisse
2012-05-22 21:09   ` Alex Deucher
2012-05-22 21:08 ` [PATCH 1/7] drm/prime: introduce sg->pages/addr arrays helper Alex Deucher

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=1337693344_180887@CP5-2952 \
    --to=chris@chris-wilson.co.uk \
    --cc=airlied@gmail.com \
    --cc=dri-devel@lists.freedesktop.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.