diff options
Diffstat (limited to 'drivers/gpu/drm/nouveau/nouveau_chan.c')
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_chan.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_chan.c b/drivers/gpu/drm/nouveau/nouveau_chan.c index c1d7301c0e9c..174300b6a02e 100644 --- a/drivers/gpu/drm/nouveau/nouveau_chan.c +++ b/drivers/gpu/drm/nouveau/nouveau_chan.c | |||
@@ -76,6 +76,8 @@ nouveau_channel_del(struct nouveau_channel **pchan) | |||
76 | nouveau_object_del(client, NVDRM_DEVICE, chan->push.handle); | 76 | nouveau_object_del(client, NVDRM_DEVICE, chan->push.handle); |
77 | nouveau_bo_vma_del(chan->push.buffer, &chan->push.vma); | 77 | nouveau_bo_vma_del(chan->push.buffer, &chan->push.vma); |
78 | nouveau_bo_unmap(chan->push.buffer); | 78 | nouveau_bo_unmap(chan->push.buffer); |
79 | if (chan->push.buffer && chan->push.buffer->pin_refcnt) | ||
80 | nouveau_bo_unpin(chan->push.buffer); | ||
79 | nouveau_bo_ref(NULL, &chan->push.buffer); | 81 | nouveau_bo_ref(NULL, &chan->push.buffer); |
80 | kfree(chan); | 82 | kfree(chan); |
81 | } | 83 | } |
@@ -267,7 +269,7 @@ nouveau_channel_init(struct nouveau_channel *chan, u32 vram, u32 gart) | |||
267 | struct nouveau_fb *pfb = nouveau_fb(device); | 269 | struct nouveau_fb *pfb = nouveau_fb(device); |
268 | struct nouveau_software_chan *swch; | 270 | struct nouveau_software_chan *swch; |
269 | struct nouveau_object *object; | 271 | struct nouveau_object *object; |
270 | struct nv_dma_class args; | 272 | struct nv_dma_class args = {}; |
271 | int ret, i; | 273 | int ret, i; |
272 | 274 | ||
273 | /* allocate dma objects to cover all allowed vram, and gart */ | 275 | /* allocate dma objects to cover all allowed vram, and gart */ |
@@ -346,7 +348,7 @@ nouveau_channel_init(struct nouveau_channel *chan, u32 vram, u32 gart) | |||
346 | /* allocate software object class (used for fences on <= nv05, and | 348 | /* allocate software object class (used for fences on <= nv05, and |
347 | * to signal flip completion), bind it to a subchannel. | 349 | * to signal flip completion), bind it to a subchannel. |
348 | */ | 350 | */ |
349 | if (chan != chan->drm->cechan) { | 351 | if ((device->card_type < NV_E0) || gart /* nve0: want_nvsw */) { |
350 | ret = nouveau_object_new(nv_object(client), chan->handle, | 352 | ret = nouveau_object_new(nv_object(client), chan->handle, |
351 | NvSw, nouveau_abi16_swclass(chan->drm), | 353 | NvSw, nouveau_abi16_swclass(chan->drm), |
352 | NULL, 0, &object); | 354 | NULL, 0, &object); |