Thierry Reding
2014-May-19 08:33 UTC
[Nouveau] [PATCH 2/4] drm/ttm: introduce dma cache sync helpers
On Mon, May 19, 2014 at 04:10:56PM +0900, Alexandre Courbot wrote:> From: Lucas Stach <dev at lynxeye.de> > > On arches with non-coherent PCI,I guess since this applies to gk20a> we need to flush caches ourselfes at"ourselves". Or perhaps even reword to something like: "..., caches need to be flushed and invalidated explicitly", since dma_sync_for_cpu() does invalidate rather than flush.> the appropriate places. Introduce two small helpers to make things easy > for TTM based drivers. > > Signed-off-by: Lucas Stach <dev at lynxeye.de> > Signed-off-by: Alexandre Courbot <acourbot at nvidia.com> > --- > drivers/gpu/drm/ttm/ttm_tt.c | 25 +++++++++++++++++++++++++ > include/drm/ttm/ttm_bo_driver.h | 28 ++++++++++++++++++++++++++++ > 2 files changed, 53 insertions(+) > > diff --git a/drivers/gpu/drm/ttm/ttm_tt.c b/drivers/gpu/drm/ttm/ttm_tt.c[...]> +void ttm_dma_tt_cache_sync_for_device(struct ttm_dma_tt *ttm_dma, > + struct device *dev) > +{ > + int i;This should probably be unsigned long to match the type of ttm_dma->ttm.num_pages. Thierry -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 836 bytes Desc: not available URL: <http://lists.freedesktop.org/archives/nouveau/attachments/20140519/ff67b2bc/attachment.sig>
Alexandre Courbot
2014-May-23 05:49 UTC
[Nouveau] [PATCH 2/4] drm/ttm: introduce dma cache sync helpers
On Mon, May 19, 2014 at 5:33 PM, Thierry Reding <thierry.reding at gmail.com> wrote:> On Mon, May 19, 2014 at 04:10:56PM +0900, Alexandre Courbot wrote: >> From: Lucas Stach <dev at lynxeye.de> >> >> On arches with non-coherent PCI, > > I guess since this applies to gk20a > >> we need to flush caches ourselfes at > > "ourselves". Or perhaps even reword to something like: "..., caches need > to be flushed and invalidated explicitly", since dma_sync_for_cpu() does > invalidate rather than flush.Rephrased as "On arches for which access to GPU memory is non-coherent, caches need to be flushed and invalidated explicitly at the appropriate places."> >> the appropriate places. Introduce two small helpers to make things easy >> for TTM based drivers. >> >> Signed-off-by: Lucas Stach <dev at lynxeye.de> >> Signed-off-by: Alexandre Courbot <acourbot at nvidia.com> >> --- >> drivers/gpu/drm/ttm/ttm_tt.c | 25 +++++++++++++++++++++++++ >> include/drm/ttm/ttm_bo_driver.h | 28 ++++++++++++++++++++++++++++ >> 2 files changed, 53 insertions(+) >> >> diff --git a/drivers/gpu/drm/ttm/ttm_tt.c b/drivers/gpu/drm/ttm/ttm_tt.c > [...] >> +void ttm_dma_tt_cache_sync_for_device(struct ttm_dma_tt *ttm_dma, >> + struct device *dev) >> +{ >> + int i; > > This should probably be unsigned long to match the type of > ttm_dma->ttm.num_pages.Fixed. Thanks, Alex.
Thierry Reding
2014-May-23 07:31 UTC
[Nouveau] [PATCH 2/4] drm/ttm: introduce dma cache sync helpers
On Fri, May 23, 2014 at 02:49:40PM +0900, Alexandre Courbot wrote:> On Mon, May 19, 2014 at 5:33 PM, Thierry Reding > <thierry.reding at gmail.com> wrote: > > On Mon, May 19, 2014 at 04:10:56PM +0900, Alexandre Courbot wrote: > >> From: Lucas Stach <dev at lynxeye.de> > >> > >> On arches with non-coherent PCI, > > > > I guess since this applies to gk20a > > > >> we need to flush caches ourselfes at > > > > "ourselves". Or perhaps even reword to something like: "..., caches need > > to be flushed and invalidated explicitly", since dma_sync_for_cpu() does > > invalidate rather than flush. > > Rephrased as "On arches for which access to GPU memory is non-coherent, caches > need to be flushed and invalidated explicitly at the appropriate places."Nit: s/arches/architectures/ Thierry -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 836 bytes Desc: not available URL: <http://lists.freedesktop.org/archives/nouveau/attachments/20140523/c29d6755/attachment-0001.sig>
Possibly Parallel Threads
- [PATCH 2/4] drm/ttm: introduce dma cache sync helpers
- [PATCH 2/4] drm/ttm: introduce dma cache sync helpers
- [PATCH v2 2/3] drm/ttm: introduce dma cache sync helpers
- [PATCH 0/4] drm/ttm: nouveau: memory coherency fixes for ARM
- [PATCH 3/4] drm/nouveau: hook up cache sync functions