From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Lucas Stach <dev@lynxeye.de>
Cc: nouveau@lists.freedesktop.org, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 3/6] drm/nouveau: hook up cache sync functions
Date: Wed, 28 Aug 2013 14:21:38 -0400 [thread overview]
Message-ID: <20130828182138.GB27939@phenom.dumpdata.com> (raw)
In-Reply-To: <1377709117.1733.3.camel@tellur>
On Wed, Aug 28, 2013 at 06:58:37PM +0200, Lucas Stach wrote:
> Am Mittwoch, den 28.08.2013, 12:43 -0400 schrieb Konrad Rzeszutek Wilk:
> > On Wed, Aug 28, 2013 at 02:00:47AM +0200, Lucas Stach wrote:
> > > Signed-off-by: Lucas Stach <dev@lynxeye.de>
> > > ---
> > > drivers/gpu/drm/nouveau/nouveau_bo.c | 4 ++++
> > > drivers/gpu/drm/nouveau/nouveau_gem.c | 5 +++++
> > > 2 files changed, 9 insertions(+)
> > >
> > > diff --git a/drivers/gpu/drm/nouveau/nouveau_bo.c b/drivers/gpu/drm/nouveau/nouveau_bo.c
> > > index af20fba..f4a2eb9 100644
> > > --- a/drivers/gpu/drm/nouveau/nouveau_bo.c
> > > +++ b/drivers/gpu/drm/nouveau/nouveau_bo.c
> > > @@ -411,6 +411,10 @@ nouveau_bo_validate(struct nouveau_bo *nvbo, bool interruptible,
> > > {
> > > int ret;
> > >
> > > + if (nvbo->bo.ttm && nvbo->bo.ttm->caching_state == tt_cached)
> >
> > You don't want to do it also for tt_wc ?
> >
> No the point of using writecombined memory for BOs is to explicitly
> avoid the need for this cache sync. An uncached MMIO read from the
> device should already flush out all writecombining buffers and this read
> is always happening when submitting a pushbuf.
Could you include this explanation in the git commit description please?
>
> > > + ttm_dma_tt_cache_sync_for_device((struct ttm_dma_tt *)nvbo->bo.ttm,
> > > + &nouveau_bdev(nvbo->bo.ttm->bdev)->dev->pdev->dev);
> > > +
> > > ret = ttm_bo_validate(&nvbo->bo, &nvbo->placement,
> > > interruptible, no_wait_gpu);
> > > if (ret)
> > > diff --git a/drivers/gpu/drm/nouveau/nouveau_gem.c b/drivers/gpu/drm/nouveau/nouveau_gem.c
> > > index 830cb7b..f632b92 100644
> > > --- a/drivers/gpu/drm/nouveau/nouveau_gem.c
> > > +++ b/drivers/gpu/drm/nouveau/nouveau_gem.c
> > > @@ -901,6 +901,11 @@ nouveau_gem_ioctl_cpu_prep(struct drm_device *dev, void *data,
> > > ret = ttm_bo_wait(&nvbo->bo, true, true, no_wait);
> > > spin_unlock(&nvbo->bo.bdev->fence_lock);
> > > drm_gem_object_unreference_unlocked(gem);
> > > +
> > > + if (!ret && nvbo->bo.ttm && nvbo->bo.ttm->caching_state == tt_cached)
> >
> > Ditto?
> cpu_prep is used to make the kernel aware of a following userspace read.
> Writecombined mappings are essentially uncached from the read
> perspective.
>
> >
> > > + ttm_dma_tt_cache_sync_for_cpu((struct ttm_dma_tt *)nvbo->bo.ttm,
> > > + &dev->pdev->dev);
> > > +
> > > return ret;
> > > }
> > >
> > > --
> > > 1.8.3.1
> > >
> > > _______________________________________________
> > > dri-devel mailing list
> > > dri-devel@lists.freedesktop.org
> > > http://lists.freedesktop.org/mailman/listinfo/dri-devel
>
>
next prev parent reply other threads:[~2013-08-28 18:21 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-28 0:00 [PATCH 0/6] Nouveau on ARM fixes Lucas Stach
2013-08-28 0:00 ` [PATCH 1/6] drm/ttm: recognize ARM arch in ioprot handler Lucas Stach
2013-08-28 0:00 ` [PATCH 2/6] drm/ttm: introduce dma cache sync helpers Lucas Stach
[not found] ` <1377648050-6649-1-git-send-email-dev-8ppwABl0HbeELgA04lAiVw@public.gmane.org>
2013-08-28 0:00 ` [PATCH 3/6] drm/nouveau: hook up cache sync functions Lucas Stach
2013-08-28 16:43 ` Konrad Rzeszutek Wilk
[not found] ` <20130828164357.GB27172-6K5HmflnPlqSPmnEAIUT9EEOCMrvLtNR@public.gmane.org>
2013-08-28 16:58 ` Lucas Stach
2013-08-28 18:21 ` Konrad Rzeszutek Wilk [this message]
2013-08-28 0:00 ` [PATCH 6/6] drm/nouveau: use MSI interrupts Lucas Stach
[not found] ` <1377648050-6649-7-git-send-email-dev-8ppwABl0HbeELgA04lAiVw@public.gmane.org>
2013-08-28 7:09 ` Ben Skeggs
2013-08-28 7:28 ` Lucas Stach
2013-08-28 13:54 ` Ilia Mirkin
2013-08-29 0:07 ` Ben Skeggs
[not found] ` <CACAvsv7Ew+0icWEq6ixdtP9Vpux4zeWjV5Lpih94YZWgs_jx4A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-08-29 2:20 ` Ilia Mirkin
2013-08-29 4:45 ` Ben Skeggs
2013-08-29 5:00 ` Ilia Mirkin
2013-08-29 5:07 ` Ben Skeggs
[not found] ` <CACAvsv4AZo-B3MtTh3oN946YAC=vPiR=S3TsEg7R2-hEma57tg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-08-30 1:10 ` Ilia Mirkin
2013-08-30 1:58 ` Ben Skeggs
2013-08-30 2:00 ` Ben Skeggs
[not found] ` <CACAvsv5f3vfP1Fs41N=L8Sc_ih32_h5Vz44mjMTJ-WXH9mDe0A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-08-30 2:01 ` Ilia Mirkin
2013-08-30 5:36 ` Ben Skeggs
2013-08-30 7:11 ` Lucas Stach
2013-09-04 1:45 ` Ben Skeggs
2013-09-30 17:27 ` [Nouveau] " Peter Hurley
[not found] ` <5249B494.5020500-WaGBZJeGNqdsbIuE7sb01tBPR1lH4CV8@public.gmane.org>
2013-10-01 17:32 ` Peter Hurley
2013-08-28 16:08 ` Konrad Rzeszutek Wilk
2013-08-28 0:00 ` [PATCH 4/6] drm/nouveau: introduce NOUVEAU_GEM_TILE_WCUS Lucas Stach
2013-08-28 7:11 ` Ben Skeggs
2013-08-28 7:39 ` Lucas Stach
2013-08-28 0:00 ` [PATCH 5/6] drm/nouveau: map IB write-combined Lucas Stach
2013-08-28 7:50 ` [PATCH 0/6] Nouveau on ARM fixes Thierry Reding
2013-08-28 8:09 ` Ben Skeggs
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=20130828182138.GB27939@phenom.dumpdata.com \
--to=konrad.wilk@oracle.com \
--cc=dev@lynxeye.de \
--cc=dri-devel@lists.freedesktop.org \
--cc=nouveau@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.