]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
drm/nouveau/gr/tu102-: prepare for GSP-RM
authorBen Skeggs <bskeggs@redhat.com>
Mon, 18 Sep 2023 20:21:31 +0000 (06:21 +1000)
committerDave Airlie <airlied@redhat.com>
Tue, 31 Oct 2023 05:08:14 +0000 (15:08 +1000)
- (temporarily) disable if GSP-RM detected, will be added later
- make init() optional

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-27-skeggsb@gmail.com
drivers/gpu/drm/nouveau/nvkm/engine/gr/base.c
drivers/gpu/drm/nouveau/nvkm/engine/gr/ga102.c
drivers/gpu/drm/nouveau/nvkm/engine/gr/tu102.c

index 0096ad401b15321d2b535107cc09ab2f542b9f0e..f5e68f09df768d4486fb1909e40e8a2dcdf1024d 100644 (file)
@@ -160,7 +160,11 @@ static int
 nvkm_gr_init(struct nvkm_engine *engine)
 {
        struct nvkm_gr *gr = nvkm_gr(engine);
-       return gr->func->init(gr);
+
+       if (gr->func->init)
+               return gr->func->init(gr);
+
+       return 0;
 }
 
 static int
index 00cd70abad67e2cb601916035666f1934f3090db..2b51f1d0c281f2cc5e518597691343181aab91ae 100644 (file)
@@ -23,6 +23,7 @@
 #include "ctxgf100.h"
 
 #include <core/firmware.h>
+#include <subdev/gsp.h>
 #include <subdev/acr.h>
 #include <subdev/timer.h>
 #include <subdev/vfn.h>
@@ -350,5 +351,8 @@ ga102_gr_fwif[] = {
 int
 ga102_gr_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst, struct nvkm_gr **pgr)
 {
+       if (nvkm_gsp_rm(device->gsp))
+               return -ENODEV;
+
        return gf100_gr_new_(ga102_gr_fwif, device, type, inst, pgr);
 }
index a7775aa185415a35ac3851237b1cda4aedc835c8..bda8054c6b59cc31c6cde3483ae574c9ef8a436b 100644 (file)
@@ -22,6 +22,8 @@
 #include "gf100.h"
 #include "ctxgf100.h"
 
+#include <subdev/gsp.h>
+
 #include <nvif/class.h>
 
 void
@@ -216,5 +218,8 @@ tu102_gr_fwif[] = {
 int
 tu102_gr_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst, struct nvkm_gr **pgr)
 {
+       if (nvkm_gsp_rm(device->gsp))
+               return -ENODEV;
+
        return gf100_gr_new_(tu102_gr_fwif, device, type, inst, pgr);
 }