aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_object.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_object.c b/drivers/gpu/drm/nouveau/nouveau_object.c
index 542b451c81f1..fb57c1110d24 100644
--- a/drivers/gpu/drm/nouveau/nouveau_object.c
+++ b/drivers/gpu/drm/nouveau/nouveau_object.c
@@ -870,16 +870,22 @@ void
870nouveau_gpuobj_channel_takedown(struct nouveau_channel *chan) 870nouveau_gpuobj_channel_takedown(struct nouveau_channel *chan)
871{ 871{
872 struct drm_device *dev = chan->dev; 872 struct drm_device *dev = chan->dev;
873 struct drm_nouveau_private *dev_priv = dev->dev_private;
873 int i; 874 int i;
874 875
875 NV_DEBUG(dev, "ch%d\n", chan->id); 876 NV_DEBUG(dev, "ch%d\n", chan->id);
876 877
877 for (i = 0; i < 2; i++) { 878 if (dev_priv->card_type >= NV_50) {
878 struct nv50_display_crtc *dispc = &nv50_display(dev)->crtc[i]; 879 struct nv50_display *disp = nv50_display(dev);
879 nouveau_bo_vma_del(dispc->sem.bo, &chan->dispc_vma[i]); 880
881 for (i = 0; i < 2; i++) {
882 struct nv50_display_crtc *dispc = &disp->crtc[i];
883 nouveau_bo_vma_del(dispc->sem.bo, &chan->dispc_vma[i]);
884 }
885
886 nouveau_vm_ref(NULL, &chan->vm, chan->vm_pd);
887 nouveau_gpuobj_ref(NULL, &chan->vm_pd);
880 } 888 }
881 nouveau_vm_ref(NULL, &chan->vm, chan->vm_pd);
882 nouveau_gpuobj_ref(NULL, &chan->vm_pd);
883 889
884 if (drm_mm_initialized(&chan->ramin_heap)) 890 if (drm_mm_initialized(&chan->ramin_heap))
885 drm_mm_takedown(&chan->ramin_heap); 891 drm_mm_takedown(&chan->ramin_heap);