Lines Matching refs:magic

44  * Find the file with the given magic number.
47 * \param magic magic number.
50 * the one with matching magic number, while holding the drm_device::struct_mutex
53 static struct drm_file *drm_find_file(struct drm_master *master, drm_magic_t magic)
61 if (!drm_ht_find_item(&master->magiclist, (unsigned long)magic, &hash)) {
70 * Adds a magic number.
74 * \param magic magic number.
77 * associated the magic number hash key in drm_device::magiclist, while holding
81 drm_magic_t magic)
85 DRM_DEBUG("%d\n", magic);
91 entry->hash_item.key = (unsigned long)magic;
101 * Remove a magic number.
104 * \param magic magic number.
106 * Searches and unlinks the entry in drm_device::magiclist with the magic
109 int drm_remove_magic(struct drm_master *master, drm_magic_t magic)
115 DRM_DEBUG("%d\n", magic);
118 if (drm_ht_find_item(&master->magiclist, (unsigned long)magic, &hash)) {
133 * Get a unique magic number (ioctl).
141 * If there is a magic number in drm_file::magic then use it, otherwise
142 * searches an unique non-zero magic number and add it associating it with \p
145 * struct drm_file::magic and struct drm_magic_entry::priv.
152 /* Find unique magic */
153 if (file_priv->magic) {
154 auth->magic = file_priv->magic;
160 auth->magic = sequence++;
162 } while (drm_find_file(file_priv->master, auth->magic));
163 file_priv->magic = auth->magic;
164 drm_add_magic(file_priv->master, file_priv, auth->magic);
167 DRM_DEBUG("%u\n", auth->magic);
173 * Authenticate with a magic.
181 * Checks if \p file_priv is associated with the magic number passed in \arg.
183 * struct drm_file::magic and struct drm_magic_entry::priv.
191 DRM_DEBUG("%u\n", auth->magic);
192 if ((file = drm_find_file(file_priv->master, auth->magic))) {
194 drm_remove_magic(file_priv->master, auth->magic);