Commit 8000fb21 authored by Ben Skeggs's avatar Ben Skeggs

drm/nouveau/core: can now assume client/device object tree based on object.engine

Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
parent bdda4703
...@@ -64,11 +64,13 @@ nv_printk_(struct nouveau_object *object, int level, const char *fmt, ...) ...@@ -64,11 +64,13 @@ nv_printk_(struct nouveau_object *object, int level, const char *fmt, ...)
struct nouveau_object *subdev; struct nouveau_object *subdev;
char obuf[64], *ofmt = ""; char obuf[64], *ofmt = "";
subdev = object; if (object->engine == NULL) {
while (subdev && !nv_iclass(subdev, NV_SUBDEV_CLASS)) subdev = object;
subdev = subdev->parent; while (subdev && !nv_iclass(subdev, NV_SUBDEV_CLASS))
if (!subdev) subdev = subdev->parent;
} else {
subdev = object->engine; subdev = object->engine;
}
device = subdev; device = subdev;
if (device->parent) if (device->parent)
......
...@@ -512,9 +512,10 @@ struct nouveau_device * ...@@ -512,9 +512,10 @@ struct nouveau_device *
nv_device(void *obj) nv_device(void *obj)
{ {
struct nouveau_object *device = nv_object(obj); struct nouveau_object *device = nv_object(obj);
while (device && device->parent) if (device->engine == NULL) {
device = device->parent; while (device && device->parent)
if (!nv_iclass(device, NV_ENGINE_CLASS)) { device = device->parent;
} else {
device = nv_object(obj)->engine; device = nv_object(obj)->engine;
if (device && device->parent) if (device && device->parent)
device = device->parent; device = device->parent;
......
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