diff options
Diffstat (limited to 'drivers/gpu/drm/nouveau/nouveau_channel.c')
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_channel.c | 24 |
1 files changed, 6 insertions, 18 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_channel.c b/drivers/gpu/drm/nouveau/nouveau_channel.c index 0e2414b0ae50..9a051fafa7c3 100644 --- a/drivers/gpu/drm/nouveau/nouveau_channel.c +++ b/drivers/gpu/drm/nouveau/nouveau_channel.c | |||
@@ -313,32 +313,20 @@ nouveau_channel_put(struct nouveau_channel **pchan) | |||
313 | /* boot it off the hardware */ | 313 | /* boot it off the hardware */ |
314 | pfifo->reassign(dev, false); | 314 | pfifo->reassign(dev, false); |
315 | 315 | ||
316 | /* We want to give pgraph a chance to idle and get rid of all potential | 316 | /* We want to give pgraph a chance to idle and get rid of all |
317 | * errors. We need to do this before the lock, otherwise the irq handler | 317 | * potential errors. We need to do this without the context |
318 | * is unable to process them. | 318 | * switch lock held, otherwise the irq handler is unable to |
319 | * process them. | ||
319 | */ | 320 | */ |
320 | if (pgraph->channel(dev) == chan) | 321 | if (pgraph->channel(dev) == chan) |
321 | nouveau_wait_for_idle(dev); | 322 | nouveau_wait_for_idle(dev); |
322 | 323 | ||
323 | spin_lock_irqsave(&dev_priv->context_switch_lock, flags); | 324 | /* destroy the engine specific contexts */ |
324 | |||
325 | pgraph->fifo_access(dev, false); | ||
326 | if (pgraph->channel(dev) == chan) | ||
327 | pgraph->unload_context(dev); | ||
328 | pgraph->destroy_context(chan); | ||
329 | pgraph->fifo_access(dev, true); | ||
330 | |||
331 | if (pfifo->channel_id(dev) == chan->id) { | ||
332 | pfifo->disable(dev); | ||
333 | pfifo->unload_context(dev); | ||
334 | pfifo->enable(dev); | ||
335 | } | ||
336 | pfifo->destroy_context(chan); | 325 | pfifo->destroy_context(chan); |
326 | pgraph->destroy_context(chan); | ||
337 | 327 | ||
338 | pfifo->reassign(dev, true); | 328 | pfifo->reassign(dev, true); |
339 | 329 | ||
340 | spin_unlock_irqrestore(&dev_priv->context_switch_lock, flags); | ||
341 | |||
342 | /* aside from its resources, the channel should now be dead, | 330 | /* aside from its resources, the channel should now be dead, |
343 | * remove it from the channel list | 331 | * remove it from the channel list |
344 | */ | 332 | */ |