فهرست منبع

drm/nouveau/core: add engine method to assist in determining chsw direction

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>
Ben Skeggs 8 سال پیش
والد
کامیت
17041c7eef
2فایلهای تغییر یافته به همراه10 افزوده شده و 0 حذف شده
  1. 2 0
      drivers/gpu/drm/nouveau/include/nvkm/core/engine.h
  2. 8 0
      drivers/gpu/drm/nouveau/nvkm/core/engine.c

+ 2 - 0
drivers/gpu/drm/nouveau/include/nvkm/core/engine.h

@@ -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

+ 8 - 0
drivers/gpu/drm/nouveau/nvkm/core/engine.c

@@ -27,6 +27,14 @@
 
 #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)
 {