Commit ae5ea7f6 authored by Ben Skeggs's avatar Ben Skeggs

drm/nouveau/gr/gf100-: expose method to determine current context

MMU will need access to this info.
Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
parent 169f30b3
...@@ -12,6 +12,7 @@ u64 nvkm_gr_units(struct nvkm_gr *); ...@@ -12,6 +12,7 @@ u64 nvkm_gr_units(struct nvkm_gr *);
int nvkm_gr_tlb_flush(struct nvkm_gr *); int nvkm_gr_tlb_flush(struct nvkm_gr *);
int nvkm_gr_ctxsw_pause(struct nvkm_device *); int nvkm_gr_ctxsw_pause(struct nvkm_device *);
int nvkm_gr_ctxsw_resume(struct nvkm_device *); int nvkm_gr_ctxsw_resume(struct nvkm_device *);
u32 nvkm_gr_ctxsw_inst(struct nvkm_device *);
int nv04_gr_new(struct nvkm_device *, int, struct nvkm_gr **); int nv04_gr_new(struct nvkm_device *, int, struct nvkm_gr **);
int nv10_gr_new(struct nvkm_device *, int, struct nvkm_gr **); int nv10_gr_new(struct nvkm_device *, int, struct nvkm_gr **);
......
...@@ -25,6 +25,15 @@ ...@@ -25,6 +25,15 @@
#include <engine/fifo.h> #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 int
nvkm_gr_ctxsw_resume(struct nvkm_device *device) nvkm_gr_ctxsw_resume(struct nvkm_device *device)
{ {
......
...@@ -715,6 +715,12 @@ gf100_gr_pack_mmio[] = { ...@@ -715,6 +715,12 @@ gf100_gr_pack_mmio[] = {
* PGRAPH engine/subdev functions * PGRAPH engine/subdev functions
******************************************************************************/ ******************************************************************************/
static u32
gf100_gr_ctxsw_inst(struct nvkm_gr *gr)
{
return nvkm_rd32(gr->engine.subdev.device, 0x409b00);
}
static int static int
gf100_gr_fecs_ctrl_ctxsw(struct gf100_gr *gr, u32 mthd) gf100_gr_fecs_ctrl_ctxsw(struct gf100_gr *gr, u32 mthd)
{ {
...@@ -2058,6 +2064,7 @@ gf100_gr_ = { ...@@ -2058,6 +2064,7 @@ gf100_gr_ = {
.chsw_load = gf100_gr_chsw_load, .chsw_load = gf100_gr_chsw_load,
.ctxsw.pause = gf100_gr_fecs_stop_ctxsw, .ctxsw.pause = gf100_gr_fecs_stop_ctxsw,
.ctxsw.resume = gf100_gr_fecs_start_ctxsw, .ctxsw.resume = gf100_gr_fecs_start_ctxsw,
.ctxsw.inst = gf100_gr_ctxsw_inst,
}; };
int int
......
...@@ -30,6 +30,7 @@ struct nvkm_gr_func { ...@@ -30,6 +30,7 @@ struct nvkm_gr_func {
struct { struct {
int (*pause)(struct nvkm_gr *); int (*pause)(struct nvkm_gr *);
int (*resume)(struct nvkm_gr *); int (*resume)(struct nvkm_gr *);
u32 (*inst)(struct nvkm_gr *);
} ctxsw; } ctxsw;
struct nvkm_sclass sclass[]; struct nvkm_sclass sclass[];
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment