aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/nouveau/nouveau_object.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/nouveau/nouveau_object.c')
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_object.c25
1 files changed, 15 insertions, 10 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_object.c b/drivers/gpu/drm/nouveau/nouveau_object.c
index 960c0ae0c0c3..cc419fae794b 100644
--- a/drivers/gpu/drm/nouveau/nouveau_object.c
+++ b/drivers/gpu/drm/nouveau/nouveau_object.c
@@ -723,14 +723,14 @@ nvc0_gpuobj_channel_init(struct nouveau_channel *chan, struct nouveau_vm *vm)
723 nv_wo32(chan->ramin, 0x020c, 0x000000ff); 723 nv_wo32(chan->ramin, 0x020c, 0x000000ff);
724 724
725 /* map display semaphore buffers into channel's vm */ 725 /* map display semaphore buffers into channel's vm */
726 if (dev_priv->card_type >= NV_D0) 726 for (i = 0; i < dev->mode_config.num_crtc; i++) {
727 return 0; 727 struct nouveau_bo *bo;
728 728 if (dev_priv->card_type >= NV_D0)
729 for (i = 0; i < 2; i++) { 729 bo = nvd0_display_crtc_sema(dev, i);
730 struct nv50_display_crtc *dispc = &nv50_display(dev)->crtc[i]; 730 else
731 731 bo = nv50_display(dev)->crtc[i].sem.bo;
732 ret = nouveau_bo_vma_add(dispc->sem.bo, chan->vm, 732
733 &chan->dispc_vma[i]); 733 ret = nouveau_bo_vma_add(bo, chan->vm, &chan->dispc_vma[i]);
734 if (ret) 734 if (ret)
735 return ret; 735 return ret;
736 } 736 }
@@ -879,9 +879,14 @@ nouveau_gpuobj_channel_takedown(struct nouveau_channel *chan)
879 879
880 NV_DEBUG(dev, "ch%d\n", chan->id); 880 NV_DEBUG(dev, "ch%d\n", chan->id);
881 881
882 if (dev_priv->card_type >= NV_50 && dev_priv->card_type <= NV_C0) { 882 if (dev_priv->card_type >= NV_D0) {
883 for (i = 0; i < dev->mode_config.num_crtc; i++) {
884 struct nouveau_bo *bo = nvd0_display_crtc_sema(dev, i);
885 nouveau_bo_vma_del(bo, &chan->dispc_vma[i]);
886 }
887 } else
888 if (dev_priv->card_type >= NV_50) {
883 struct nv50_display *disp = nv50_display(dev); 889 struct nv50_display *disp = nv50_display(dev);
884
885 for (i = 0; i < dev->mode_config.num_crtc; i++) { 890 for (i = 0; i < dev->mode_config.num_crtc; i++) {
886 struct nv50_display_crtc *dispc = &disp->crtc[i]; 891 struct nv50_display_crtc *dispc = &disp->crtc[i];
887 nouveau_bo_vma_del(dispc->sem.bo, &chan->dispc_vma[i]); 892 nouveau_bo_vma_del(dispc->sem.bo, &chan->dispc_vma[i]);