Displaying 11 results from an estimated 11 matches for "ttm_dma_tt_cache_sync_for_device".
2014 May 19
0
[PATCH 2/4] drm/ttm: introduce dma cache sync helpers
...>
#include <linux/export.h>
+#include <linux/dma-mapping.h>
#include <drm/drm_cache.h>
#include <drm/drm_mem_util.h>
#include <drm/ttm/ttm_module.h>
@@ -248,6 +249,30 @@ void ttm_dma_tt_fini(struct ttm_dma_tt *ttm_dma)
}
EXPORT_SYMBOL(ttm_dma_tt_fini);
+void ttm_dma_tt_cache_sync_for_device(struct ttm_dma_tt *ttm_dma,
+ struct device *dev)
+{
+ int i;
+
+ for (i = 0; i < ttm_dma->ttm.num_pages; i++) {
+ dma_sync_single_for_device(dev, ttm_dma->dma_address[i],
+ PAGE_SIZE, DMA_TO_DEVICE);
+ }
+}
+EXPORT_SYMBOL(ttm_dma_tt_cache_sync_for_device);
+
+void ttm_dma...
2014 Jun 24
0
[PATCH v2 2/3] drm/ttm: introduce dma cache sync helpers
...>
#include <linux/export.h>
+#include <linux/dma-mapping.h>
#include <drm/drm_cache.h>
#include <drm/drm_mem_util.h>
#include <drm/ttm/ttm_module.h>
@@ -248,6 +249,30 @@ void ttm_dma_tt_fini(struct ttm_dma_tt *ttm_dma)
}
EXPORT_SYMBOL(ttm_dma_tt_fini);
+void ttm_dma_tt_cache_sync_for_device(struct ttm_dma_tt *ttm_dma,
+ struct device *dev)
+{
+ unsigned long i;
+
+ for (i = 0; i < ttm_dma->ttm.num_pages; i++) {
+ dma_sync_single_for_device(dev, ttm_dma->dma_address[i],
+ PAGE_SIZE, DMA_TO_DEVICE);
+ }
+}
+EXPORT_SYMBOL(ttm_dma_tt_cache_sync_for_device);
+
+vo...
2014 Jun 24
4
[PATCH v2 0/3] drm/ttm: nouveau: memory coherency for ARM
For this v2 I have fixed the patches that are non-controversial (all Lucas' :))
and am resubmitting them in the hope that they will get merged. This will
just leave the issue of Nouveau system-memory buffers mapping to be solved.
This issue is quite complex, so let me summarize the situation and the data
I have at hand. ARM caching is like a quantum world where Murphy's law
constantly
2014 May 19
8
[PATCH 0/4] drm/ttm: nouveau: memory coherency fixes for ARM
This small series introduces TTM helper functions as well as Nouveau hooks that
are needed to ensure buffer coherency on ARM. Most of this series is a
forward-port of some patches Lucas Stach sent last year and that are also
needed for Nouveau GK20A support:
http://lists.freedesktop.org/archives/nouveau/2013-August/014026.html
Another patch takes care of flushing the CPU write-buffer when
2013 Aug 28
2
[PATCH 3/6] drm/nouveau: hook up cache sync functions
...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 ?
> + 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/...
2013 Aug 28
11
[PATCH 0/6] Nouveau on ARM fixes
This is the first set of patches to make Nouveau work
on Tegra. Those are only the obvious correctness fixes,
a lot of optimization work remains to be done, but at least
it's enough to get accel working and let the machine survive
a piglit run.
A new BO flag is introduced to allow userspace to hint the
kernel about possible optimizations.
Lucas Stach (6):
drm/ttm: recognize ARM arch in
2014 May 19
2
[PATCH 2/4] drm/ttm: introduce dma cache sync helpers
....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/p...
2013 Aug 28
0
[PATCH 3/6] drm/nouveau: hook up cache sync functions
...o 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.
> > + 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 --...
2013 Aug 28
0
[PATCH 3/6] drm/nouveau: hook up cache sync functions
...dex 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)
+ 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/dr...
2014 May 23
0
[PATCH 2/4] drm/ttm: introduce dma cache sync helpers
...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.
2014 May 19
0
[PATCH 3/4] drm/nouveau: hook up cache sync functions
...nv_device_base(device));
+}
+
+void
+nouveau_bo_sync_for_device(struct nouveau_bo *nvbo)
+{
+ struct ttm_tt *ttm = nvbo->bo.ttm;
+
+ if (ttm && ttm->caching_state == tt_cached) {
+ struct nouveau_device *device;
+
+ device = nouveau_dev(nouveau_bdev(ttm->bdev)->dev);
+
+ ttm_dma_tt_cache_sync_for_device((struct ttm_dma_tt *)ttm,
+ nv_device_base(device));
+ }
+}
+#endif
+
static int
nouveau_bo_init_mem_type(struct ttm_bo_device *bdev, uint32_t type,
struct ttm_mem_type_manager *man)
diff --git a/drivers/gpu/drm/nouveau/nouveau_bo.h b/drivers/gpu/drm/nouveau/nouveau_bo.h
index ff17c1f4...