drm/nouveau: store nvkm_device pointer in nouveau_drm
authorBen Skeggs <bskeggs@nvidia.com>
Fri, 26 Jul 2024 04:37:56 +0000 (14:37 +1000)
committerDanilo Krummrich <dakr@kernel.org>
Sat, 27 Jul 2024 01:05:21 +0000 (03:05 +0200)
commit6777264dfabe2a7c75453031bee5bcc2e7882cf7
tree54113926b388b2a8ea7923b42f5385acec9fe335
parentc0bfe34330b5fafdbbc63a7124841711651b96b9
drm/nouveau: store nvkm_device pointer in nouveau_drm

There's various different places in the drm code that get at the
nvkm_device via various creative (and not very type-safe) means.

One of those being via nvif_device.object.priv.

Another patch series is going to entirely remove the ioctl-like
interfaces beween the drm code and nvkm, and that field will no
longer exist.

This provides a safer replacement for accessing the nvkm_device,
and will used more in upcoming patches to cleanup other cases.

v2:
- fixup printk macros to not oops if used before client ctor

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-6-bskeggs@nvidia.com
drivers/gpu/drm/nouveau/nouveau_drm.c
drivers/gpu/drm/nouveau/nouveau_drv.h