Skip to content

Commit 3cd7924

Browse files
Ben Skeggsairlied
authored andcommitted
drm/nouveau/mc/tu102-: prepare for GSP-RM
- disable MC completely when GSP-RM detected Signed-off-by: Ben Skeggs <bskeggs@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com> Link: https://patchwork.freedesktop.org/patch/msgid/20230918202149.4343-17-skeggsb@gmail.com
1 parent 1dc750d commit 3cd7924

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

drivers/gpu/drm/nouveau/nvkm/subdev/mc/ga100.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
*/
2222
#include "priv.h"
2323

24+
#include <subdev/gsp.h>
25+
2426
static void
2527
ga100_mc_device_disable(struct nvkm_mc *mc, u32 mask)
2628
{
@@ -72,5 +74,8 @@ ga100_mc = {
7274
int
7375
ga100_mc_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst, struct nvkm_mc **pmc)
7476
{
77+
if (nvkm_gsp_rm(device->gsp))
78+
return -ENODEV;
79+
7580
return nvkm_mc_new_(&ga100_mc, device, type, inst, pmc);
7681
}

drivers/gpu/drm/nouveau/nvkm/subdev/mc/gp100.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323
*/
2424
#include "priv.h"
2525

26+
#include <subdev/gsp.h>
27+
2628
const struct nvkm_intr_data
2729
gp100_mc_intrs[] = {
2830
{ NVKM_ENGINE_DISP , 0, 0, 0x04000000, true },
@@ -98,5 +100,8 @@ gp100_mc = {
98100
int
99101
gp100_mc_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst, struct nvkm_mc **pmc)
100102
{
103+
if (nvkm_gsp_rm(device->gsp))
104+
return -ENODEV;
105+
101106
return nvkm_mc_new_(&gp100_mc, device, type, inst, pmc);
102107
}

0 commit comments

Comments
 (0)