Commit f1f4d918 authored by Ben Skeggs's avatar Ben Skeggs

drm/nouveau/gr/gf100-: call FECS HALT_PIPE method before RC reset

Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
Reviewed-by: default avatarLyude Paul <lyude@redhat.com>
parent 6762510b
...@@ -135,6 +135,17 @@ nvkm_gr_oneinit(struct nvkm_engine *engine) ...@@ -135,6 +135,17 @@ nvkm_gr_oneinit(struct nvkm_engine *engine)
return 0; return 0;
} }
static int
nvkm_gr_reset(struct nvkm_engine *engine)
{
struct nvkm_gr *gr = nvkm_gr(engine);
if (gr->func->reset)
return gr->func->reset(gr);
return -ENOSYS;
}
static int static int
nvkm_gr_init(struct nvkm_engine *engine) nvkm_gr_init(struct nvkm_engine *engine)
{ {
...@@ -166,6 +177,7 @@ nvkm_gr = { ...@@ -166,6 +177,7 @@ nvkm_gr = {
.oneinit = nvkm_gr_oneinit, .oneinit = nvkm_gr_oneinit,
.init = nvkm_gr_init, .init = nvkm_gr_init,
.fini = nvkm_gr_fini, .fini = nvkm_gr_fini,
.reset = nvkm_gr_reset,
.intr = nvkm_gr_intr, .intr = nvkm_gr_intr,
.tile = nvkm_gr_tile, .tile = nvkm_gr_tile,
.chsw_load = nvkm_gr_chsw_load, .chsw_load = nvkm_gr_chsw_load,
......
...@@ -796,6 +796,20 @@ gf100_gr_fecs_stop_ctxsw(struct nvkm_gr *base) ...@@ -796,6 +796,20 @@ gf100_gr_fecs_stop_ctxsw(struct nvkm_gr *base)
return ret; return ret;
} }
static int
gf100_gr_fecs_halt_pipeline(struct gf100_gr *gr)
{
int ret = 0;
if (gr->firmware) {
mutex_lock(&gr->fecs.mutex);
ret = gf100_gr_fecs_ctrl_ctxsw(gr, 0x04);
mutex_unlock(&gr->fecs.mutex);
}
return ret;
}
int int
gf100_gr_fecs_wfi_golden_save(struct gf100_gr *gr, u32 inst) gf100_gr_fecs_wfi_golden_save(struct gf100_gr *gr, u32 inst)
{ {
...@@ -2247,6 +2261,24 @@ gf100_gr_init_vsc_stream_master(struct gf100_gr *gr) ...@@ -2247,6 +2261,24 @@ gf100_gr_init_vsc_stream_master(struct gf100_gr *gr)
nvkm_mask(device, TPC_UNIT(0, 0, 0x05c), 0x00000001, 0x00000001); nvkm_mask(device, TPC_UNIT(0, 0, 0x05c), 0x00000001, 0x00000001);
} }
static int
gf100_gr_reset(struct nvkm_gr *base)
{
struct nvkm_subdev *subdev = &base->engine.subdev;
struct nvkm_device *device = subdev->device;
struct gf100_gr *gr = gf100_gr(base);
nvkm_mask(device, 0x400500, 0x00000001, 0x00000000);
WARN_ON(gf100_gr_fecs_halt_pipeline(gr));
subdev->func->fini(subdev, false);
nvkm_mc_disable(device, subdev->type, subdev->inst);
nvkm_mc_enable(device, subdev->type, subdev->inst);
return subdev->func->init(subdev);
}
int int
gf100_gr_init(struct gf100_gr *gr) gf100_gr_init(struct gf100_gr *gr)
{ {
...@@ -2392,6 +2424,7 @@ gf100_gr_ = { ...@@ -2392,6 +2424,7 @@ gf100_gr_ = {
.oneinit = gf100_gr_oneinit, .oneinit = gf100_gr_oneinit,
.init = gf100_gr_init_, .init = gf100_gr_init_,
.fini = gf100_gr_fini, .fini = gf100_gr_fini,
.reset = gf100_gr_reset,
.intr = gf100_gr_intr, .intr = gf100_gr_intr,
.units = gf100_gr_units, .units = gf100_gr_units,
.chan_new = gf100_gr_chan_new, .chan_new = gf100_gr_chan_new,
......
...@@ -17,6 +17,7 @@ struct nvkm_gr_func { ...@@ -17,6 +17,7 @@ struct nvkm_gr_func {
int (*oneinit)(struct nvkm_gr *); int (*oneinit)(struct nvkm_gr *);
int (*init)(struct nvkm_gr *); int (*init)(struct nvkm_gr *);
int (*fini)(struct nvkm_gr *, bool); int (*fini)(struct nvkm_gr *, bool);
int (*reset)(struct nvkm_gr *);
void (*intr)(struct nvkm_gr *); void (*intr)(struct nvkm_gr *);
void (*tile)(struct nvkm_gr *, int region, struct nvkm_fb_tile *); void (*tile)(struct nvkm_gr *, int region, struct nvkm_fb_tile *);
int (*tlb_flush)(struct nvkm_gr *); int (*tlb_flush)(struct nvkm_gr *);
......
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