Lines Matching refs:magic
35 static int drm_hash_magic(drm_magic_t magic) in drm_hash_magic() argument
37 return magic & (DRM_HASH_SIZE-1); in drm_hash_magic()
40 static drm_file_t *drm_find_file(drm_device_t *dev, drm_magic_t magic) in drm_find_file() argument
44 int hash = drm_hash_magic(magic); in drm_find_file()
48 if (pt->magic == magic) { in drm_find_file()
57 int drm_add_magic(drm_device_t *dev, drm_file_t *priv, drm_magic_t magic) in drm_add_magic() argument
62 DRM_DEBUG("%d\n", magic); in drm_add_magic()
64 hash = drm_hash_magic(magic); in drm_add_magic()
67 entry->magic = magic; in drm_add_magic()
84 int drm_remove_magic(drm_device_t *dev, drm_magic_t magic) in drm_remove_magic() argument
90 DRM_DEBUG("%d\n", magic); in drm_remove_magic()
91 hash = drm_hash_magic(magic); in drm_remove_magic()
95 if (pt->magic == magic) { in drm_remove_magic()
126 if (priv->magic) { in drm_getmagic()
127 auth.magic = priv->magic; in drm_getmagic()
132 auth.magic = sequence++; in drm_getmagic()
134 } while (drm_find_file(dev, auth.magic)); in drm_getmagic()
135 priv->magic = auth.magic; in drm_getmagic()
136 drm_add_magic(dev, priv, auth.magic); in drm_getmagic()
139 DRM_DEBUG("%u\n", auth.magic); in drm_getmagic()
155 DRM_DEBUG("%u\n", auth.magic); in drm_authmagic()
156 if ((file = drm_find_file(dev, auth.magic))) { in drm_authmagic()
158 drm_remove_magic(dev, auth.magic); in drm_authmagic()