blob: 5ce2110b31f380c864ccea3a4cc9bf0320e7c5a8 [file] [log] [blame]
Ben Skeggsebb945a2012-07-20 08:17:34 +10001/*
2 * Copyright 2012 Red Hat Inc.
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice shall be included in
12 * all copies or substantial portions of the Software.
13 *
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
18 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20 * OTHER DEALINGS IN THE SOFTWARE.
21 *
22 * Authors: Ben Skeggs
23 */
24
Ben Skeggsfdb751e2014-08-10 04:10:23 +100025#include <nvif/os.h>
26#include <nvif/class.h>
27
28/*XXX*/
Ben Skeggsebb945a2012-07-20 08:17:34 +100029#include <core/client.h>
Ben Skeggsebb945a2012-07-20 08:17:34 +100030
Ben Skeggsebb945a2012-07-20 08:17:34 +100031#include "nouveau_drm.h"
32#include "nouveau_dma.h"
33#include "nouveau_bo.h"
34#include "nouveau_chan.h"
35#include "nouveau_fence.h"
36#include "nouveau_abi16.h"
37
38MODULE_PARM_DESC(vram_pushbuf, "Create DMA push buffers in VRAM");
39static int nouveau_vram_pushbuf;
40module_param_named(vram_pushbuf, nouveau_vram_pushbuf, int, 0400);
41
42int
43nouveau_channel_idle(struct nouveau_channel *chan)
44{
Ben Skeggs0ad72862014-08-10 04:10:22 +100045 struct nouveau_cli *cli = (void *)nvif_client(chan->object);
Ben Skeggsebb945a2012-07-20 08:17:34 +100046 struct nouveau_fence *fence = NULL;
47 int ret;
48
Ben Skeggs264ce192013-02-14 13:43:21 +100049 ret = nouveau_fence_new(chan, false, &fence);
Ben Skeggsebb945a2012-07-20 08:17:34 +100050 if (!ret) {
51 ret = nouveau_fence_wait(fence, false, false);
52 nouveau_fence_unref(&fence);
53 }
54
55 if (ret)
Ben Skeggsfa2bade2014-08-10 04:10:22 +100056 NV_PRINTK(error, cli, "failed to idle channel 0x%08x [%s]\n",
Ben Skeggs0ad72862014-08-10 04:10:22 +100057 chan->object->handle, nvkm_client(&cli->base)->name);
Ben Skeggsebb945a2012-07-20 08:17:34 +100058 return ret;
59}
60
61void
62nouveau_channel_del(struct nouveau_channel **pchan)
63{
64 struct nouveau_channel *chan = *pchan;
65 if (chan) {
Ben Skeggsebb945a2012-07-20 08:17:34 +100066 if (chan->fence) {
67 nouveau_channel_idle(chan);
68 nouveau_fence(chan->drm)->context_del(chan);
69 }
Ben Skeggs0ad72862014-08-10 04:10:22 +100070 nvif_object_fini(&chan->nvsw);
71 nvif_object_fini(&chan->gart);
72 nvif_object_fini(&chan->vram);
73 nvif_object_ref(NULL, &chan->object);
74 nvif_object_fini(&chan->push.ctxdma);
Ben Skeggsebb945a2012-07-20 08:17:34 +100075 nouveau_bo_vma_del(chan->push.buffer, &chan->push.vma);
76 nouveau_bo_unmap(chan->push.buffer);
Marcin Slusarz124ea292012-11-25 23:02:28 +010077 if (chan->push.buffer && chan->push.buffer->pin_refcnt)
78 nouveau_bo_unpin(chan->push.buffer);
Ben Skeggsebb945a2012-07-20 08:17:34 +100079 nouveau_bo_ref(NULL, &chan->push.buffer);
Ben Skeggs0ad72862014-08-10 04:10:22 +100080 nvif_device_ref(NULL, &chan->device);
Ben Skeggsebb945a2012-07-20 08:17:34 +100081 kfree(chan);
82 }
83 *pchan = NULL;
84}
85
86static int
Ben Skeggs0ad72862014-08-10 04:10:22 +100087nouveau_channel_prep(struct nouveau_drm *drm, struct nvif_device *device,
88 u32 handle, u32 size, struct nouveau_channel **pchan)
Ben Skeggsebb945a2012-07-20 08:17:34 +100089{
Ben Skeggs0ad72862014-08-10 04:10:22 +100090 struct nouveau_cli *cli = (void *)nvif_client(&device->base);
Ben Skeggs967e7bd2014-08-10 04:10:22 +100091 struct nouveau_instmem *imem = nvkm_instmem(device);
92 struct nouveau_vmmgr *vmm = nvkm_vmmgr(device);
93 struct nouveau_fb *pfb = nvkm_fb(device);
Ben Skeggs4acfd702014-08-10 04:10:24 +100094 struct nv_dma_v0 args = {};
Ben Skeggsebb945a2012-07-20 08:17:34 +100095 struct nouveau_channel *chan;
Ben Skeggsebb945a2012-07-20 08:17:34 +100096 u32 target;
97 int ret;
98
99 chan = *pchan = kzalloc(sizeof(*chan), GFP_KERNEL);
100 if (!chan)
101 return -ENOMEM;
102
Ben Skeggs0ad72862014-08-10 04:10:22 +1000103 nvif_device_ref(device, &chan->device);
Ben Skeggsebb945a2012-07-20 08:17:34 +1000104 chan->drm = drm;
Ben Skeggsebb945a2012-07-20 08:17:34 +1000105
106 /* allocate memory for dma push buffer */
107 target = TTM_PL_FLAG_TT;
108 if (nouveau_vram_pushbuf)
109 target = TTM_PL_FLAG_VRAM;
110
111 ret = nouveau_bo_new(drm->dev, size, 0, target, 0, 0, NULL,
112 &chan->push.buffer);
113 if (ret == 0) {
114 ret = nouveau_bo_pin(chan->push.buffer, target);
115 if (ret == 0)
116 ret = nouveau_bo_map(chan->push.buffer);
117 }
118
119 if (ret) {
120 nouveau_channel_del(pchan);
121 return ret;
122 }
123
124 /* create dma object covering the *entire* memory space that the
125 * pushbuf lives in, this is because the GEM code requires that
126 * we be able to call out to other (indirect) push buffers
127 */
128 chan->push.vma.offset = chan->push.buffer->bo.offset;
Ben Skeggsebb945a2012-07-20 08:17:34 +1000129
Ben Skeggs967e7bd2014-08-10 04:10:22 +1000130 if (device->info.family >= NV_DEVICE_INFO_V0_TESLA) {
Ben Skeggs0ad72862014-08-10 04:10:22 +1000131 ret = nouveau_bo_vma_add(chan->push.buffer, cli->vm,
Ben Skeggsebb945a2012-07-20 08:17:34 +1000132 &chan->push.vma);
133 if (ret) {
134 nouveau_channel_del(pchan);
135 return ret;
136 }
137
Ben Skeggs4acfd702014-08-10 04:10:24 +1000138 args.target = NV_DMA_V0_TARGET_VM;
139 args.access = NV_DMA_V0_ACCESS_VM;
Ben Skeggsebb945a2012-07-20 08:17:34 +1000140 args.start = 0;
Ben Skeggs0ad72862014-08-10 04:10:22 +1000141 args.limit = cli->vm->vmm->limit - 1;
Ben Skeggsebb945a2012-07-20 08:17:34 +1000142 } else
143 if (chan->push.buffer->bo.mem.mem_type == TTM_PL_VRAM) {
Ben Skeggsdceef5d2013-03-04 13:01:21 +1000144 u64 limit = pfb->ram->size - imem->reserved - 1;
Ben Skeggs967e7bd2014-08-10 04:10:22 +1000145 if (device->info.family == NV_DEVICE_INFO_V0_TNT) {
Ben Skeggsebb945a2012-07-20 08:17:34 +1000146 /* nv04 vram pushbuf hack, retarget to its location in
147 * the framebuffer bar rather than direct vram access..
148 * nfi why this exists, it came from the -nv ddx.
149 */
Ben Skeggs4acfd702014-08-10 04:10:24 +1000150 args.target = NV_DMA_V0_TARGET_PCI;
151 args.access = NV_DMA_V0_ACCESS_RDWR;
Ben Skeggs967e7bd2014-08-10 04:10:22 +1000152 args.start = nv_device_resource_start(nvkm_device(device), 1);
Ben Skeggsebb945a2012-07-20 08:17:34 +1000153 args.limit = args.start + limit;
154 } else {
Ben Skeggs4acfd702014-08-10 04:10:24 +1000155 args.target = NV_DMA_V0_TARGET_VRAM;
156 args.access = NV_DMA_V0_ACCESS_RDWR;
Ben Skeggsebb945a2012-07-20 08:17:34 +1000157 args.start = 0;
158 args.limit = limit;
159 }
160 } else {
161 if (chan->drm->agp.stat == ENABLED) {
Ben Skeggs4acfd702014-08-10 04:10:24 +1000162 args.target = NV_DMA_V0_TARGET_AGP;
163 args.access = NV_DMA_V0_ACCESS_RDWR;
Ben Skeggsebb945a2012-07-20 08:17:34 +1000164 args.start = chan->drm->agp.base;
165 args.limit = chan->drm->agp.base +
166 chan->drm->agp.size - 1;
167 } else {
Ben Skeggs4acfd702014-08-10 04:10:24 +1000168 args.target = NV_DMA_V0_TARGET_VM;
169 args.access = NV_DMA_V0_ACCESS_RDWR;
Ben Skeggsebb945a2012-07-20 08:17:34 +1000170 args.start = 0;
171 args.limit = vmm->limit - 1;
172 }
173 }
174
Ben Skeggs0ad72862014-08-10 04:10:22 +1000175 ret = nvif_object_init(nvif_object(device), NULL, NVDRM_PUSH |
Ben Skeggs4acfd702014-08-10 04:10:24 +1000176 (handle & 0xffff), NV_DMA_FROM_MEMORY,
Ben Skeggs0ad72862014-08-10 04:10:22 +1000177 &args, sizeof(args), &chan->push.ctxdma);
Ben Skeggsebb945a2012-07-20 08:17:34 +1000178 if (ret) {
179 nouveau_channel_del(pchan);
180 return ret;
181 }
182
183 return 0;
184}
185
Marcin Slusarz5b8a43a2012-08-19 23:00:00 +0200186static int
Ben Skeggs0ad72862014-08-10 04:10:22 +1000187nouveau_channel_ind(struct nouveau_drm *drm, struct nvif_device *device,
188 u32 handle, u32 engine, struct nouveau_channel **pchan)
Ben Skeggsebb945a2012-07-20 08:17:34 +1000189{
Ben Skeggsc97f8c92012-08-19 16:03:00 +1000190 static const u16 oclasses[] = { NVE0_CHANNEL_IND_CLASS,
191 NVC0_CHANNEL_IND_CLASS,
192 NV84_CHANNEL_IND_CLASS,
193 NV50_CHANNEL_IND_CLASS,
194 0 };
Ben Skeggsebb945a2012-07-20 08:17:34 +1000195 const u16 *oclass = oclasses;
Ben Skeggsdbff2de2012-08-06 18:16:37 +1000196 struct nve0_channel_ind_class args;
Ben Skeggsebb945a2012-07-20 08:17:34 +1000197 struct nouveau_channel *chan;
198 int ret;
199
200 /* allocate dma push buffer */
Ben Skeggs0ad72862014-08-10 04:10:22 +1000201 ret = nouveau_channel_prep(drm, device, handle, 0x12000, &chan);
Ben Skeggsebb945a2012-07-20 08:17:34 +1000202 *pchan = chan;
203 if (ret)
204 return ret;
205
206 /* create channel object */
Ben Skeggs0ad72862014-08-10 04:10:22 +1000207 args.pushbuf = chan->push.ctxdma.handle;
Ben Skeggsebb945a2012-07-20 08:17:34 +1000208 args.ioffset = 0x10000 + chan->push.vma.offset;
209 args.ilength = 0x02000;
Ben Skeggs49981042012-08-06 19:38:25 +1000210 args.engine = engine;
Ben Skeggsebb945a2012-07-20 08:17:34 +1000211
212 do {
Ben Skeggs0ad72862014-08-10 04:10:22 +1000213 ret = nvif_object_new(nvif_object(device), handle, *oclass++,
214 &args, sizeof(args), &chan->object);
Ben Skeggsebb945a2012-07-20 08:17:34 +1000215 if (ret == 0)
216 return ret;
217 } while (*oclass);
218
219 nouveau_channel_del(pchan);
220 return ret;
221}
222
223static int
Ben Skeggs0ad72862014-08-10 04:10:22 +1000224nouveau_channel_dma(struct nouveau_drm *drm, struct nvif_device *device,
225 u32 handle, struct nouveau_channel **pchan)
Ben Skeggsebb945a2012-07-20 08:17:34 +1000226{
Ben Skeggsc97f8c92012-08-19 16:03:00 +1000227 static const u16 oclasses[] = { NV40_CHANNEL_DMA_CLASS,
228 NV17_CHANNEL_DMA_CLASS,
229 NV10_CHANNEL_DMA_CLASS,
230 NV03_CHANNEL_DMA_CLASS,
231 0 };
Ben Skeggsebb945a2012-07-20 08:17:34 +1000232 const u16 *oclass = oclasses;
Ben Skeggsa7c6e752012-08-14 15:02:29 +1000233 struct nv03_channel_dma_class args;
Ben Skeggsebb945a2012-07-20 08:17:34 +1000234 struct nouveau_channel *chan;
235 int ret;
236
237 /* allocate dma push buffer */
Ben Skeggs0ad72862014-08-10 04:10:22 +1000238 ret = nouveau_channel_prep(drm, device, handle, 0x10000, &chan);
Ben Skeggsebb945a2012-07-20 08:17:34 +1000239 *pchan = chan;
240 if (ret)
241 return ret;
242
243 /* create channel object */
Ben Skeggs0ad72862014-08-10 04:10:22 +1000244 args.pushbuf = chan->push.ctxdma.handle;
Ben Skeggsebb945a2012-07-20 08:17:34 +1000245 args.offset = chan->push.vma.offset;
246
247 do {
Ben Skeggs0ad72862014-08-10 04:10:22 +1000248 ret = nvif_object_new(nvif_object(device), handle, *oclass++,
249 &args, sizeof(args), &chan->object);
Ben Skeggsebb945a2012-07-20 08:17:34 +1000250 if (ret == 0)
251 return ret;
252 } while (ret && *oclass);
253
254 nouveau_channel_del(pchan);
255 return ret;
256}
257
258static int
259nouveau_channel_init(struct nouveau_channel *chan, u32 vram, u32 gart)
260{
Ben Skeggs0ad72862014-08-10 04:10:22 +1000261 struct nvif_device *device = chan->device;
262 struct nouveau_cli *cli = (void *)nvif_client(&device->base);
Ben Skeggs967e7bd2014-08-10 04:10:22 +1000263 struct nouveau_instmem *imem = nvkm_instmem(device);
264 struct nouveau_vmmgr *vmm = nvkm_vmmgr(device);
265 struct nouveau_fb *pfb = nvkm_fb(device);
Ben Skeggsebb945a2012-07-20 08:17:34 +1000266 struct nouveau_software_chan *swch;
Ben Skeggs4acfd702014-08-10 04:10:24 +1000267 struct nv_dma_v0 args = {};
Ben Skeggsebb945a2012-07-20 08:17:34 +1000268 int ret, i;
269
Ben Skeggsebb945a2012-07-20 08:17:34 +1000270 /* allocate dma objects to cover all allowed vram, and gart */
Ben Skeggs967e7bd2014-08-10 04:10:22 +1000271 if (device->info.family < NV_DEVICE_INFO_V0_FERMI) {
272 if (device->info.family >= NV_DEVICE_INFO_V0_TESLA) {
Ben Skeggs4acfd702014-08-10 04:10:24 +1000273 args.target = NV_DMA_V0_TARGET_VM;
274 args.access = NV_DMA_V0_ACCESS_VM;
Ben Skeggsebb945a2012-07-20 08:17:34 +1000275 args.start = 0;
Ben Skeggs0ad72862014-08-10 04:10:22 +1000276 args.limit = cli->vm->vmm->limit - 1;
Ben Skeggsebb945a2012-07-20 08:17:34 +1000277 } else {
Ben Skeggs4acfd702014-08-10 04:10:24 +1000278 args.target = NV_DMA_V0_TARGET_VRAM;
279 args.access = NV_DMA_V0_ACCESS_RDWR;
Ben Skeggsebb945a2012-07-20 08:17:34 +1000280 args.start = 0;
Ben Skeggsdceef5d2013-03-04 13:01:21 +1000281 args.limit = pfb->ram->size - imem->reserved - 1;
Ben Skeggsebb945a2012-07-20 08:17:34 +1000282 }
283
Ben Skeggs0ad72862014-08-10 04:10:22 +1000284 ret = nvif_object_init(chan->object, NULL, vram,
Ben Skeggs4acfd702014-08-10 04:10:24 +1000285 NV_DMA_IN_MEMORY, &args,
Ben Skeggs0ad72862014-08-10 04:10:22 +1000286 sizeof(args), &chan->vram);
Ben Skeggsebb945a2012-07-20 08:17:34 +1000287 if (ret)
288 return ret;
289
Ben Skeggs967e7bd2014-08-10 04:10:22 +1000290 if (device->info.family >= NV_DEVICE_INFO_V0_TESLA) {
Ben Skeggs4acfd702014-08-10 04:10:24 +1000291 args.target = NV_DMA_V0_TARGET_VM;
292 args.access = NV_DMA_V0_ACCESS_VM;
Ben Skeggsebb945a2012-07-20 08:17:34 +1000293 args.start = 0;
Ben Skeggs0ad72862014-08-10 04:10:22 +1000294 args.limit = cli->vm->vmm->limit - 1;
Ben Skeggsebb945a2012-07-20 08:17:34 +1000295 } else
296 if (chan->drm->agp.stat == ENABLED) {
Ben Skeggs4acfd702014-08-10 04:10:24 +1000297 args.target = NV_DMA_V0_TARGET_AGP;
298 args.access = NV_DMA_V0_ACCESS_RDWR;
Ben Skeggsebb945a2012-07-20 08:17:34 +1000299 args.start = chan->drm->agp.base;
300 args.limit = chan->drm->agp.base +
301 chan->drm->agp.size - 1;
302 } else {
Ben Skeggs4acfd702014-08-10 04:10:24 +1000303 args.target = NV_DMA_V0_TARGET_VM;
304 args.access = NV_DMA_V0_ACCESS_RDWR;
Ben Skeggsebb945a2012-07-20 08:17:34 +1000305 args.start = 0;
306 args.limit = vmm->limit - 1;
307 }
308
Ben Skeggs0ad72862014-08-10 04:10:22 +1000309 ret = nvif_object_init(chan->object, NULL, gart,
Ben Skeggs4acfd702014-08-10 04:10:24 +1000310 NV_DMA_IN_MEMORY, &args,
Ben Skeggs0ad72862014-08-10 04:10:22 +1000311 sizeof(args), &chan->gart);
Ben Skeggsebb945a2012-07-20 08:17:34 +1000312 if (ret)
313 return ret;
314 }
315
316 /* initialise dma tracking parameters */
Ben Skeggs0ad72862014-08-10 04:10:22 +1000317 switch (chan->object->oclass & 0x00ff) {
Ben Skeggs503b0f12012-08-14 14:53:51 +1000318 case 0x006b:
Ben Skeggsebb945a2012-07-20 08:17:34 +1000319 case 0x006e:
320 chan->user_put = 0x40;
321 chan->user_get = 0x44;
322 chan->dma.max = (0x10000 / 4) - 2;
323 break;
324 default:
325 chan->user_put = 0x40;
326 chan->user_get = 0x44;
327 chan->user_get_hi = 0x60;
328 chan->dma.ib_base = 0x10000 / 4;
329 chan->dma.ib_max = (0x02000 / 8) - 1;
330 chan->dma.ib_put = 0;
331 chan->dma.ib_free = chan->dma.ib_max - chan->dma.ib_put;
332 chan->dma.max = chan->dma.ib_base;
333 break;
334 }
335
336 chan->dma.put = 0;
337 chan->dma.cur = chan->dma.put;
338 chan->dma.free = chan->dma.max - chan->dma.cur;
339
340 ret = RING_SPACE(chan, NOUVEAU_DMA_SKIPS);
341 if (ret)
342 return ret;
343
344 for (i = 0; i < NOUVEAU_DMA_SKIPS; i++)
345 OUT_RING(chan, 0x00000000);
346
Ben Skeggs69a61462013-11-13 10:58:51 +1000347 /* allocate software object class (used for fences on <= nv05) */
Ben Skeggs967e7bd2014-08-10 04:10:22 +1000348 if (device->info.family < NV_DEVICE_INFO_V0_CELSIUS) {
Ben Skeggsf45f55c2014-08-10 04:10:23 +1000349 ret = nvif_object_init(chan->object, NULL, 0x006e, 0x006e,
Ben Skeggs0ad72862014-08-10 04:10:22 +1000350 NULL, 0, &chan->nvsw);
Ben Skeggs49981042012-08-06 19:38:25 +1000351 if (ret)
352 return ret;
Ben Skeggsebb945a2012-07-20 08:17:34 +1000353
Ben Skeggs0ad72862014-08-10 04:10:22 +1000354 swch = (void *)nvkm_object(&chan->nvsw)->parent;
Ben Skeggs49981042012-08-06 19:38:25 +1000355 swch->flip = nouveau_flip_complete;
356 swch->flip_data = chan;
Ben Skeggsebb945a2012-07-20 08:17:34 +1000357
Ben Skeggsebb945a2012-07-20 08:17:34 +1000358 ret = RING_SPACE(chan, 2);
359 if (ret)
360 return ret;
361
362 BEGIN_NV04(chan, NvSubSw, 0x0000, 1);
Ben Skeggsf45f55c2014-08-10 04:10:23 +1000363 OUT_RING (chan, chan->nvsw.handle);
Ben Skeggsebb945a2012-07-20 08:17:34 +1000364 FIRE_RING (chan);
365 }
366
367 /* initialise synchronisation */
368 return nouveau_fence(chan->drm)->context_new(chan);
369}
370
371int
Ben Skeggs0ad72862014-08-10 04:10:22 +1000372nouveau_channel_new(struct nouveau_drm *drm, struct nvif_device *device,
373 u32 handle, u32 arg0, u32 arg1,
Ben Skeggsebb945a2012-07-20 08:17:34 +1000374 struct nouveau_channel **pchan)
375{
Ben Skeggs0ad72862014-08-10 04:10:22 +1000376 struct nouveau_cli *cli = (void *)nvif_client(&device->base);
Ben Skeggsebb945a2012-07-20 08:17:34 +1000377 int ret;
378
Ben Skeggs0ad72862014-08-10 04:10:22 +1000379 ret = nouveau_channel_ind(drm, device, handle, arg0, pchan);
Ben Skeggsebb945a2012-07-20 08:17:34 +1000380 if (ret) {
Ben Skeggsfa2bade2014-08-10 04:10:22 +1000381 NV_PRINTK(debug, cli, "ib channel create, %d\n", ret);
Ben Skeggs0ad72862014-08-10 04:10:22 +1000382 ret = nouveau_channel_dma(drm, device, handle, pchan);
Ben Skeggsebb945a2012-07-20 08:17:34 +1000383 if (ret) {
Ben Skeggsfa2bade2014-08-10 04:10:22 +1000384 NV_PRINTK(debug, cli, "dma channel create, %d\n", ret);
Ben Skeggsebb945a2012-07-20 08:17:34 +1000385 return ret;
386 }
387 }
388
Ben Skeggs49981042012-08-06 19:38:25 +1000389 ret = nouveau_channel_init(*pchan, arg0, arg1);
Ben Skeggsebb945a2012-07-20 08:17:34 +1000390 if (ret) {
Ben Skeggsfa2bade2014-08-10 04:10:22 +1000391 NV_PRINTK(error, cli, "channel failed to initialise, %d\n", ret);
Ben Skeggsebb945a2012-07-20 08:17:34 +1000392 nouveau_channel_del(pchan);
393 return ret;
394 }
395
396 return 0;
397}