]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/nouveau/nvif: remove client device arg
authorBen Skeggs <bskeggs@nvidia.com>
Fri, 26 Jul 2024 04:38:10 +0000 (14:38 +1000)
committerDanilo Krummrich <dakr@kernel.org>
Sat, 27 Jul 2024 01:05:32 +0000 (03:05 +0200)
This was once used by userspace tools (with nvkm built as a library), as
a way to select a "default device".

The DRM code doesn't need this at all as clients only have access to a
single device already, so inherit the value from its parent.

Signed-off-by: Ben Skeggs <bskeggs@nvidia.com>
Signed-off-by: Danilo Krummrich <dakr@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20240726043828.58966-20-bskeggs@nvidia.com
drivers/gpu/drm/nouveau/include/nvif/client.h
drivers/gpu/drm/nouveau/include/nvif/if0000.h
drivers/gpu/drm/nouveau/nouveau_drm.c
drivers/gpu/drm/nouveau/nvif/client.c
drivers/gpu/drm/nouveau/nvif/driver.c
drivers/gpu/drm/nouveau/nvkm/core/client.c

index 5210007d7669475eb68a93ba1396f4006a25047a..2c8e9bec3f79e66c288da067c7ea8825eb34967d 100644 (file)
@@ -10,8 +10,7 @@ struct nvif_client {
        u64 version;
 };
 
-int  nvif_client_ctor(struct nvif_client *parent, const char *name, u64 device,
-                     struct nvif_client *);
+int  nvif_client_ctor(struct nvif_client *parent, const char *name, struct nvif_client *);
 void nvif_client_dtor(struct nvif_client *);
 int  nvif_client_ioctl(struct nvif_client *, void *, u32);
 int  nvif_client_suspend(struct nvif_client *);
index f7b8f8f48760142e7709496e7b12d7d0bad9bb05..a93f91d56a09ab7a243b4a041e3bca5d19b0a602 100644 (file)
@@ -5,7 +5,6 @@
 struct nvif_client_v0 {
        __u8  version;
        __u8  pad01[7];
-       __u64 device;
        char  name[32];
 };
 
index 526c16f7919632262b4c873b259c5bb2fc3de04d..8bcfc1f47a266e8ea7b933f241ac299c3e9ce9f8 100644 (file)
@@ -241,7 +241,6 @@ nouveau_cli_init(struct nouveau_drm *drm, const char *sname,
                { NVIF_CLASS_VMM_NV04 , -1 },
                {}
        };
-       u64 device = nouveau_name(drm->dev);
        int ret;
 
        snprintf(cli->name, sizeof(cli->name), "%s", sname);
@@ -254,8 +253,7 @@ nouveau_cli_init(struct nouveau_drm *drm, const char *sname,
 
        if (cli != &drm->master) {
                mutex_lock(&drm->master.lock);
-               ret = nvif_client_ctor(&drm->master.base, cli->name, device,
-                                      &cli->base);
+               ret = nvif_client_ctor(&drm->master.base, cli->name, &cli->base);
                mutex_unlock(&drm->master.lock);
        }
        if (ret) {
index 85ad5091e8e27454d76a07ad95dd710d2441c89c..bbfc80fcff43d925f13bc45b8e1ef93f2583296c 100644 (file)
@@ -55,10 +55,9 @@ nvif_client_dtor(struct nvif_client *client)
 }
 
 int
-nvif_client_ctor(struct nvif_client *parent, const char *name, u64 device,
-                struct nvif_client *client)
+nvif_client_ctor(struct nvif_client *parent, const char *name, struct nvif_client *client)
 {
-       struct nvif_client_v0 args = { .device = device };
+       struct nvif_client_v0 args = {};
        struct {
                struct nvif_ioctl_v0 ioctl;
                struct nvif_ioctl_nop_v0 nop;
index acb708df2559822d787ee355aea9c7080ed179c5..78706e97a6a29586535db394a9c5a050b2eeba2c 100644 (file)
@@ -36,5 +36,5 @@ nvif_driver_init(const char *drv, const char *cfg, const char *dbg,
        if (ret)
                return ret;
 
-       return nvif_client_ctor(client, name, device, client);
+       return nvif_client_ctor(client, name, client);
 }
index 95cbb5b682f2c4d0b61e019f050386f0a58911d3..6baa3a4fa0a453093868a018688c0d4076cf93b7 100644 (file)
@@ -42,7 +42,7 @@ nvkm_uclient_new(const struct nvkm_oclass *oclass, void *argv, u32 argc,
 
        if (!(ret = nvif_unpack(ret, &argv, &argc, args->v0, 0, 0, false))){
                args->v0.name[sizeof(args->v0.name) - 1] = 0;
-               ret = nvkm_client_new(args->v0.name, args->v0.device, NULL,
+               ret = nvkm_client_new(args->v0.name, oclass->client->device, NULL,
                                      NULL, oclass->client->event, &client);
                if (ret)
                        return ret;