drm/nouveau/gsp: add usermode class id to gpu hal

Use usermode class ID from nvkm_rm_gpu, instead of copying it from the
non-GSP HALs.

Signed-off-by: Ben Skeggs <bskeggs@nvidia.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Timur Tabi <ttabi@nvidia.com>
Tested-by: Timur Tabi <ttabi@nvidia.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
This commit is contained in:
Ben Skeggs 2025-02-18 20:33:39 +10:00 committed by Dave Airlie
parent 0fac5141d6
commit cd3c62282b
6 changed files with 22 additions and 2 deletions

View file

@ -16,4 +16,6 @@ ad10x_gpu = {
.wimm = GA102_DISP_WINDOW_IMM_CHANNEL_DMA,
.curs = GA102_DISP_CURSOR,
},
.usermode.class = AMPERE_USERMODE_A,
};

View file

@ -4,6 +4,9 @@
*/
#include "gpu.h"
#include <nvif/class.h>
const struct nvkm_rm_gpu
ga100_gpu = {
.usermode.class = AMPERE_USERMODE_A,
};

View file

@ -16,4 +16,6 @@ ga1xx_gpu = {
.wimm = GA102_DISP_WINDOW_IMM_CHANNEL_DMA,
.curs = GA102_DISP_CURSOR,
},
.usermode.class = AMPERE_USERMODE_A,
};

View file

@ -17,6 +17,10 @@ struct nvkm_rm_gpu {
u32 curs;
} class;
} disp;
struct {
u32 class;
} usermode;
};
extern const struct nvkm_rm_gpu tu1xx_gpu;

View file

@ -16,4 +16,6 @@ tu1xx_gpu = {
.wimm = TU102_DISP_WINDOW_IMM_CHANNEL_DMA,
.curs = TU102_DISP_CURSOR,
},
.usermode.class = TURING_USERMODE_A,
};

View file

@ -21,6 +21,8 @@
*/
#include "priv.h"
#include <rm/gpu.h>
static void
r535_vfn_dtor(struct nvkm_vfn *vfn)
{
@ -32,6 +34,7 @@ r535_vfn_new(const struct nvkm_vfn_func *hw,
struct nvkm_device *device, enum nvkm_subdev_type type, int inst, u32 addr,
struct nvkm_vfn **pvfn)
{
const struct nvkm_rm_gpu *gpu = device->gsp->rm->gpu;
struct nvkm_vfn_func *rm;
int ret;
@ -39,8 +42,12 @@ r535_vfn_new(const struct nvkm_vfn_func *hw,
return -ENOMEM;
rm->dtor = r535_vfn_dtor;
rm->intr = hw->intr;
rm->user = hw->user;
rm->intr = &tu102_vfn_intr,
rm->user.addr = 0x030000;
rm->user.size = 0x010000;
rm->user.base.minver = -1;
rm->user.base.maxver = -1;
rm->user.base.oclass = gpu->usermode.class;
ret = nvkm_vfn_new_(rm, device, type, inst, addr, pvfn);
if (ret)