Lines Matching refs:magic
41 static int drm_hash_magic(drm_magic_t magic)
43 return magic & (DRM_HASH_SIZE-1);
47 * Returns the file private associated with the given magic number.
49 static struct drm_file *drm_find_file(struct drm_device *dev, drm_magic_t magic)
52 int hash = drm_hash_magic(magic);
57 if (pt->magic == magic) {
66 * Inserts the given magic number into the hash table of used magic number
70 drm_magic_t magic)
75 DRM_DEBUG("%d\n", magic);
79 hash = drm_hash_magic(magic);
83 entry->magic = magic;
99 * Removes the given magic number from the hash table of used magic number
102 static int drm_remove_magic(struct drm_device *dev, drm_magic_t magic)
110 DRM_DEBUG("%d\n", magic);
111 hash = drm_hash_magic(magic);
114 if (pt->magic == magic) {
133 * Called by the client, this returns a unique magic number to be authorized
137 * connection that the magic is passed over) to determine if the magic number
145 /* Find unique magic */
146 if (file_priv->magic) {
147 auth->magic = file_priv->magic;
153 auth->magic = old+1;
155 if (!atomic_cmpset_int(&sequence, old, auth->magic))
157 } while (drm_find_file(dev, auth->magic));
158 file_priv->magic = auth->magic;
159 drm_add_magic(dev, file_priv, auth->magic);
163 DRM_DEBUG("%u\n", auth->magic);
169 * Marks the client associated with the given magic number as authenticated.
177 DRM_DEBUG("%u\n", auth->magic);
180 priv = drm_find_file(dev, auth->magic);
183 drm_remove_magic(dev, auth->magic);