drm/nouveau/core: add engine method to assist in determining chsw direction
authorBen Skeggs <bskeggs@redhat.com>
Mon, 16 Jan 2017 00:22:59 +0000 (10:22 +1000)
committerBen Skeggs <bskeggs@redhat.com>
Fri, 17 Feb 2017 07:38:10 +0000 (17:38 +1000)
FIFO gives us load/save/switch status, and we need to be able to determine
which direction a "switch" is failing during channel recovery.

In order to do this, we apparently need to query the engine itself.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drivers/gpu/drm/nouveau/include/nvkm/core/engine.h
drivers/gpu/drm/nouveau/nvkm/core/engine.c

index 9ebfd8782366005ec54ea2536848b1cf4650f14f..d4cd2fbfde885eb0797b95bf9b725c470bde8094 100644 (file)
@@ -20,6 +20,7 @@ struct nvkm_engine_func {
        int (*fini)(struct nvkm_engine *, bool suspend);
        void (*intr)(struct nvkm_engine *);
        void (*tile)(struct nvkm_engine *, int region, struct nvkm_fb_tile *);
+       bool (*chsw_load)(struct nvkm_engine *);
 
        struct {
                int (*sclass)(struct nvkm_oclass *, int index,
@@ -44,4 +45,5 @@ int nvkm_engine_new_(const struct nvkm_engine_func *, struct nvkm_device *,
 struct nvkm_engine *nvkm_engine_ref(struct nvkm_engine *);
 void nvkm_engine_unref(struct nvkm_engine **);
 void nvkm_engine_tile(struct nvkm_engine *, int region);
+bool nvkm_engine_chsw_load(struct nvkm_engine *);
 #endif
index ee8e5831fe374ddef75dd60e2bc597e4c176e8c3..b6c916954a1076aca6d5fcf5b31f0a83b2540ec5 100644 (file)
 
 #include <subdev/fb.h>
 
+bool
+nvkm_engine_chsw_load(struct nvkm_engine *engine)
+{
+       if (engine->func->chsw_load)
+               return engine->func->chsw_load(engine);
+       return false;
+}
+
 void
 nvkm_engine_unref(struct nvkm_engine **pengine)
 {