diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2015-08-20 07:54:16 +0300 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2015-08-28 05:40:32 +0300 |
commit | bf81df9be28657eea4aca8c6ab4ed3e69f8a051c (patch) | |
tree | a4a7e6f3d4e46696584c930bb7d6b4b2fd941337 /drivers/gpu/drm/nouveau/nvif | |
parent | a01ca78c8f118e5a24f1527ecf078ab56ddd4805 (diff) | |
download | linux-bf81df9be28657eea4aca8c6ab4ed3e69f8a051c.tar.xz |
drm/nouveau/nvif: replace path-based object identification
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nvif')
-rw-r--r-- | drivers/gpu/drm/nouveau/nvif/client.c | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nvif/object.c | 17 |
2 files changed, 7 insertions, 12 deletions
diff --git a/drivers/gpu/drm/nouveau/nvif/client.c b/drivers/gpu/drm/nouveau/nvif/client.c index 4a830ebf9661..64d3d0c37a83 100644 --- a/drivers/gpu/drm/nouveau/nvif/client.c +++ b/drivers/gpu/drm/nouveau/nvif/client.c @@ -50,7 +50,6 @@ nvif_client_fini(struct nvif_client *client) if (client->driver) { client->driver->fini(client->object.priv); client->driver = NULL; - client->object.parent = NULL; client->object.client = NULL; nvif_object_fini(&client->object); } @@ -79,7 +78,6 @@ nvif_client_init(const char *driver, const char *name, u64 device, return ret; client->object.client = client; - client->object.parent = &client->object; client->object.handle = ~0; client->route = NVIF_IOCTL_V0_ROUTE_NVIF; client->super = true; diff --git a/drivers/gpu/drm/nouveau/nvif/object.c b/drivers/gpu/drm/nouveau/nvif/object.c index a727f72ca234..b914e34a43c3 100644 --- a/drivers/gpu/drm/nouveau/nvif/object.c +++ b/drivers/gpu/drm/nouveau/nvif/object.c @@ -36,14 +36,11 @@ nvif_object_ioctl(struct nvif_object *object, void *data, u32 size, void **hack) } *args = data; if (size >= sizeof(*args) && args->v0.version == 0) { + if (object != &client->object) + args->v0.object = nvif_handle(object); + else + args->v0.object = 0; args->v0.owner = NVIF_IOCTL_V0_OWNER_ANY; - args->v0.path_nr = 0; - while (args->v0.path_nr < ARRAY_SIZE(args->v0.path)) { - args->v0.path[args->v0.path_nr++] = object->handle; - if (object->parent == object) - break; - object = object->parent; - } } else return -ENOSYS; @@ -216,13 +213,12 @@ nvif_object_init(struct nvif_object *parent, u32 handle, u32 oclass, int ret = 0; object->client = NULL; - object->parent = parent; object->handle = handle; object->oclass = oclass; object->map.ptr = NULL; object->map.size = 0; - if (object->parent) { + if (parent) { if (!(args = kmalloc(sizeof(*args) + size, GFP_KERNEL))) { nvif_object_fini(object); return -ENOMEM; @@ -232,7 +228,8 @@ nvif_object_init(struct nvif_object *parent, u32 handle, u32 oclass, args->ioctl.type = NVIF_IOCTL_V0_NEW; args->new.version = 0; args->new.route = parent->client->route; - args->new.token = (unsigned long)(void *)object; + args->new.token = nvif_handle(object); + args->new.object = nvif_handle(object); args->new.handle = handle; args->new.oclass = oclass; |