aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/nouveau/nouveau_channel.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/nouveau/nouveau_channel.c')
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_channel.c22
1 files changed, 1 insertions, 21 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_channel.c b/drivers/gpu/drm/nouveau/nouveau_channel.c
index 3e49babd62ac..a3d33a582a98 100644
--- a/drivers/gpu/drm/nouveau/nouveau_channel.c
+++ b/drivers/gpu/drm/nouveau/nouveau_channel.c
@@ -113,7 +113,7 @@ nouveau_channel_alloc(struct drm_device *dev, struct nouveau_channel **chan_ret,
113 struct nouveau_fifo_engine *pfifo = &dev_priv->engine.fifo; 113 struct nouveau_fifo_engine *pfifo = &dev_priv->engine.fifo;
114 struct nouveau_channel *chan; 114 struct nouveau_channel *chan;
115 unsigned long flags; 115 unsigned long flags;
116 int user, ret; 116 int ret;
117 117
118 /* allocate and lock channel structure */ 118 /* allocate and lock channel structure */
119 chan = kzalloc(sizeof(*chan), GFP_KERNEL); 119 chan = kzalloc(sizeof(*chan), GFP_KERNEL);
@@ -160,23 +160,6 @@ nouveau_channel_alloc(struct drm_device *dev, struct nouveau_channel **chan_ret,
160 } 160 }
161 161
162 nouveau_dma_pre_init(chan); 162 nouveau_dma_pre_init(chan);
163
164 /* Locate channel's user control regs */
165 if (dev_priv->card_type < NV_40)
166 user = NV03_USER(chan->id);
167 else
168 if (dev_priv->card_type < NV_50)
169 user = NV40_USER(chan->id);
170 else
171 user = NV50_USER(chan->id);
172
173 chan->user = ioremap(pci_resource_start(dev->pdev, 0) + user,
174 PAGE_SIZE);
175 if (!chan->user) {
176 NV_ERROR(dev, "ioremap of regs failed.\n");
177 nouveau_channel_put(&chan);
178 return -ENOMEM;
179 }
180 chan->user_put = 0x40; 163 chan->user_put = 0x40;
181 chan->user_get = 0x44; 164 chan->user_get = 0x44;
182 165
@@ -356,9 +339,6 @@ nouveau_channel_del(struct kref *ref)
356 struct nouveau_channel *chan = 339 struct nouveau_channel *chan =
357 container_of(ref, struct nouveau_channel, ref); 340 container_of(ref, struct nouveau_channel, ref);
358 341
359 if (chan->user)
360 iounmap(chan->user);
361
362 kfree(chan); 342 kfree(chan);
363} 343}
364 344