drm/nouveau: if requested, try harder at disabling sysmem pushbufs
authorBen Skeggs <bskeggs@redhat.com>
Thu, 11 Aug 2011 22:56:06 +0000 (08:56 +1000)
committerBen Skeggs <bskeggs@redhat.com>
Tue, 20 Sep 2011 06:11:41 +0000 (16:11 +1000)
On >=nv50, userspace would still end up allocating pushbufs in GART.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drivers/gpu/drm/nouveau/nouveau_channel.c

index b0d753f45bbd48da0874df192d999f9bcc27a950..a319d5646ea9c98430eddab17c0a45f0f8307b3f 100644 (file)
@@ -411,13 +411,17 @@ nouveau_ioctl_fifo_alloc(struct drm_device *dev, void *data,
                return ret;
        init->channel  = chan->id;
 
-       if (chan->dma.ib_max)
-               init->pushbuf_domains = NOUVEAU_GEM_DOMAIN_VRAM |
-                                       NOUVEAU_GEM_DOMAIN_GART;
-       else if (chan->pushbuf_bo->bo.mem.mem_type == TTM_PL_VRAM)
+       if (nouveau_vram_pushbuf == 0) {
+               if (chan->dma.ib_max)
+                       init->pushbuf_domains = NOUVEAU_GEM_DOMAIN_VRAM |
+                                               NOUVEAU_GEM_DOMAIN_GART;
+               else if (chan->pushbuf_bo->bo.mem.mem_type == TTM_PL_VRAM)
+                       init->pushbuf_domains = NOUVEAU_GEM_DOMAIN_VRAM;
+               else
+                       init->pushbuf_domains = NOUVEAU_GEM_DOMAIN_GART;
+       } else {
                init->pushbuf_domains = NOUVEAU_GEM_DOMAIN_VRAM;
-       else
-               init->pushbuf_domains = NOUVEAU_GEM_DOMAIN_GART;
+       }
 
        if (dev_priv->card_type < NV_C0) {
                init->subchan[0].handle = NvM2MF;