Commit 2e408ad7 authored by Ben Skeggs's avatar Ben Skeggs Committed by Danilo Krummrich

drm/nouveau: add nouveau_cli to nouveau_abi16

Store a pointer to struct nouveau_cli in struct nouveau_abi16 to
avoid some dubious void casts.
Signed-off-by: default avatarBen Skeggs <bskeggs@nvidia.com>
Signed-off-by: default avatarDanilo Krummrich <dakr@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20240726043828.58966-8-bskeggs@nvidia.com
parent ea94c8e2
...@@ -50,6 +50,7 @@ nouveau_abi16(struct drm_file *file_priv) ...@@ -50,6 +50,7 @@ nouveau_abi16(struct drm_file *file_priv)
.device = ~0ULL, .device = ~0ULL,
}; };
abi16->cli = cli;
INIT_LIST_HEAD(&abi16->channels); INIT_LIST_HEAD(&abi16->channels);
/* allocate device object targeting client's default /* allocate device object targeting client's default
...@@ -82,7 +83,7 @@ nouveau_abi16_get(struct drm_file *file_priv) ...@@ -82,7 +83,7 @@ nouveau_abi16_get(struct drm_file *file_priv)
int int
nouveau_abi16_put(struct nouveau_abi16 *abi16, int ret) nouveau_abi16_put(struct nouveau_abi16 *abi16, int ret)
{ {
struct nouveau_cli *cli = (void *)abi16->device.object.client; struct nouveau_cli *cli = abi16->cli;
mutex_unlock(&cli->mutex); mutex_unlock(&cli->mutex);
return ret; return ret;
} }
...@@ -164,7 +165,7 @@ nouveau_abi16_chan_fini(struct nouveau_abi16 *abi16, ...@@ -164,7 +165,7 @@ nouveau_abi16_chan_fini(struct nouveau_abi16 *abi16,
void void
nouveau_abi16_fini(struct nouveau_abi16 *abi16) nouveau_abi16_fini(struct nouveau_abi16 *abi16)
{ {
struct nouveau_cli *cli = (void *)abi16->device.object.client; struct nouveau_cli *cli = abi16->cli;
struct nouveau_abi16_chan *chan, *temp; struct nouveau_abi16_chan *chan, *temp;
/* cleanup channels */ /* cleanup channels */
...@@ -529,7 +530,7 @@ nouveau_abi16_ioctl_grobj_alloc(ABI16_IOCTL_ARGS) ...@@ -529,7 +530,7 @@ nouveau_abi16_ioctl_grobj_alloc(ABI16_IOCTL_ARGS)
if (init->handle == ~0) if (init->handle == ~0)
return nouveau_abi16_put(abi16, -EINVAL); return nouveau_abi16_put(abi16, -EINVAL);
client = abi16->device.object.client; client = &abi16->cli->base;
chan = nouveau_abi16_chan(abi16, init->channel); chan = nouveau_abi16_chan(abi16, init->channel);
if (!chan) if (!chan)
...@@ -623,7 +624,7 @@ nouveau_abi16_ioctl_notifierobj_alloc(ABI16_IOCTL_ARGS) ...@@ -623,7 +624,7 @@ nouveau_abi16_ioctl_notifierobj_alloc(ABI16_IOCTL_ARGS)
/* completely unnecessary for these chipsets... */ /* completely unnecessary for these chipsets... */
if (unlikely(device->info.family >= NV_DEVICE_INFO_V0_FERMI)) if (unlikely(device->info.family >= NV_DEVICE_INFO_V0_FERMI))
return nouveau_abi16_put(abi16, -EINVAL); return nouveau_abi16_put(abi16, -EINVAL);
client = abi16->device.object.client; client = &abi16->cli->base;
chan = nouveau_abi16_chan(abi16, info->channel); chan = nouveau_abi16_chan(abi16, info->channel);
if (!chan) if (!chan)
......
...@@ -30,6 +30,7 @@ struct nouveau_abi16_chan { ...@@ -30,6 +30,7 @@ struct nouveau_abi16_chan {
}; };
struct nouveau_abi16 { struct nouveau_abi16 {
struct nouveau_cli *cli;
struct nvif_device device; struct nvif_device device;
struct list_head channels; struct list_head channels;
u64 handles; u64 handles;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment