Merge branch 'for-linus' of git://oss.sgi.com/xfs/xfs
[pandora-kernel.git] / drivers / gpu / drm / nouveau / nouveau_channel.c
index b0d753f..bb6ec9e 100644 (file)
@@ -158,6 +158,7 @@ nouveau_channel_alloc(struct drm_device *dev, struct nouveau_channel **chan_ret,
        INIT_LIST_HEAD(&chan->nvsw.vbl_wait);
        INIT_LIST_HEAD(&chan->nvsw.flip);
        INIT_LIST_HEAD(&chan->fence.pending);
+       spin_lock_init(&chan->fence.lock);
 
        /* setup channel's memory and vm */
        ret = nouveau_gpuobj_channel_init(chan, vram_handle, gart_handle);
@@ -411,13 +412,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;