Lines Matching full:magic
42 * Find the file with the given magic number.
45 * \param magic magic number.
48 * the one with matching magic number, while holding the drm_device::struct_mutex
51 static struct drm_file *drm_find_file(struct drm_master *master, drm_magic_t magic) in drm_find_file() argument
59 if (!drm_ht_find_item(&master->magiclist, (unsigned long)magic, &hash)) { in drm_find_file()
68 * Adds a magic number.
72 * \param magic magic number.
75 * associated the magic number hash key in drm_device::magiclist, while holding
79 drm_magic_t magic) in drm_add_magic() argument
83 DRM_DEBUG("%d\n", magic); in drm_add_magic()
89 entry->hash_item.key = (unsigned long)magic; in drm_add_magic()
99 * Remove a magic number.
102 * \param magic magic number.
104 * Searches and unlinks the entry in drm_device::magiclist with the magic
107 int drm_remove_magic(struct drm_master *master, drm_magic_t magic) in drm_remove_magic() argument
113 DRM_DEBUG("%d\n", magic); in drm_remove_magic()
116 if (drm_ht_find_item(&master->magiclist, (unsigned long)magic, &hash)) { in drm_remove_magic()
131 * Get a unique magic number (ioctl).
139 * If there is a magic number in drm_file::magic then use it, otherwise
140 * searches an unique non-zero magic number and add it associating it with \p
143 * struct drm_file::magic and struct drm_magic_entry::priv.
150 /* Find unique magic */ in drm_getmagic()
151 if (file_priv->magic) { in drm_getmagic()
152 auth->magic = file_priv->magic; in drm_getmagic()
158 auth->magic = sequence++; in drm_getmagic()
160 } while (drm_find_file(file_priv->master, auth->magic)); in drm_getmagic()
161 file_priv->magic = auth->magic; in drm_getmagic()
162 drm_add_magic(file_priv->master, file_priv, auth->magic); in drm_getmagic()
165 DRM_DEBUG("%u\n", auth->magic); in drm_getmagic()
171 * Authenticate with a magic.
179 * Checks if \p file_priv is associated with the magic number passed in \arg.
181 * struct drm_file::magic and struct drm_magic_entry::priv.
189 DRM_DEBUG("%u\n", auth->magic); in drm_authmagic()
190 if ((file = drm_find_file(file_priv->master, auth->magic))) { in drm_authmagic()
192 drm_remove_magic(file_priv->master, auth->magic); in drm_authmagic()