diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2019-02-05 14:54:53 +1000 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2019-02-20 09:00:00 +1000 |
commit | ae5ea7f6a8117c8615de4203a105ab3de7766def (patch) | |
tree | 1c51b280b98c28b6c8f9e04c5e4fe173e863d246 /drivers/gpu/drm/nouveau/nvkm | |
parent | 169f30b35d66c8d041173ba69e03090fe4caa228 (diff) | |
download | linux-ae5ea7f6a8117c8615de4203a105ab3de7766def.tar.bz2 |
drm/nouveau/gr/gf100-: expose method to determine current context
MMU will need access to this info.
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nvkm')
-rw-r--r-- | drivers/gpu/drm/nouveau/nvkm/engine/gr/base.c | 9 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nvkm/engine/gr/gf100.c | 7 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nvkm/engine/gr/priv.h | 1 |
3 files changed, 17 insertions, 0 deletions
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/gr/base.c b/drivers/gpu/drm/nouveau/nvkm/engine/gr/base.c index 53f62827260b..d41fb94524e9 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/gr/base.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/gr/base.c @@ -25,6 +25,15 @@ #include <engine/fifo.h> +u32 +nvkm_gr_ctxsw_inst(struct nvkm_device *device) +{ + struct nvkm_gr *gr = device->gr; + if (gr && gr->func->ctxsw.inst) + return gr->func->ctxsw.inst(gr); + return 0; +} + int nvkm_gr_ctxsw_resume(struct nvkm_device *device) { diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/gr/gf100.c b/drivers/gpu/drm/nouveau/nvkm/engine/gr/gf100.c index 63802edf89d4..81a13cf9a292 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/gr/gf100.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/gr/gf100.c @@ -715,6 +715,12 @@ gf100_gr_pack_mmio[] = { * PGRAPH engine/subdev functions ******************************************************************************/ +static u32 +gf100_gr_ctxsw_inst(struct nvkm_gr *gr) +{ + return nvkm_rd32(gr->engine.subdev.device, 0x409b00); +} + static int gf100_gr_fecs_ctrl_ctxsw(struct gf100_gr *gr, u32 mthd) { @@ -2058,6 +2064,7 @@ gf100_gr_ = { .chsw_load = gf100_gr_chsw_load, .ctxsw.pause = gf100_gr_fecs_stop_ctxsw, .ctxsw.resume = gf100_gr_fecs_start_ctxsw, + .ctxsw.inst = gf100_gr_ctxsw_inst, }; int diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/gr/priv.h b/drivers/gpu/drm/nouveau/nvkm/engine/gr/priv.h index b8023a6b77a1..d4d5601c51e7 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/gr/priv.h +++ b/drivers/gpu/drm/nouveau/nvkm/engine/gr/priv.h @@ -30,6 +30,7 @@ struct nvkm_gr_func { struct { int (*pause)(struct nvkm_gr *); int (*resume)(struct nvkm_gr *); + u32 (*inst)(struct nvkm_gr *); } ctxsw; struct nvkm_sclass sclass[]; }; |