drm/nouveau/core/object: pass more args in oclass
authorBen Skeggs <bskeggs@redhat.com>
Wed, 25 May 2016 07:47:18 +0000 (17:47 +1000)
committerBen Skeggs <bskeggs@redhat.com>
Fri, 17 Feb 2017 05:14:58 +0000 (15:14 +1000)
The fields were already in struct nvkm_oclass for some reason (probably
as an accidental left-over).

Preparation for supporting subclients.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drivers/gpu/drm/nouveau/nvkm/core/ioctl.c
drivers/gpu/drm/nouveau/nvkm/core/object.c

index b43ce4e724e8b2a509a29e067213790f93471c82..25c800b426ca5c25e1921c5161a7406b38af64ad 100644 (file)
@@ -106,9 +106,11 @@ nvkm_ioctl_new(struct nvkm_client *client,
 
        do {
                memset(&oclass, 0x00, sizeof(oclass));
-               oclass.client = client;
                oclass.handle = args->v0.handle;
+               oclass.route  = args->v0.route;
+               oclass.token  = args->v0.token;
                oclass.object = args->v0.object;
+               oclass.client = client;
                oclass.parent = parent;
                ret = parent->func->sclass(parent, i++, &oclass);
                if (ret)
@@ -127,9 +129,6 @@ nvkm_ioctl_new(struct nvkm_client *client,
                ret = nvkm_object_init(object);
                if (ret == 0) {
                        list_add(&object->head, &parent->tree);
-                       object->route = args->v0.route;
-                       object->token = args->v0.token;
-                       object->object = args->v0.object;
                        if (nvkm_object_insert(object)) {
                                client->data = object;
                                return 0;
index 218f932b102211453a710b27479847362a009b66..89d2e9da11c78aba5514acd1ec078b06475ae5f4 100644 (file)
@@ -289,6 +289,9 @@ nvkm_object_ctor(const struct nvkm_object_func *func,
        object->engine = nvkm_engine_ref(oclass->engine);
        object->oclass = oclass->base.oclass;
        object->handle = oclass->handle;
+       object->route  = oclass->route;
+       object->token  = oclass->token;
+       object->object = oclass->object;
        INIT_LIST_HEAD(&object->head);
        INIT_LIST_HEAD(&object->tree);
        RB_CLEAR_NODE(&object->node);