Skip to content

Commit

Permalink
drm/nouveau/device: provide a way for devinit to mark engines as disa…
Browse files Browse the repository at this point in the history
…bled

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
  • Loading branch information
Ilia Mirkin authored and Ben Skeggs committed Jan 23, 2014
1 parent cf33601 commit f0d13e3
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 5 deletions.
23 changes: 18 additions & 5 deletions drivers/gpu/drm/nouveau/core/core/engine.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,24 @@ nouveau_engine_create_(struct nouveau_object *parent,
if (ret)
return ret;

if ( parent &&
!nouveau_boolopt(nv_device(parent)->cfgopt, iname, enable)) {
if (!enable)
nv_warn(engine, "disabled, %s=1 to enable\n", iname);
return -ENODEV;
if (parent) {
struct nouveau_device *device = nv_device(parent);
int engidx = nv_engidx(nv_object(engine));

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);
Expand Down
1 change: 1 addition & 0 deletions drivers/gpu/drm/nouveau/core/include/core/device.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ struct nouveau_device {
const char *dbgopt;
const char *name;
const char *cname;
u64 disable_mask;

enum {
NV_04 = 0x04,
Expand Down

0 comments on commit f0d13e3

Please sign in to comment.