drm/nouveau/subdev: track type+instance separately
authorBen Skeggs <bskeggs@redhat.com>
Sat, 25 Jul 2020 06:40:07 +0000 (16:40 +1000)
committerBen Skeggs <bskeggs@redhat.com>
Thu, 11 Feb 2021 00:14:28 +0000 (10:14 +1000)
commit65a279c1a9709edc00a5859737d0abd50c029ca0
tree477e9f0480f10d94de99bcd76411b091779fe88d
parent9c28abb7db540a9c1f4dedaaf547503adfc87394
drm/nouveau/subdev: track type+instance separately

We use subdev id bitmasks (as a u64) in a number of places, and GA100 adds
enough new engine instances that we run out of bits.  We could alias IDs of
engines that no longer exist, but it's cleaner for a number of reasons to
just split the subdev index into a subdev type, and instance ID instead.

Just a lot more painful to do.

This magics up the values for old-style subdev constructors, and provides a
way to incrementally transition each subdev to the new style.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
drivers/gpu/drm/nouveau/include/nvkm/core/device.h
drivers/gpu/drm/nouveau/include/nvkm/core/subdev.h
drivers/gpu/drm/nouveau/nvkm/core/subdev.c