forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-02-20 ea08eeccae9297f7aabd2ef7f0c2517ac4549acc
kernel/drivers/gpu/drm/nouveau/nouveau_abi16.c
....@@ -55,8 +55,8 @@
5555 * device (ie. the one that belongs to the fd it
5656 * opened)
5757 */
58
- if (nvif_device_init(&cli->base.object, 0, NV_DEVICE,
59
- &args, sizeof(args),
58
+ if (nvif_device_ctor(&cli->base.object, "abi16Device",
59
+ 0, NV_DEVICE, &args, sizeof(args),
6060 &abi16->device) == 0)
6161 return cli->abi16;
6262
....@@ -114,7 +114,7 @@
114114 nouveau_abi16_ntfy_fini(struct nouveau_abi16_chan *chan,
115115 struct nouveau_abi16_ntfy *ntfy)
116116 {
117
- nvif_object_fini(&ntfy->object);
117
+ nvif_object_dtor(&ntfy->object);
118118 nvkm_mm_free(&chan->heap, &ntfy->node);
119119 list_del(&ntfy->head);
120120 kfree(ntfy);
....@@ -139,7 +139,7 @@
139139 if (chan->ntfy) {
140140 nouveau_vma_del(&chan->ntfy_vma);
141141 nouveau_bo_unpin(chan->ntfy);
142
- drm_gem_object_put_unlocked(&chan->ntfy->gem);
142
+ drm_gem_object_put(&chan->ntfy->bo.base);
143143 }
144144
145145 if (chan->heap.block_size)
....@@ -167,7 +167,7 @@
167167 }
168168
169169 /* destroy the device object */
170
- nvif_device_fini(&abi16->device);
170
+ nvif_device_dtor(&abi16->device);
171171
172172 kfree(cli->abi16);
173173 cli->abi16 = NULL;
....@@ -245,12 +245,6 @@
245245 }
246246
247247 int
248
-nouveau_abi16_ioctl_setparam(ABI16_IOCTL_ARGS)
249
-{
250
- return -EINVAL;
251
-}
252
-
253
-int
254248 nouveau_abi16_ioctl_channel_alloc(ABI16_IOCTL_ARGS)
255249 {
256250 struct drm_nouveau_channel_alloc *init = data;
....@@ -307,7 +301,7 @@
307301
308302 /* create channel object and initialise dma and fence management */
309303 ret = nouveau_channel_new(drm, device, init->fb_ctxdma_handle,
310
- init->tt_ctxdma_handle, &chan->chan);
304
+ init->tt_ctxdma_handle, false, &chan->chan);
311305 if (ret)
312306 goto done;
313307
....@@ -334,17 +328,19 @@
334328 ret = nouveau_gem_new(cli, PAGE_SIZE, 0, NOUVEAU_GEM_DOMAIN_GART,
335329 0, 0, &chan->ntfy);
336330 if (ret == 0)
337
- ret = nouveau_bo_pin(chan->ntfy, TTM_PL_FLAG_TT, false);
331
+ ret = nouveau_bo_pin(chan->ntfy, NOUVEAU_GEM_DOMAIN_GART,
332
+ false);
338333 if (ret)
339334 goto done;
340335
341336 if (device->info.family >= NV_DEVICE_INFO_V0_TESLA) {
342
- ret = nouveau_vma_new(chan->ntfy, &cli->vmm, &chan->ntfy_vma);
337
+ ret = nouveau_vma_new(chan->ntfy, chan->chan->vmm,
338
+ &chan->ntfy_vma);
343339 if (ret)
344340 goto done;
345341 }
346342
347
- ret = drm_gem_handle_create(file_priv, &chan->ntfy->gem,
343
+ ret = drm_gem_handle_create(file_priv, &chan->ntfy->bo.base,
348344 &init->notifier_handle);
349345 if (ret)
350346 goto done;
....@@ -507,8 +503,8 @@
507503 list_add(&ntfy->head, &chan->notifiers);
508504
509505 client->route = NVDRM_OBJECT_ABI16;
510
- ret = nvif_object_init(&chan->chan->user, init->handle, oclass,
511
- NULL, 0, &ntfy->object);
506
+ ret = nvif_object_ctor(&chan->chan->user, "abi16EngObj", init->handle,
507
+ oclass, NULL, 0, &ntfy->object);
512508 client->route = NVDRM_OBJECT_NVIF;
513509
514510 if (ret)
....@@ -563,18 +559,18 @@
563559 if (drm->agp.bridge) {
564560 args.target = NV_DMA_V0_TARGET_AGP;
565561 args.access = NV_DMA_V0_ACCESS_RDWR;
566
- args.start += drm->agp.base + chan->ntfy->bo.offset;
567
- args.limit += drm->agp.base + chan->ntfy->bo.offset;
562
+ args.start += drm->agp.base + chan->ntfy->offset;
563
+ args.limit += drm->agp.base + chan->ntfy->offset;
568564 } else {
569565 args.target = NV_DMA_V0_TARGET_VM;
570566 args.access = NV_DMA_V0_ACCESS_RDWR;
571
- args.start += chan->ntfy->bo.offset;
572
- args.limit += chan->ntfy->bo.offset;
567
+ args.start += chan->ntfy->offset;
568
+ args.limit += chan->ntfy->offset;
573569 }
574570
575571 client->route = NVDRM_OBJECT_ABI16;
576572 client->super = true;
577
- ret = nvif_object_init(&chan->chan->user, info->handle,
573
+ ret = nvif_object_ctor(&chan->chan->user, "abi16Ntfy", info->handle,
578574 NV_DMA_IN_MEMORY, &args, sizeof(args),
579575 &ntfy->object);
580576 client->super = false;