Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
drm_fops.c File Reference
#include <drm/drmP.h>
#include <linux/poll.h>
#include <linux/slab.h>
#include <linux/module.h>

Go to the source code of this file.


 DEFINE_MUTEX (drm_global_mutex)
 EXPORT_SYMBOL (drm_global_mutex)
int drm_open (struct inode *inode, struct file *filp)
 EXPORT_SYMBOL (drm_open)
int drm_stub_open (struct inode *inode, struct file *filp)
int drm_fasync (int fd, struct file *filp, int on)
 EXPORT_SYMBOL (drm_fasync)
int drm_release (struct inode *inode, struct file *filp)
 EXPORT_SYMBOL (drm_release)
ssize_t drm_read (struct file *filp, char __user *buffer, size_t count, loff_t *offset)
 EXPORT_SYMBOL (drm_read)
unsigned int drm_poll (struct file *filp, struct poll_table_struct *wait)
 EXPORT_SYMBOL (drm_poll)

Detailed Description

File operations for DRM

Rickard E. (Rik) Faith
Daryll Strauss
Gareth Hughes

Definition in file drm_fops.c.

Function Documentation

DEFINE_MUTEX ( drm_global_mutex  )
int drm_fasync ( int  fd,
struct file filp,
int  on 


Definition at line 374 of file drm_fops.c.

int drm_open ( struct inode inode,
struct file filp 

Open file.

inodedevice inode
filpfile pointer.
zero on success or a negative number on failure.

Searches the DRM device with the same minor number, calls open_helper(), and increments the device open count. If the open count was previous at zero, i.e., it's the first that the device is open, then calls setup().

Definition at line 118 of file drm_fops.c.

unsigned int drm_poll ( struct file filp,
struct poll_table_struct wait 

Definition at line 625 of file drm_fops.c.

ssize_t drm_read ( struct file filp,
char __user buffer,
size_t  count,
loff_t *  offset 

Definition at line 596 of file drm_fops.c.

int drm_release ( struct inode inode,
struct file filp 

Release file.

inodedevice inode
file_privDRM file private.
zero on success or a negative number on failure.

If the hardware lock is held then free it, and take it again for the kernel context since it's necessary to reclaim buffers. Unlink the file private data from its list and free it. Decreases the open count and if it reaches zero calls drm_lastclose().

Since the master is disappearing, so is the possibility to lock.

Definition at line 433 of file drm_fops.c.

int drm_stub_open ( struct inode inode,
struct file filp 

File open operation.

inodedevice inode.
filpfile pointer.

Puts the dev->fops corresponding to the device minor number into filp, call the open method, and restore the file operations.

Definition at line 181 of file drm_fops.c.

EXPORT_SYMBOL ( drm_global_mutex  )
EXPORT_SYMBOL ( drm_open  )
EXPORT_SYMBOL ( drm_fasync  )
EXPORT_SYMBOL ( drm_release  )
EXPORT_SYMBOL ( drm_read  )
EXPORT_SYMBOL ( drm_poll  )