drm/nouveau: allocate GPFIFOs and fences coherently
authorAlexandre Courbot <acourbot@nvidia.com>
Mon, 27 Oct 2014 09:49:18 +0000 (18:49 +0900)
committerBen Skeggs <bskeggs@redhat.com>
Tue, 2 Dec 2014 05:43:59 +0000 (15:43 +1000)
Specify TTM_PL_FLAG_UNCACHED when allocating GPFIFOs and fences to
allow them to be safely accessed by the kernel without being synced
on non-coherent architectures.

Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drivers/gpu/drm/nouveau/nouveau_chan.c
drivers/gpu/drm/nouveau/nv84_fence.c

index 77c81d6b45ee2ea34add2ffd102815269fb1c916..0f3da86840f2b6f67f355a91ca44e327027df052 100644 (file)
@@ -102,7 +102,7 @@ nouveau_channel_prep(struct nouveau_drm *drm, struct nvif_device *device,
        chan->drm = drm;
 
        /* allocate memory for dma push buffer */
-       target = TTM_PL_FLAG_TT;
+       target = TTM_PL_FLAG_TT | TTM_PL_FLAG_UNCACHED;
        if (nouveau_vram_pushbuf)
                target = TTM_PL_FLAG_VRAM;
 
index d6c6c87c3f07e2e929e49cf8ca7d41145f8c164b..4d79be7558d8862250ee226b72682b1fe35a0911 100644 (file)
@@ -246,8 +246,8 @@ nv84_fence_create(struct nouveau_drm *drm)
 
        if (ret == 0)
                ret = nouveau_bo_new(drm->dev, 16 * priv->base.contexts, 0,
-                                    TTM_PL_FLAG_TT, 0, 0, NULL, NULL,
-                                    &priv->bo_gart);
+                                    TTM_PL_FLAG_TT | TTM_PL_FLAG_UNCACHED, 0,
+                                    0, NULL, NULL, &priv->bo_gart);
        if (ret == 0) {
                ret = nouveau_bo_pin(priv->bo_gart, TTM_PL_FLAG_TT);
                if (ret == 0) {