diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2014-12-05 12:21:34 +1000 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2015-01-22 12:14:54 +1000 |
commit | 8000fb219179e0be23cef03588dcd6c00a2035f3 (patch) | |
tree | 5170b688ad8932989096aa58408a0b6fcc973b64 /drivers | |
parent | bdda4703f145ef5a098d100a071e272a65abd01d (diff) | |
download | op-kernel-dev-8000fb219179e0be23cef03588dcd6c00a2035f3.zip op-kernel-dev-8000fb219179e0be23cef03588dcd6c00a2035f3.tar.gz |
drm/nouveau/core: can now assume client/device object tree based on object.engine
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpu/drm/nouveau/core/core/printk.c | 10 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/core/engine/device/base.c | 7 |
2 files changed, 10 insertions, 7 deletions
diff --git a/drivers/gpu/drm/nouveau/core/core/printk.c b/drivers/gpu/drm/nouveau/core/core/printk.c index 1060e3a..81f5596 100644 --- a/drivers/gpu/drm/nouveau/core/core/printk.c +++ b/drivers/gpu/drm/nouveau/core/core/printk.c @@ -64,11 +64,13 @@ nv_printk_(struct nouveau_object *object, int level, const char *fmt, ...) struct nouveau_object *subdev; char obuf[64], *ofmt = ""; - subdev = object; - while (subdev && !nv_iclass(subdev, NV_SUBDEV_CLASS)) - subdev = subdev->parent; - if (!subdev) + if (object->engine == NULL) { + subdev = object; + while (subdev && !nv_iclass(subdev, NV_SUBDEV_CLASS)) + subdev = subdev->parent; + } else { subdev = object->engine; + } device = subdev; if (device->parent) diff --git a/drivers/gpu/drm/nouveau/core/engine/device/base.c b/drivers/gpu/drm/nouveau/core/engine/device/base.c index 7c0cbcd..0a6abc2 100644 --- a/drivers/gpu/drm/nouveau/core/engine/device/base.c +++ b/drivers/gpu/drm/nouveau/core/engine/device/base.c @@ -512,9 +512,10 @@ struct nouveau_device * nv_device(void *obj) { struct nouveau_object *device = nv_object(obj); - while (device && device->parent) - device = device->parent; - if (!nv_iclass(device, NV_ENGINE_CLASS)) { + if (device->engine == NULL) { + while (device && device->parent) + device = device->parent; + } else { device = nv_object(obj)->engine; if (device && device->parent) device = device->parent; |