summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLucas Stach <dev@lynxeye.de>2013-08-28 00:03:01 +0200
committerLucas Stach <dev@lynxeye.de>2014-05-09 21:15:02 +0200
commit501d8a1956393b730bed2ffc467930621038854a (patch)
tree9e956f77309d3932bfd07185feeaafbde750af83
parentf740323e3f08daefb4557553138c8e6a8120a241 (diff)
downloadlinux-501d8a1956393b730bed2ffc467930621038854a.tar.gz
linux-501d8a1956393b730bed2ffc467930621038854a.tar.xz
drm/nouveau: hook up cache sync functions
Signed-off-by: Lucas Stach <dev@lynxeye.de>
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_bo.c4
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_gem.c5
2 files changed, 9 insertions, 0 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_bo.c b/drivers/gpu/drm/nouveau/nouveau_bo.c
index b6dc85c614be..99cc471055c4 100644
--- a/drivers/gpu/drm/nouveau/nouveau_bo.c
+++ b/drivers/gpu/drm/nouveau/nouveau_bo.c
@@ -407,6 +407,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/drm/nouveau/nouveau_gem.c
index c90c0dc0afe8..93e74d0dc3a0 100644
--- a/drivers/gpu/drm/nouveau/nouveau_gem.c
+++ b/drivers/gpu/drm/nouveau/nouveau_gem.c
@@ -897,6 +897,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)
+ ttm_dma_tt_cache_sync_for_cpu((struct ttm_dma_tt *)nvbo->bo.ttm,
+ &dev->pdev->dev);
+
return ret;
}