drm/nouveau: fix bug causing pinned buffers to lose their NO_EVICT flag
authorBen Skeggs <bskeggs@redhat.com>
Wed, 16 Dec 2009 06:22:42 +0000 (16:22 +1000)
committerBen Skeggs <bskeggs@redhat.com>
Wed, 16 Dec 2009 07:06:13 +0000 (17:06 +1000)
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drivers/gpu/drm/nouveau/nouveau_bo.c

index 2f5d470..0cad6d8 100644 (file)
@@ -154,6 +154,11 @@ nouveau_bo_placement_set(struct nouveau_bo *nvbo, uint32_t memtype)
        nvbo->placement.busy_placement = nvbo->placements;
        nvbo->placement.num_placement = n;
        nvbo->placement.num_busy_placement = n;
+
+       if (nvbo->pin_refcnt) {
+               while (n--)
+                       nvbo->placements[n] |= TTM_PL_FLAG_NO_EVICT;
+       }
 }
 
 int