Lines Matching defs:magic
39 * Find the file with the given magic number.
42 * \param magic magic number.
45 * the one with matching magic number, while holding the drm_device::struct_mutex
48 static drm_file_t *drm_find_file(drm_device_t * dev, drm_magic_t magic)
55 if (!drm_ht_find_item(&dev->magiclist, (unsigned long)magic, &hash)) {
64 * Adds a magic number.
68 * \param magic magic number.
71 * associated the magic number hash key in drm_device::magiclist, while holding
75 drm_magic_t magic)
79 DRM_DEBUG("%d\n", magic);
87 entry->hash_item.key = (unsigned long)magic;
97 * Remove a magic number.
100 * \param magic magic number.
102 * Searches and unlinks the entry in drm_device::magiclist with the magic
105 static int drm_remove_magic(drm_device_t * dev, drm_magic_t magic)
110 DRM_DEBUG("%d\n", magic);
113 if (drm_ht_find_item(&dev->magiclist, (unsigned long)magic, &hash)) {
128 * Get a unique magic number (ioctl).
136 * If there is a magic number in drm_file::magic then use it, otherwise
137 * searches an unique non-zero magic number and add it associating it with \p
149 /* Find unique magic */
150 if (priv->magic) {
151 auth.magic = priv->magic;
157 auth.magic = sequence++;
159 } while (drm_find_file(dev, auth.magic));
160 priv->magic = auth.magic;
161 drm_add_magic(dev, priv, auth.magic);
164 DRM_DEBUG("%u\n", auth.magic);
171 * Authenticate with a magic.
179 * Checks if \p filp is associated with the magic number passed in \arg.
191 DRM_DEBUG("%u\n", auth.magic);
192 if ((file = drm_find_file(dev, auth.magic))) {
194 drm_remove_magic(dev, auth.magic);