Lines Matching refs: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)
59 if (!drm_ht_find_item(&master->magiclist, (unsigned long)magic, &hash)) {
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)
83 DRM_DEBUG("%d\n", magic);
89 entry->hash_item.key = (unsigned long)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)
113 DRM_DEBUG("%d\n", magic);
116 if (drm_ht_find_item(&master->magiclist, (unsigned long)magic, &hash)) {
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 */
151 if (file_priv->magic) {
152 auth->magic = file_priv->magic;
158 auth->magic = sequence++;
160 } while (drm_find_file(file_priv->master, auth->magic));
161 file_priv->magic = auth->magic;
162 drm_add_magic(file_priv->master, file_priv, auth->magic);
165 DRM_DEBUG("%u\n", auth->magic);
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);
190 if ((file = drm_find_file(file_priv->master, auth->magic))) {
192 drm_remove_magic(file_priv->master, auth->magic);