Commit f0d13e3a authored by Ilia Mirkin's avatar Ilia Mirkin Committed by Ben Skeggs

drm/nouveau/device: provide a way for devinit to mark engines as disabled

Signed-off-by: default avatarIlia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
parent cf336014
...@@ -42,11 +42,24 @@ nouveau_engine_create_(struct nouveau_object *parent, ...@@ -42,11 +42,24 @@ nouveau_engine_create_(struct nouveau_object *parent,
if (ret) if (ret)
return ret; return ret;
if ( parent && if (parent) {
!nouveau_boolopt(nv_device(parent)->cfgopt, iname, enable)) { struct nouveau_device *device = nv_device(parent);
if (!enable) int engidx = nv_engidx(nv_object(engine));
nv_warn(engine, "disabled, %s=1 to enable\n", iname);
return -ENODEV; if (device->disable_mask & (1ULL << engidx)) {
if (!nouveau_boolopt(device->cfgopt, iname, false)) {
nv_debug(engine, "engine disabled by hw/fw\n");
return -ENODEV;
}
nv_warn(engine, "ignoring hw/fw engine disable\n");
}
if (!nouveau_boolopt(device->cfgopt, iname, enable)) {
if (!enable)
nv_warn(engine, "disabled, %s=1 to enable\n", iname);
return -ENODEV;
}
} }
INIT_LIST_HEAD(&engine->contexts); INIT_LIST_HEAD(&engine->contexts);
......
...@@ -71,6 +71,7 @@ struct nouveau_device { ...@@ -71,6 +71,7 @@ struct nouveau_device {
const char *dbgopt; const char *dbgopt;
const char *name; const char *name;
const char *cname; const char *cname;
u64 disable_mask;
enum { enum {
NV_04 = 0x04, NV_04 = 0x04,
......
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