aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/nouveau/nouveau_abi16.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/nouveau/nouveau_abi16.c')
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_abi16.c27
1 files changed, 17 insertions, 10 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_abi16.c b/drivers/gpu/drm/nouveau/nouveau_abi16.c
index cbf1fc60a386..41241922263f 100644
--- a/drivers/gpu/drm/nouveau/nouveau_abi16.c
+++ b/drivers/gpu/drm/nouveau/nouveau_abi16.c
@@ -246,14 +246,26 @@ nouveau_abi16_ioctl_channel_alloc(ABI16_IOCTL_ARGS)
246 return nouveau_abi16_put(abi16, -ENODEV); 246 return nouveau_abi16_put(abi16, -ENODEV);
247 247
248 client = nv_client(abi16->client); 248 client = nv_client(abi16->client);
249
250 if (init->fb_ctxdma_handle == ~0 || init->tt_ctxdma_handle == ~0)
251 return nouveau_abi16_put(abi16, -EINVAL);
252
253 device = nv_device(abi16->device); 249 device = nv_device(abi16->device);
254 imem = nouveau_instmem(device); 250 imem = nouveau_instmem(device);
255 pfb = nouveau_fb(device); 251 pfb = nouveau_fb(device);
256 252
253 /* hack to allow channel engine type specification on kepler */
254 if (device->card_type >= NV_E0) {
255 if (init->fb_ctxdma_handle != ~0)
256 init->fb_ctxdma_handle = NVE0_CHANNEL_IND_ENGINE_GR;
257 else
258 init->fb_ctxdma_handle = init->tt_ctxdma_handle;
259
260 /* allow flips to be executed if this is a graphics channel */
261 init->tt_ctxdma_handle = 0;
262 if (init->fb_ctxdma_handle == NVE0_CHANNEL_IND_ENGINE_GR)
263 init->tt_ctxdma_handle = 1;
264 }
265
266 if (init->fb_ctxdma_handle == ~0 || init->tt_ctxdma_handle == ~0)
267 return nouveau_abi16_put(abi16, -EINVAL);
268
257 /* allocate "abi16 channel" data and make up a handle for it */ 269 /* allocate "abi16 channel" data and make up a handle for it */
258 init->channel = ffsll(~abi16->handles); 270 init->channel = ffsll(~abi16->handles);
259 if (!init->channel--) 271 if (!init->channel--)
@@ -268,11 +280,6 @@ nouveau_abi16_ioctl_channel_alloc(ABI16_IOCTL_ARGS)
268 abi16->handles |= (1 << init->channel); 280 abi16->handles |= (1 << init->channel);
269 281
270 /* create channel object and initialise dma and fence management */ 282 /* create channel object and initialise dma and fence management */
271 if (device->card_type >= NV_E0) {
272 init->fb_ctxdma_handle = NVE0_CHANNEL_IND_ENGINE_GR;
273 init->tt_ctxdma_handle = 0;
274 }
275
276 ret = nouveau_channel_new(drm, cli, NVDRM_DEVICE, NVDRM_CHAN | 283 ret = nouveau_channel_new(drm, cli, NVDRM_DEVICE, NVDRM_CHAN |
277 init->channel, init->fb_ctxdma_handle, 284 init->channel, init->fb_ctxdma_handle,
278 init->tt_ctxdma_handle, &chan->chan); 285 init->tt_ctxdma_handle, &chan->chan);
@@ -382,7 +389,7 @@ nouveau_abi16_ioctl_notifierobj_alloc(ABI16_IOCTL_ARGS)
382 struct nouveau_abi16_chan *chan, *temp; 389 struct nouveau_abi16_chan *chan, *temp;
383 struct nouveau_abi16_ntfy *ntfy; 390 struct nouveau_abi16_ntfy *ntfy;
384 struct nouveau_object *object; 391 struct nouveau_object *object;
385 struct nv_dma_class args; 392 struct nv_dma_class args = {};
386 int ret; 393 int ret;
387 394
388 if (unlikely(!abi16)) 395 if (unlikely(!abi16))