[Nouveau] [PATCH v2 12/15] gr: add fini() hook
Alexandre Courbot
acourbot at nvidia.com
Tue Dec 13 08:11:28 UTC 2016
Add a fini() hook to the GR engine. This will be used by gf100+ to
properly release the FECS and GPCCS falcons.
Signed-off-by: Alexandre Courbot <acourbot at nvidia.com>
---
drm/nouveau/nvkm/engine/gr/base.c | 10 ++++++++++
drm/nouveau/nvkm/engine/gr/priv.h | 1 +
2 files changed, 11 insertions(+), 0 deletions(-)
diff --git a/drm/nouveau/nvkm/engine/gr/base.c b/drm/nouveau/nvkm/engine/gr/base.c
index 467065d1b4e6..a8282edc2b58 100644
--- a/drm/nouveau/nvkm/engine/gr/base.c
+++ b/drm/nouveau/nvkm/engine/gr/base.c
@@ -106,6 +106,15 @@ nvkm_gr_init(struct nvkm_engine *engine)
return gr->func->init(gr);
}
+static int
+nvkm_gr_fini(struct nvkm_engine *engine, bool suspend)
+{
+ struct nvkm_gr *gr = nvkm_gr(engine);
+ if (gr->func->fini)
+ return gr->func->fini(gr, suspend);
+ return 0;
+}
+
static void *
nvkm_gr_dtor(struct nvkm_engine *engine)
{
@@ -120,6 +129,7 @@ nvkm_gr = {
.dtor = nvkm_gr_dtor,
.oneinit = nvkm_gr_oneinit,
.init = nvkm_gr_init,
+ .fini = nvkm_gr_fini,
.intr = nvkm_gr_intr,
.tile = nvkm_gr_tile,
.fifo.cclass = nvkm_gr_cclass_new,
diff --git a/drm/nouveau/nvkm/engine/gr/priv.h b/drm/nouveau/nvkm/engine/gr/priv.h
index d8adcdf6985a..0d6d940a744f 100644
--- a/drm/nouveau/nvkm/engine/gr/priv.h
+++ b/drm/nouveau/nvkm/engine/gr/priv.h
@@ -15,6 +15,7 @@ struct nvkm_gr_func {
void *(*dtor)(struct nvkm_gr *);
int (*oneinit)(struct nvkm_gr *);
int (*init)(struct nvkm_gr *);
+ int (*fini)(struct nvkm_gr *, bool);
void (*intr)(struct nvkm_gr *);
void (*tile)(struct nvkm_gr *, int region, struct nvkm_fb_tile *);
int (*tlb_flush)(struct nvkm_gr *);
--
git-series 0.8.10
More information about the Nouveau
mailing list