|
Lines 44-49
Link Here
|
| 44 |
/* from BKL pushdown */ |
44 |
/* from BKL pushdown */ |
| 45 |
DEFINE_MUTEX(drm_global_mutex); |
45 |
DEFINE_MUTEX(drm_global_mutex); |
| 46 |
|
46 |
|
|
|
47 |
/** |
| 48 |
* DOC: file operations |
| 49 |
* |
| 50 |
* Drivers must define the file operations structure that forms the DRM |
| 51 |
* userspace API entry point, even though most of those operations are |
| 52 |
* implemented in the DRM core. The mandatory functions are drm_open(), |
| 53 |
* drm_read(), drm_ioctl() and drm_compat_ioctl() if CONFIG_COMPAT is enabled |
| 54 |
* (note that drm_compat_ioctl will be NULL if CONFIG_COMPAT=n). Drivers which |
| 55 |
* implement private ioctls that require 32/64 bit compatibility support must |
| 56 |
* provide their own .compat_ioctl() handler that processes private ioctls and |
| 57 |
* calls drm_compat_ioctl() for core ioctls. |
| 58 |
* |
| 59 |
* In addition drm_read() and drm_poll() provide support for DRM events. DRM |
| 60 |
* events are a generic and extensible means to send asynchronous events to |
| 61 |
* userspace through the file descriptor. They are used to send vblank event and |
| 62 |
* page flip completions by the KMS API. But drivers can also use it for their |
| 63 |
* own needs, e.g. to signal completion of rendering. |
| 64 |
* |
| 65 |
* The memory mapping implementation will vary depending on how the driver |
| 66 |
* manages memory. Legacy drivers will use the deprecated drm_legacy_mmap() |
| 67 |
* function, modern drivers should use one of the provided memory-manager |
| 68 |
* specific implementations. For GEM-based drivers this is drm_gem_mmap(). |
| 69 |
* |
| 70 |
* No other file operations are supported by the DRM userspace API. Overall the |
| 71 |
* following is an example #file_operations structure:: |
| 72 |
* |
| 73 |
* static const example_drm_fops = { |
| 74 |
* .owner = THIS_MODULE, |
| 75 |
* .open = drm_open, |
| 76 |
* .release = drm_release, |
| 77 |
* .unlocked_ioctl = drm_ioctl, |
| 78 |
* .compat_ioctl = drm_compat_ioctl, // NULL if CONFIG_COMPAT=n |
| 79 |
* .poll = drm_poll, |
| 80 |
* .read = drm_read, |
| 81 |
* .llseek = no_llseek, |
| 82 |
* .mmap = drm_gem_mmap, |
| 83 |
* }; |
| 84 |
*/ |
| 85 |
|
| 47 |
static int drm_open_helper(struct file *filp, struct drm_minor *minor); |
86 |
static int drm_open_helper(struct file *filp, struct drm_minor *minor); |
| 48 |
|
87 |
|
| 49 |
static int drm_setup(struct drm_device * dev) |
88 |
static int drm_setup(struct drm_device * dev) |