Skip to content

Commit a6f992a

Browse files
Ben Skeggsairlied
authored andcommitted
drm/nouveau/gr/tu102-: prepare for GSP-RM
- (temporarily) disable if GSP-RM detected, will be added later - make init() optional Signed-off-by: Ben Skeggs <[email protected]> Signed-off-by: Dave Airlie <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent da1fbcc commit a6f992a

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

drivers/gpu/drm/nouveau/nvkm/engine/gr/base.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,11 @@ static int
160160
nvkm_gr_init(struct nvkm_engine *engine)
161161
{
162162
struct nvkm_gr *gr = nvkm_gr(engine);
163-
return gr->func->init(gr);
163+
164+
if (gr->func->init)
165+
return gr->func->init(gr);
166+
167+
return 0;
164168
}
165169

166170
static int

drivers/gpu/drm/nouveau/nvkm/engine/gr/ga102.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#include "ctxgf100.h"
2424

2525
#include <core/firmware.h>
26+
#include <subdev/gsp.h>
2627
#include <subdev/acr.h>
2728
#include <subdev/timer.h>
2829
#include <subdev/vfn.h>
@@ -350,5 +351,8 @@ ga102_gr_fwif[] = {
350351
int
351352
ga102_gr_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst, struct nvkm_gr **pgr)
352353
{
354+
if (nvkm_gsp_rm(device->gsp))
355+
return -ENODEV;
356+
353357
return gf100_gr_new_(ga102_gr_fwif, device, type, inst, pgr);
354358
}

drivers/gpu/drm/nouveau/nvkm/engine/gr/tu102.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
#include "gf100.h"
2323
#include "ctxgf100.h"
2424

25+
#include <subdev/gsp.h>
26+
2527
#include <nvif/class.h>
2628

2729
void
@@ -216,5 +218,8 @@ tu102_gr_fwif[] = {
216218
int
217219
tu102_gr_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst, struct nvkm_gr **pgr)
218220
{
221+
if (nvkm_gsp_rm(device->gsp))
222+
return -ENODEV;
223+
219224
return gf100_gr_new_(tu102_gr_fwif, device, type, inst, pgr);
220225
}

0 commit comments

Comments
 (0)