Commit 5e721ad1 authored by Ben Skeggs's avatar Ben Skeggs

drm/nouveau/fifo: perform reset from preinit

RM appears to do this really early in its initialisation, before DEVINIT.

We currently do this before BAR2 initialisation for some reason.
Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
parent b5078d73
...@@ -15,6 +15,7 @@ struct nvkm_engine { ...@@ -15,6 +15,7 @@ struct nvkm_engine {
struct nvkm_engine_func { struct nvkm_engine_func {
void *(*dtor)(struct nvkm_engine *); void *(*dtor)(struct nvkm_engine *);
void (*preinit)(struct nvkm_engine *);
int (*oneinit)(struct nvkm_engine *); int (*oneinit)(struct nvkm_engine *);
int (*init)(struct nvkm_engine *); int (*init)(struct nvkm_engine *);
int (*fini)(struct nvkm_engine *, bool suspend); int (*fini)(struct nvkm_engine *, bool suspend);
......
...@@ -126,6 +126,15 @@ nvkm_engine_init(struct nvkm_subdev *subdev) ...@@ -126,6 +126,15 @@ nvkm_engine_init(struct nvkm_subdev *subdev)
return ret; return ret;
} }
static int
nvkm_engine_preinit(struct nvkm_subdev *subdev)
{
struct nvkm_engine *engine = nvkm_engine(subdev);
if (engine->func->preinit)
engine->func->preinit(engine);
return 0;
}
static void * static void *
nvkm_engine_dtor(struct nvkm_subdev *subdev) nvkm_engine_dtor(struct nvkm_subdev *subdev)
{ {
...@@ -138,6 +147,7 @@ nvkm_engine_dtor(struct nvkm_subdev *subdev) ...@@ -138,6 +147,7 @@ nvkm_engine_dtor(struct nvkm_subdev *subdev)
static const struct nvkm_subdev_func static const struct nvkm_subdev_func
nvkm_engine_func = { nvkm_engine_func = {
.dtor = nvkm_engine_dtor, .dtor = nvkm_engine_dtor,
.preinit = nvkm_engine_preinit,
.init = nvkm_engine_init, .init = nvkm_engine_init,
.fini = nvkm_engine_fini, .fini = nvkm_engine_fini,
.intr = nvkm_engine_intr, .intr = nvkm_engine_intr,
......
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
#include <core/client.h> #include <core/client.h>
#include <core/gpuobj.h> #include <core/gpuobj.h>
#include <core/notify.h> #include <core/notify.h>
#include <subdev/mc.h>
#include <nvif/event.h> #include <nvif/event.h>
#include <nvif/unpack.h> #include <nvif/unpack.h>
...@@ -278,6 +279,12 @@ nvkm_fifo_oneinit(struct nvkm_engine *engine) ...@@ -278,6 +279,12 @@ nvkm_fifo_oneinit(struct nvkm_engine *engine)
return 0; return 0;
} }
static void
nvkm_fifo_preinit(struct nvkm_engine *engine)
{
nvkm_mc_reset(engine->subdev.device, NVKM_ENGINE_FIFO);
}
static int static int
nvkm_fifo_init(struct nvkm_engine *engine) nvkm_fifo_init(struct nvkm_engine *engine)
{ {
...@@ -302,6 +309,7 @@ nvkm_fifo_dtor(struct nvkm_engine *engine) ...@@ -302,6 +309,7 @@ nvkm_fifo_dtor(struct nvkm_engine *engine)
static const struct nvkm_engine_func static const struct nvkm_engine_func
nvkm_fifo = { nvkm_fifo = {
.dtor = nvkm_fifo_dtor, .dtor = nvkm_fifo_dtor,
.preinit = nvkm_fifo_preinit,
.oneinit = nvkm_fifo_oneinit, .oneinit = nvkm_fifo_oneinit,
.init = nvkm_fifo_init, .init = nvkm_fifo_init,
.fini = nvkm_fifo_fini, .fini = nvkm_fifo_fini,
......
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