drm/nv50-nvc0: restrict memtype to those specified at creation time
[deliverable/linux.git] / drivers / gpu / drm / nouveau / nouveau_bo.c
index 931dade12edd99a3c4ded9a1c247f66a81763cdc..cfdecd31f802a5e3bb8b3a3b1a4275f46e6a6018 100644 (file)
@@ -54,8 +54,8 @@ nouveau_bo_del_ttm(struct ttm_buffer_object *bo)
 }
 
 static void
-nouveau_bo_fixup_align(struct nouveau_bo *nvbo, int *align, int *size,
-                      int *page_shift)
+nouveau_bo_fixup_align(struct nouveau_bo *nvbo, u32 flags,
+                      int *align, int *size, int *page_shift)
 {
        struct drm_nouveau_private *dev_priv = nouveau_bdev(nvbo->bo.bdev);
 
@@ -80,7 +80,7 @@ nouveau_bo_fixup_align(struct nouveau_bo *nvbo, int *align, int *size,
                }
        } else {
                if (likely(dev_priv->chan_vm)) {
-                       if (*size > 256 * 1024)
+                       if (!(flags & TTM_PL_FLAG_TT) &&  *size > 256 * 1024)
                                *page_shift = dev_priv->chan_vm->lpg_shift;
                        else
                                *page_shift = dev_priv->chan_vm->spg_shift;
@@ -113,7 +113,7 @@ nouveau_bo_new(struct drm_device *dev, struct nouveau_channel *chan,
        nvbo->tile_flags = tile_flags;
        nvbo->bo.bdev = &dev_priv->ttm.bdev;
 
-       nouveau_bo_fixup_align(nvbo, &align, &size, &page_shift);
+       nouveau_bo_fixup_align(nvbo, flags, &align, &size, &page_shift);
        align >>= PAGE_SHIFT;
 
        if (dev_priv->chan_vm) {
This page took 0.026783 seconds and 5 git commands to generate.