Lines Matching refs:master
69 return fpriv->is_master && drm_lease_owner(fpriv->master) == fpriv->minor->dev->master; in drm_is_current_master_locked()
101 ret = idr_alloc(&file_priv->master->magic_map, file_priv, in drm_getmagic()
123 file = idr_find(&file_priv->master->magic_map, auth->magic); in drm_authmagic()
126 idr_replace(&file_priv->master->magic_map, NULL, auth->magic); in drm_authmagic()
135 struct drm_master *master; in drm_master_create() local
137 master = kzalloc(sizeof(*master), GFP_KERNEL); in drm_master_create()
138 if (!master) in drm_master_create()
141 kref_init(&master->refcount); in drm_master_create()
142 drm_master_legacy_init(master); in drm_master_create()
143 idr_init_base(&master->magic_map, 1); in drm_master_create()
144 master->dev = dev; in drm_master_create()
147 INIT_LIST_HEAD(&master->lessees); in drm_master_create()
148 INIT_LIST_HEAD(&master->lessee_list); in drm_master_create()
149 idr_init(&master->leases); in drm_master_create()
150 idr_init_base(&master->lessee_idr, 1); in drm_master_create()
152 return master; in drm_master_create()
158 dev->master = drm_master_get(fpriv->master); in drm_set_master()
173 old_master = fpriv->master; in drm_new_set_master()
178 fpriv->master = new_master; in drm_new_set_master()
262 if (dev->master) { in drm_setmaster_ioctl()
267 if (!file_priv->master) { in drm_setmaster_ioctl()
277 if (file_priv->master->lessor != NULL) { in drm_setmaster_ioctl()
280 file_priv->master->lessee_id); in drm_setmaster_ioctl()
296 drm_master_put(&dev->master); in drm_drop_master()
315 if (!dev->master) { in drm_dropmaster_ioctl()
320 if (file_priv->master->lessor != NULL) { in drm_dropmaster_ioctl()
323 file_priv->master->lessee_id); in drm_dropmaster_ioctl()
343 if (!dev->master) { in drm_master_open()
347 file_priv->master = drm_master_get(dev->master); in drm_master_open()
358 struct drm_master *master; in drm_master_release() local
361 master = file_priv->master; in drm_master_release()
363 idr_remove(&file_priv->master->magic_map, file_priv->magic); in drm_master_release()
368 drm_legacy_lock_master_cleanup(dev, master); in drm_master_release()
370 if (dev->master == file_priv->master) in drm_master_release()
377 drm_lease_revoke(master); in drm_master_release()
381 if (file_priv->master) in drm_master_release()
382 drm_master_put(&file_priv->master); in drm_master_release()
392 struct drm_master *drm_master_get(struct drm_master *master) in drm_master_get() argument
394 kref_get(&master->refcount); in drm_master_get()
395 return master; in drm_master_get()
411 struct drm_master *master = NULL; in drm_file_get_master() local
414 if (!file_priv->master) in drm_file_get_master()
416 master = drm_master_get(file_priv->master); in drm_file_get_master()
420 return master; in drm_file_get_master()
426 struct drm_master *master = container_of(kref, struct drm_master, refcount); in drm_master_destroy() local
427 struct drm_device *dev = master->dev; in drm_master_destroy()
430 drm_lease_destroy(master); in drm_master_destroy()
432 drm_legacy_master_rmmaps(dev, master); in drm_master_destroy()
434 idr_destroy(&master->magic_map); in drm_master_destroy()
435 idr_destroy(&master->leases); in drm_master_destroy()
436 idr_destroy(&master->lessee_idr); in drm_master_destroy()
438 kfree(master->unique); in drm_master_destroy()
439 kfree(master); in drm_master_destroy()
448 void drm_master_put(struct drm_master **master) in drm_master_put() argument
450 kref_put(&(*master)->refcount, drm_master_destroy); in drm_master_put()
451 *master = NULL; in drm_master_put()
459 if (dev->master) { in drm_master_internal_acquire()