Lines Matching refs:file
157 struct drm_file *file; in drm_file_alloc() local
160 file = kzalloc(sizeof(*file), GFP_KERNEL); in drm_file_alloc()
161 if (!file) in drm_file_alloc()
164 file->pid = get_pid(task_pid(current)); in drm_file_alloc()
165 file->minor = minor; in drm_file_alloc()
168 file->authenticated = capable(CAP_SYS_ADMIN); in drm_file_alloc()
170 INIT_LIST_HEAD(&file->lhead); in drm_file_alloc()
171 INIT_LIST_HEAD(&file->fbs); in drm_file_alloc()
172 mutex_init(&file->fbs_lock); in drm_file_alloc()
173 INIT_LIST_HEAD(&file->blobs); in drm_file_alloc()
174 INIT_LIST_HEAD(&file->pending_event_list); in drm_file_alloc()
175 INIT_LIST_HEAD(&file->event_list); in drm_file_alloc()
176 init_waitqueue_head(&file->event_wait); in drm_file_alloc()
177 file->event_space = 4096; /* set aside 4k for event buffer */ in drm_file_alloc()
179 spin_lock_init(&file->master_lookup_lock); in drm_file_alloc()
180 mutex_init(&file->event_read_lock); in drm_file_alloc()
183 drm_gem_open(dev, file); in drm_file_alloc()
186 drm_syncobj_open(file); in drm_file_alloc()
188 drm_prime_init_file_private(&file->prime); in drm_file_alloc()
191 ret = dev->driver->open(dev, file); in drm_file_alloc()
196 return file; in drm_file_alloc()
199 drm_prime_destroy_file_private(&file->prime); in drm_file_alloc()
201 drm_syncobj_release(file); in drm_file_alloc()
203 drm_gem_release(dev, file); in drm_file_alloc()
204 put_pid(file->pid); in drm_file_alloc()
205 kfree(file); in drm_file_alloc()
244 void drm_file_free(struct drm_file *file) in drm_file_free() argument
248 if (!file) in drm_file_free()
251 dev = file->minor->dev; in drm_file_free()
255 (long)old_encode_dev(file->minor->kdev->devt), in drm_file_free()
261 dev->driver->preclose(dev, file); in drm_file_free()
265 drm_legacy_lock_release(dev, file->filp); in drm_file_free()
268 drm_legacy_reclaim_buffers(dev, file); in drm_file_free()
270 drm_events_release(file); in drm_file_free()
273 drm_fb_release(file); in drm_file_free()
274 drm_property_destroy_user_blobs(dev, file); in drm_file_free()
278 drm_syncobj_release(file); in drm_file_free()
281 drm_gem_release(dev, file); in drm_file_free()
283 drm_legacy_ctxbitmap_flush(dev, file); in drm_file_free()
285 if (drm_is_primary_client(file)) in drm_file_free()
286 drm_master_release(file); in drm_file_free()
289 dev->driver->postclose(dev, file); in drm_file_free()
291 drm_prime_destroy_file_private(&file->prime); in drm_file_free()
293 WARN_ON(!list_empty(&file->event_list)); in drm_file_free()
295 put_pid(file->pid); in drm_file_free()
296 kfree(file); in drm_file_free()
299 static void drm_close_helper(struct file *filp) in drm_close_helper()
334 static int drm_open_helper(struct file *filp, struct drm_minor *minor) in drm_open_helper()
410 int drm_open(struct inode *inode, struct file *filp) in drm_open()
484 int drm_release(struct inode *inode, struct file *filp) in drm_release()
524 int drm_release_noglobal(struct inode *inode, struct file *filp) in drm_release_noglobal()
569 ssize_t drm_read(struct file *filp, char __user *buffer, in drm_read()
654 __poll_t drm_poll(struct file *filp, struct poll_table_struct *wait) in drm_poll()
891 struct file *mock_drm_getfile(struct drm_minor *minor, unsigned int flags) in mock_drm_getfile()
895 struct file *file; in mock_drm_getfile() local
901 file = anon_inode_getfile("drm", dev->driver->fops, priv, flags); in mock_drm_getfile()
902 if (IS_ERR(file)) { in mock_drm_getfile()
904 return file; in mock_drm_getfile()
908 file->f_mapping = dev->anon_inode->i_mapping; in mock_drm_getfile()
911 priv->filp = file; in mock_drm_getfile()
913 return file; in mock_drm_getfile()
986 unsigned long drm_get_unmapped_area(struct file *file, in drm_get_unmapped_area() argument
1012 addr = current->mm->get_unmapped_area(file, uaddr, len, pgoff, flags); in drm_get_unmapped_area()
1042 unsigned long drm_get_unmapped_area(struct file *file, in drm_get_unmapped_area() argument
1047 return current->mm->get_unmapped_area(file, uaddr, len, pgoff, flags); in drm_get_unmapped_area()