Lines Matching refs:magic
42 drm_hash_magic(drm_magic_t magic)
44 return (magic & (DRM_HASH_SIZE-1));
48 drm_find_file(drm_device_t *dev, drm_magic_t magic)
54 hash = drm_hash_magic(magic);
56 if (pt->magic == magic) {
66 drm_add_magic(drm_device_t *dev, drm_file_t *priv, drm_magic_t magic)
71 hash = drm_hash_magic(magic);
75 entry->magic = magic;
93 drm_remove_magic(drm_device_t *dev, drm_magic_t magic)
99 DRM_DEBUG("drm_remove_magic : %d", magic);
100 hash = drm_hash_magic(magic);
104 if (pt->magic == magic) {
132 /* Find unique magic */
133 if (fpriv->magic) {
134 auth.magic = fpriv->magic;
138 auth.magic = old+1;
139 if (!atomic_cmpset_int(&sequence, old, auth.magic))
141 } while (drm_find_file(dev, auth.magic));
142 fpriv->magic = auth.magic;
143 (void) drm_add_magic(dev, fpriv, auth.magic);
147 DRM_DEBUG("drm_getmagic: %u", auth.magic);
164 if ((file = drm_find_file(dev, auth.magic))) {
166 (void) drm_remove_magic(dev, auth.magic);