• Home
  • Raw
  • Download

Lines Matching full:master

43  * DOC: master and authentication
47 * least once successfully became the device master (either through the
49 * no one else is the current master that time) there exists one &drm_master.
53 * In addition only one &drm_master can be the current master for a &drm_device.
58 * Clients can authenticate against the current master (if it matches their own)
71 ret = idr_alloc(&file_priv->master->magic_map, file_priv, in drm_getmagic()
93 file = idr_find(&file_priv->master->magic_map, auth->magic); in drm_authmagic()
96 idr_replace(&file_priv->master->magic_map, NULL, auth->magic); in drm_authmagic()
105 struct drm_master *master; in drm_master_create() local
107 master = kzalloc(sizeof(*master), GFP_KERNEL); in drm_master_create()
108 if (!master) in drm_master_create()
111 kref_init(&master->refcount); in drm_master_create()
112 drm_master_legacy_init(master); in drm_master_create()
113 idr_init(&master->magic_map); in drm_master_create()
114 master->dev = dev; in drm_master_create()
117 INIT_LIST_HEAD(&master->lessees); in drm_master_create()
118 INIT_LIST_HEAD(&master->lessee_list); in drm_master_create()
119 idr_init(&master->leases); in drm_master_create()
120 idr_init(&master->lessee_idr); in drm_master_create()
122 return master; in drm_master_create()
128 dev->master = drm_master_get(fpriv->master); in drm_set_master()
143 old_master = fpriv->master; in drm_new_set_master()
148 fpriv->master = new_master; in drm_new_set_master()
165 * from becoming master and/or failing to release it.
167 * At the same time, the first client (for a given VT) is _always_ master.
171 * If the CAP_SYS_ADMIN was missing, no other client could become master...
177 * master as applicable. It does so by opening the fd and passing it to users
178 * while in itself logind a) does the set/drop master per users' request and
179 * b) * implicitly drops master on VT switch.
183 * root is required _solely_ for SET/DROP MASTER.
185 * - any client which fails to drop master* can DoS the application using
193 * - allow a client to drop/set master, iff it is/was master at a given point
198 * - open the node, become master implicitly and cause issues
231 if (dev->master) { in drm_setmaster_ioctl()
236 if (!file_priv->master) { in drm_setmaster_ioctl()
246 if (file_priv->master->lessor != NULL) { in drm_setmaster_ioctl()
247 DRM_DEBUG_LEASE("Attempt to set lessee %d as master\n", file_priv->master->lessee_id); in drm_setmaster_ioctl()
263 drm_master_put(&dev->master); in drm_drop_master()
282 if (!dev->master) { in drm_dropmaster_ioctl()
287 if (file_priv->master->lessor != NULL) { in drm_dropmaster_ioctl()
288 DRM_DEBUG_LEASE("Attempt to drop lessee %d as master\n", file_priv->master->lessee_id); in drm_dropmaster_ioctl()
304 /* if there is no current master make this fd it, but do not create in drm_master_open()
305 * any master object for render clients */ in drm_master_open()
307 if (!dev->master) { in drm_master_open()
311 file_priv->master = drm_master_get(dev->master); in drm_master_open()
322 struct drm_master *master; in drm_master_release() local
325 master = file_priv->master; in drm_master_release()
327 idr_remove(&file_priv->master->magic_map, file_priv->magic); in drm_master_release()
332 drm_legacy_lock_master_cleanup(dev, master); in drm_master_release()
334 if (dev->master == file_priv->master) in drm_master_release()
339 * this is the "real" master in drm_master_release()
341 drm_lease_revoke(master); in drm_master_release()
344 /* drop the master reference held by the file priv */ in drm_master_release()
345 if (file_priv->master) in drm_master_release()
346 drm_master_put(&file_priv->master); in drm_master_release()
351 * drm_is_current_master - checks whether @priv is the current master
354 * Checks whether @fpriv is current master on its device. This decides whether a
358 * - the current master is assumed to own the non-shareable display hardware.
362 return fpriv->is_master && drm_lease_owner(fpriv->master) == fpriv->minor->dev->master; in drm_is_current_master()
367 * drm_master_get - reference a master pointer
368 * @master: &struct drm_master
370 * Increments the reference count of @master and returns a pointer to @master.
372 struct drm_master *drm_master_get(struct drm_master *master) in drm_master_get() argument
374 kref_get(&master->refcount); in drm_master_get()
375 return master; in drm_master_get()
380 * drm_file_get_master - reference &drm_file.master of @file_priv
383 * Increments the reference count of @file_priv's &drm_file.master and returns
384 * the &drm_file.master. If @file_priv has no &drm_file.master, returns NULL.
386 * Master pointers returned from this function should be unreferenced using
391 struct drm_master *master = NULL; in drm_file_get_master() local
394 if (!file_priv->master) in drm_file_get_master()
396 master = drm_master_get(file_priv->master); in drm_file_get_master()
400 return master; in drm_file_get_master()
406 struct drm_master *master = container_of(kref, struct drm_master, refcount); in drm_master_destroy() local
407 struct drm_device *dev = master->dev; in drm_master_destroy()
410 drm_lease_destroy(master); in drm_master_destroy()
412 drm_legacy_master_rmmaps(dev, master); in drm_master_destroy()
414 idr_destroy(&master->magic_map); in drm_master_destroy()
415 idr_destroy(&master->leases); in drm_master_destroy()
416 idr_destroy(&master->lessee_idr); in drm_master_destroy()
418 kfree(master->unique); in drm_master_destroy()
419 kfree(master); in drm_master_destroy()
423 * drm_master_put - unreference and clear a master pointer
424 * @master: pointer to a pointer of &struct drm_master
426 * This decrements the &drm_master behind @master and sets it to NULL.
428 void drm_master_put(struct drm_master **master) in drm_master_put() argument
430 kref_put(&(*master)->refcount, drm_master_destroy); in drm_master_put()
431 *master = NULL; in drm_master_put()
439 if (dev->master) { in drm_master_internal_acquire()