Lines Matching refs:object
31 nvif_object_ioctl(struct nvif_object *object, void *data, u32 size, void **hack) in nvif_object_ioctl() argument
33 struct nvif_client *client = nvif_client(object); in nvif_object_ioctl()
42 args->v0.path[args->v0.path_nr++] = object->handle; in nvif_object_ioctl()
43 if (object->parent == object) in nvif_object_ioctl()
45 object = object->parent; in nvif_object_ioctl()
54 nvif_object_sclass(struct nvif_object *object, u32 *oclass, int count) in nvif_object_sclass() argument
71 ret = nvif_object_ioctl(object, args, sizeof(*args) + size, NULL); in nvif_object_sclass()
79 nvif_object_rd(struct nvif_object *object, int size, u64 addr) in nvif_object_rd() argument
89 int ret = nvif_object_ioctl(object, &args, sizeof(args), NULL); in nvif_object_rd()
98 nvif_object_wr(struct nvif_object *object, int size, u64 addr, u32 data) in nvif_object_wr() argument
109 int ret = nvif_object_ioctl(object, &args, sizeof(args), NULL); in nvif_object_wr()
116 nvif_object_mthd(struct nvif_object *object, u32 mthd, void *data, u32 size) in nvif_object_mthd() argument
137 ret = nvif_object_ioctl(object, args, sizeof(*args) + size, NULL); in nvif_object_mthd()
145 nvif_object_unmap(struct nvif_object *object) in nvif_object_unmap() argument
147 if (object->map.size) { in nvif_object_unmap()
148 struct nvif_client *client = nvif_client(object); in nvif_object_unmap()
156 if (object->map.ptr) { in nvif_object_unmap()
157 client->driver->unmap(client, object->map.ptr, in nvif_object_unmap()
158 object->map.size); in nvif_object_unmap()
159 object->map.ptr = NULL; in nvif_object_unmap()
162 nvif_object_ioctl(object, &args, sizeof(args), NULL); in nvif_object_unmap()
163 object->map.size = 0; in nvif_object_unmap()
168 nvif_object_map(struct nvif_object *object) in nvif_object_map() argument
170 struct nvif_client *client = nvif_client(object); in nvif_object_map()
177 int ret = nvif_object_ioctl(object, &args, sizeof(args), NULL); in nvif_object_map()
179 object->map.size = args.map.length; in nvif_object_map()
180 object->map.ptr = client->driver->map(client, args.map.handle, in nvif_object_map()
181 object->map.size); in nvif_object_map()
182 if (ret = -ENOMEM, object->map.ptr) in nvif_object_map()
184 nvif_object_unmap(object); in nvif_object_map()
195 nvif_object_fini(struct nvif_object *object) in nvif_object_fini() argument
197 struct ctor *ctor = container_of(object->data, typeof(*ctor), new.data); in nvif_object_fini()
198 if (object->parent) { in nvif_object_fini()
206 nvif_object_unmap(object); in nvif_object_fini()
207 nvif_object_ioctl(object, &args, sizeof(args), NULL); in nvif_object_fini()
208 if (object->data) { in nvif_object_fini()
209 object->size = 0; in nvif_object_fini()
210 object->data = NULL; in nvif_object_fini()
213 nvif_object_ref(NULL, &object->parent); in nvif_object_fini()
220 struct nvif_object *object) in nvif_object_init() argument
225 object->parent = NULL; in nvif_object_init()
226 object->object = object; in nvif_object_init()
227 nvif_object_ref(parent, &object->parent); in nvif_object_init()
228 kref_init(&object->refcount); in nvif_object_init()
229 object->handle = handle; in nvif_object_init()
230 object->oclass = oclass; in nvif_object_init()
231 object->data = NULL; in nvif_object_init()
232 object->size = 0; in nvif_object_init()
233 object->dtor = dtor; in nvif_object_init()
234 object->map.ptr = NULL; in nvif_object_init()
235 object->map.size = 0; in nvif_object_init()
237 if (object->parent) { in nvif_object_init()
239 nvif_object_fini(object); in nvif_object_init()
242 object->data = ctor->new.data; in nvif_object_init()
243 object->size = size; in nvif_object_init()
244 memcpy(object->data, data, size); in nvif_object_init()
250 ctor->new.token = (unsigned long)(void *)object; in nvif_object_init()
255 object->size, &object->priv); in nvif_object_init()
259 nvif_object_fini(object); in nvif_object_init()
264 nvif_object_del(struct nvif_object *object) in nvif_object_del() argument
266 nvif_object_fini(object); in nvif_object_del()
267 kfree(object); in nvif_object_del()
274 struct nvif_object *object = kzalloc(sizeof(*object), GFP_KERNEL); in nvif_object_new() local
275 if (object) { in nvif_object_new()
277 oclass, data, size, object); in nvif_object_new()
279 kfree(object); in nvif_object_new()
280 object = NULL; in nvif_object_new()
282 *pobject = object; in nvif_object_new()
291 struct nvif_object *object = in nvif_object_put() local
292 container_of(kref, typeof(*object), refcount); in nvif_object_put()
293 object->dtor(object); in nvif_object_put()
297 nvif_object_ref(struct nvif_object *object, struct nvif_object **pobject) in nvif_object_ref() argument
299 if (object) in nvif_object_ref()
300 kref_get(&object->refcount); in nvif_object_ref()
303 *pobject = object; in nvif_object_ref()