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.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_channel.c b/drivers/gpu/drm/nouveau/nouveau_channel.c
index fd4d9513585e..285fde8ed3e3 100644
--- a/drivers/gpu/drm/nouveau/nouveau_channel.c
+++ b/drivers/gpu/drm/nouveau/nouveau_channel.c
@@ -124,9 +124,9 @@ nouveau_channel_alloc(struct drm_device *dev, struct nouveau_channel **chan_ret,
124 struct drm_file *file_priv, 124 struct drm_file *file_priv,
125 uint32_t vram_handle, uint32_t gart_handle) 125 uint32_t vram_handle, uint32_t gart_handle)
126{ 126{
127 struct nouveau_exec_engine *fence = nv_engine(dev, NVOBJ_ENGINE_FENCE);
128 struct nouveau_fifo_priv *pfifo = nv_engine(dev, NVOBJ_ENGINE_FIFO);
129 struct drm_nouveau_private *dev_priv = dev->dev_private; 127 struct drm_nouveau_private *dev_priv = dev->dev_private;
128 struct nouveau_fifo_priv *pfifo = nv_engine(dev, NVOBJ_ENGINE_FIFO);
129 struct nouveau_fence_priv *fence = dev_priv->fence.func;
130 struct nouveau_fpriv *fpriv = nouveau_fpriv(file_priv); 130 struct nouveau_fpriv *fpriv = nouveau_fpriv(file_priv);
131 struct nouveau_channel *chan; 131 struct nouveau_channel *chan;
132 unsigned long flags; 132 unsigned long flags;
@@ -234,7 +234,7 @@ nouveau_channel_alloc(struct drm_device *dev, struct nouveau_channel **chan_ret,
234 234
235 FIRE_RING(chan); 235 FIRE_RING(chan);
236 236
237 ret = fence->context_new(chan, NVOBJ_ENGINE_FENCE); 237 ret = fence->context_new(chan);
238 if (ret) { 238 if (ret) {
239 nouveau_channel_put(&chan); 239 nouveau_channel_put(&chan);
240 return ret; 240 return ret;
@@ -289,6 +289,7 @@ nouveau_channel_put_unlocked(struct nouveau_channel **pchan)
289 struct nouveau_channel *chan = *pchan; 289 struct nouveau_channel *chan = *pchan;
290 struct drm_device *dev = chan->dev; 290 struct drm_device *dev = chan->dev;
291 struct drm_nouveau_private *dev_priv = dev->dev_private; 291 struct drm_nouveau_private *dev_priv = dev->dev_private;
292 struct nouveau_fence_priv *fence = dev_priv->fence.func;
292 unsigned long flags; 293 unsigned long flags;
293 int i; 294 int i;
294 295
@@ -311,6 +312,9 @@ nouveau_channel_put_unlocked(struct nouveau_channel **pchan)
311 dev_priv->eng[i]->context_del(chan, i); 312 dev_priv->eng[i]->context_del(chan, i);
312 } 313 }
313 314
315 if (chan->fence)
316 fence->context_del(chan);
317
314 /* aside from its resources, the channel should now be dead, 318 /* aside from its resources, the channel should now be dead,
315 * remove it from the channel list 319 * remove it from the channel list
316 */ 320 */