diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2022-06-01 12:48:04 +0200 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2022-11-09 01:45:10 +0100 |
commit | 0ceceaa9ae8294b0da91d731027b5c4b1bb4187e (patch) | |
tree | 4e4619712b84dea60f8f8add3ba4944cd9a959c0 /drivers/gpu/drm/nouveau/nvkm/engine/fifo/base.c | |
parent | drm/nouveau/ltc: split color vs depth/stencil zbc counts (diff) | |
download | linux-0ceceaa9ae8294b0da91d731027b5c4b1bb4187e.tar.xz linux-0ceceaa9ae8294b0da91d731027b5c4b1bb4187e.zip |
drm/nouveau/fifo: expose function to read engine ctxsw status
Needed to support Ampere differences in gr/gf100-:
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nvkm/engine/fifo/base.c')
-rw-r--r-- | drivers/gpu/drm/nouveau/nvkm/engine/fifo/base.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/fifo/base.c b/drivers/gpu/drm/nouveau/nvkm/engine/fifo/base.c index abce1ecfd4d4..5ea9a2ff0663 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/fifo/base.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/fifo/base.c @@ -35,6 +35,22 @@ #include <nvif/cl0080.h> #include <nvif/unpack.h> +bool +nvkm_fifo_ctxsw_in_progress(struct nvkm_engine *engine) +{ + struct nvkm_runl *runl; + struct nvkm_engn *engn; + + nvkm_runl_foreach(runl, engine->subdev.device->fifo) { + nvkm_runl_foreach_engn(engn, runl) { + if (engn->engine == engine) + return engn->func->chsw ? engn->func->chsw(engn) : false; + } + } + + return false; +} + void nvkm_fifo_pause(struct nvkm_fifo *fifo, unsigned long *flags) { |