drm/nouveau: omit to create schedulers using the legacy uAPI
authorDanilo Krummrich <dakr@redhat.com>
Fri, 2 Feb 2024 00:05:51 +0000 (01:05 +0100)
committerDanilo Krummrich <dakr@redhat.com>
Mon, 12 Feb 2024 10:41:03 +0000 (11:41 +0100)
Omit to create scheduler instances when using the legacy uAPI. When
using the legacy NOUVEAU_GEM_PUSHBUF ioctl no scheduler instance is
required, hence omit creating scheduler instances in
nouveau_abi16_ioctl_channel_alloc().

Tested-by: Timur Tabi <ttabi@nvidia.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Danilo Krummrich <dakr@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240202000606.3526-2-dakr@redhat.com
drivers/gpu/drm/nouveau/nouveau_abi16.c

index ca4b5ab3e59e6c5cb1e7494cd1e8567150b25e51..d1bb8151a1df565c44db55432222f09641d7b109 100644 (file)
@@ -339,10 +339,16 @@ nouveau_abi16_ioctl_channel_alloc(ABI16_IOCTL_ARGS)
        if (ret)
                goto done;
 
-       ret = nouveau_sched_create(&chan->sched, drm, drm->sched_wq,
-                                  chan->chan->dma.ib_max);
-       if (ret)
-               goto done;
+       /* If we're not using the VM_BIND uAPI, we don't need a scheduler.
+        *
+        * The client lock is already acquired by nouveau_abi16_get().
+        */
+       if (nouveau_cli_uvmm(cli)) {
+               ret = nouveau_sched_create(&chan->sched, drm, drm->sched_wq,
+                                          chan->chan->dma.ib_max);
+               if (ret)
+                       goto done;
+       }
 
        init->channel = chan->chan->chid;