Commit 1ed02c3f authored by Ben Skeggs's avatar Ben Skeggs

drm/nouveau/engine: add HAL for engine-specific rc reset procedure

Will be used to improve gr reset on GF100 and newer.
Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
Reviewed-by: default avatarLyude Paul <lyude@redhat.com>
parent d2922879
...@@ -21,6 +21,7 @@ struct nvkm_engine_func { ...@@ -21,6 +21,7 @@ struct nvkm_engine_func {
int (*info)(struct nvkm_engine *, u64 mthd, u64 *data); int (*info)(struct nvkm_engine *, u64 mthd, u64 *data);
int (*init)(struct nvkm_engine *); int (*init)(struct nvkm_engine *);
int (*fini)(struct nvkm_engine *, bool suspend); int (*fini)(struct nvkm_engine *, bool suspend);
int (*reset)(struct nvkm_engine *);
void (*intr)(struct nvkm_engine *); void (*intr)(struct nvkm_engine *);
void (*tile)(struct nvkm_engine *, int region, struct nvkm_fb_tile *); void (*tile)(struct nvkm_engine *, int region, struct nvkm_fb_tile *);
bool (*chsw_load)(struct nvkm_engine *); bool (*chsw_load)(struct nvkm_engine *);
...@@ -48,6 +49,7 @@ int nvkm_engine_new_(const struct nvkm_engine_func *, struct nvkm_device *, ...@@ -48,6 +49,7 @@ int nvkm_engine_new_(const struct nvkm_engine_func *, struct nvkm_device *,
struct nvkm_engine *nvkm_engine_ref(struct nvkm_engine *); struct nvkm_engine *nvkm_engine_ref(struct nvkm_engine *);
void nvkm_engine_unref(struct nvkm_engine **); void nvkm_engine_unref(struct nvkm_engine **);
int nvkm_engine_reset(struct nvkm_engine *);
void nvkm_engine_tile(struct nvkm_engine *, int region); void nvkm_engine_tile(struct nvkm_engine *, int region);
bool nvkm_engine_chsw_load(struct nvkm_engine *); bool nvkm_engine_chsw_load(struct nvkm_engine *);
#endif #endif
...@@ -35,6 +35,16 @@ nvkm_engine_chsw_load(struct nvkm_engine *engine) ...@@ -35,6 +35,16 @@ nvkm_engine_chsw_load(struct nvkm_engine *engine)
return false; return false;
} }
int
nvkm_engine_reset(struct nvkm_engine *engine)
{
if (engine->func->reset)
return engine->func->reset(engine);
nvkm_subdev_fini(&engine->subdev, false);
return nvkm_subdev_init(&engine->subdev);
}
void void
nvkm_engine_unref(struct nvkm_engine **pengine) nvkm_engine_unref(struct nvkm_engine **pengine)
{ {
......
...@@ -113,8 +113,8 @@ nvkm_runl_rc(struct nvkm_runl *runl) ...@@ -113,8 +113,8 @@ nvkm_runl_rc(struct nvkm_runl *runl)
} }
ENGN_DEBUG(engn, "resetting..."); ENGN_DEBUG(engn, "resetting...");
nvkm_subdev_fini(&engn->engine->subdev, false); /*TODO: can we do something less of a potential catastrophe on failure? */
WARN_ON(nvkm_subdev_init(&engn->engine->subdev)); WARN_ON(nvkm_engine_reset(engn->engine));
} }
/* Submit runlist update, and clear any remaining exception state. */ /* Submit runlist update, and clear any remaining exception state. */
......
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