Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions
drm_drv.c File Reference
#include <linux/debugfs.h>
#include <linux/slab.h>
#include <linux/export.h>
#include <drm/drmP.h>
#include <drm/drm_core.h>

Go to the source code of this file.

Macros

#define DRM_IOCTL_DEF(ioctl, _func, _flags)   [DRM_IOCTL_NR(ioctl)] = {.cmd = ioctl, .func = _func, .flags = _flags, .cmd_drv = 0}
 
#define DRM_CORE_IOCTL_COUNT   ARRAY_SIZE( drm_ioctls )
 

Functions

int drm_lastclose (struct drm_device *dev)
 
 module_init (drm_core_init)
 
 module_exit (drm_core_exit)
 
long drm_ioctl (struct file *filp, unsigned int cmd, unsigned long arg)
 
 EXPORT_SYMBOL (drm_ioctl)
 
struct drm_local_map * drm_getsarea (struct drm_device *dev)
 
 EXPORT_SYMBOL (drm_getsarea)
 

Detailed Description

Generic driver template

Author
Rickard E. (Rik) Faith faith.nosp@m.@val.nosp@m.inux..nosp@m.com
Gareth Hughes garet.nosp@m.h@va.nosp@m.linux.nosp@m..com

To use this template, you must at least define the following (samples given for the MGA driver):

#define DRIVER_AUTHOR "VA Linux Systems, Inc."
#define DRIVER_NAME "mga"
#define DRIVER_DESC "Matrox G200/G400"
#define DRIVER_DATE "20001127"
#define drm_x mga_##x

Definition in file drm_drv.c.

Macro Definition Documentation

#define DRM_CORE_IOCTL_COUNT   ARRAY_SIZE( drm_ioctls )

Definition at line 171 of file drm_drv.c.

#define DRM_IOCTL_DEF (   ioctl,
  _func,
  _flags 
)    [DRM_IOCTL_NR(ioctl)] = {.cmd = ioctl, .func = _func, .flags = _flags, .cmd_drv = 0}

Definition at line 59 of file drm_drv.c.

Function Documentation

struct drm_local_map* drm_getsarea ( struct drm_device dev)
read

Definition at line 484 of file drm_drv.c.

long drm_ioctl ( struct file filp,
unsigned int  cmd,
unsigned long  arg 
)

Called whenever a process performs an ioctl on /dev/drm.

Parameters
inodedevice inode.
file_privDRM file private.
cmdcommand.
arguser argument.
Returns
zero on success or negative number on failure.

Looks up the ioctl function in the ioctls table, checking for root previleges if so required, and dispatches to the respective function.

Definition at line 374 of file drm_drv.c.

int drm_lastclose ( struct drm_device dev)

Take down the DRM device.

Parameters
devDRM device structure.

Frees every resource in dev.

See Also
drm_device

Definition at line 182 of file drm_drv.c.

EXPORT_SYMBOL ( drm_ioctl  )
EXPORT_SYMBOL ( drm_getsarea  )
module_exit ( drm_core_exit  )
module_init ( drm_core_init  )