Commit 6584b1ab authored by Dave Airlie's avatar Dave Airlie

remove DRIVER_FOPS and related macros

Signed-off-by: default avatarDave Airlie <airlied@linux.ie>
parent 92910d98
...@@ -76,30 +76,10 @@ ...@@ -76,30 +76,10 @@
#ifndef __HAVE_SG #ifndef __HAVE_SG
#define __HAVE_SG 0 #define __HAVE_SG 0
#endif #endif
#ifndef __HAVE_DRIVER_FOPS_READ
#define __HAVE_DRIVER_FOPS_READ 0
#endif
#ifndef __HAVE_DRIVER_FOPS_POLL
#define __HAVE_DRIVER_FOPS_POLL 0
#endif
#ifndef DRIVER_IOCTLS #ifndef DRIVER_IOCTLS
#define DRIVER_IOCTLS #define DRIVER_IOCTLS
#endif #endif
#ifndef DRIVER_FOPS
#define DRIVER_FOPS \
static struct file_operations DRM(fops) = { \
.owner = THIS_MODULE, \
.open = DRM(open), \
.flush = DRM(flush), \
.release = DRM(release), \
.ioctl = DRM(ioctl), \
.mmap = DRM(mmap), \
.fasync = DRM(fasync), \
.poll = DRM(poll), \
.read = DRM(read), \
}
#endif
#ifndef MODULE #ifndef MODULE
/** Use an additional macro to avoid preprocessor troubles */ /** Use an additional macro to avoid preprocessor troubles */
...@@ -123,7 +103,17 @@ __setup( DRIVER_NAME "=", DRM_OPTIONS_FUNC ); ...@@ -123,7 +103,17 @@ __setup( DRIVER_NAME "=", DRM_OPTIONS_FUNC );
static drm_device_t DRM(device)[MAX_DEVICES]; static drm_device_t DRM(device)[MAX_DEVICES];
static int DRM(numdevs) = 0; static int DRM(numdevs) = 0;
DRIVER_FOPS; struct file_operations DRM(fops) = {
.owner = THIS_MODULE,
.open = DRM(open),
.flush = DRM(flush),
.release = DRM(release),
.ioctl = DRM(ioctl),
.mmap = DRM(mmap),
.fasync = DRM(fasync),
.poll = DRM(poll),
.read = DRM(read),
};
/** Ioctl table */ /** Ioctl table */
drm_ioctl_desc_t DRM(ioctls)[] = { drm_ioctl_desc_t DRM(ioctls)[] = {
......
...@@ -131,19 +131,15 @@ int DRM(fasync)(int fd, struct file *filp, int on) ...@@ -131,19 +131,15 @@ int DRM(fasync)(int fd, struct file *filp, int on)
return 0; return 0;
} }
#if !__HAVE_DRIVER_FOPS_POLL
/** No-op. */ /** No-op. */
unsigned int DRM(poll)(struct file *filp, struct poll_table_struct *wait) unsigned int DRM(poll)(struct file *filp, struct poll_table_struct *wait)
{ {
return 0; return 0;
} }
#endif
#if !__HAVE_DRIVER_FOPS_READ
/** No-op. */ /** No-op. */
ssize_t DRM(read)(struct file *filp, char __user *buf, size_t count, loff_t *off) ssize_t DRM(read)(struct file *filp, char __user *buf, size_t count, loff_t *off)
{ {
return 0; return 0;
} }
#endif
...@@ -589,6 +589,7 @@ static int ffb_driver_kernel_context_switch_unlock(struct drm_device *dev) ...@@ -589,6 +589,7 @@ static int ffb_driver_kernel_context_switch_unlock(struct drm_device *dev)
static void ffb_driver_register_fns(drm_device_t *dev) static void ffb_driver_register_fns(drm_device_t *dev)
{ {
DRM(fops).get_unmapped_area = ffb_get_unmapped_area;
dev->fn_tbl.release = ffb_driver_release; dev->fn_tbl.release = ffb_driver_release;
dev->fn_tbl.presetup = ffb_driver_presetup; dev->fn_tbl.presetup = ffb_driver_presetup;
dev->fn_tbl.pretakedown = ffb_driver_pretakedown; dev->fn_tbl.pretakedown = ffb_driver_pretakedown;
......
...@@ -26,20 +26,6 @@ ...@@ -26,20 +26,6 @@
#define DRIVER_MINOR 0 #define DRIVER_MINOR 0
#define DRIVER_PATCHLEVEL 1 #define DRIVER_PATCHLEVEL 1
#define DRIVER_FOPS \
static struct file_operations DRM(fops) = { \
.owner = THIS_MODULE, \
.open = DRM(open), \
.flush = DRM(flush), \
.release = DRM(release), \
.ioctl = DRM(ioctl), \
.mmap = DRM(mmap), \
.read = DRM(read), \
.fasync = DRM(fasync), \
.poll = DRM(poll), \
.get_unmapped_area = ffb_get_unmapped_area, \
}
#define DRIVER_COUNT_CARDS() ffb_count_card_instances() #define DRIVER_COUNT_CARDS() ffb_count_card_instances()
/* For mmap customization */ /* For mmap customization */
...@@ -243,11 +229,11 @@ static drm_map_t *ffb_find_map(struct file *filp, unsigned long off) ...@@ -243,11 +229,11 @@ static drm_map_t *ffb_find_map(struct file *filp, unsigned long off)
return NULL; return NULL;
} }
static unsigned long ffb_get_unmapped_area(struct file *filp, unsigned long ffb_get_unmapped_area(struct file *filp,
unsigned long hint, unsigned long hint,
unsigned long len, unsigned long len,
unsigned long pgoff, unsigned long pgoff,
unsigned long flags) unsigned long flags)
{ {
drm_map_t *map = ffb_find_map(filp, pgoff << PAGE_SHIFT); drm_map_t *map = ffb_find_map(filp, pgoff << PAGE_SHIFT);
unsigned long addr = -ENOMEM; unsigned long addr = -ENOMEM;
......
...@@ -274,3 +274,10 @@ typedef struct ffb_dev_priv { ...@@ -274,3 +274,10 @@ typedef struct ffb_dev_priv {
/* Context table. */ /* Context table. */
struct ffb_hw_context *hw_state[FFB_MAX_CTXS]; struct ffb_hw_context *hw_state[FFB_MAX_CTXS];
} ffb_dev_priv_t; } ffb_dev_priv_t;
extern struct file_operations DRM(fops);
extern unsigned long ffb_get_unmapped_area(struct file *filp,
unsigned long hint,
unsigned long len,
unsigned long pgoff,
unsigned long flags);
...@@ -77,9 +77,6 @@ ...@@ -77,9 +77,6 @@
#define __HAVE_OLD_DMA 1 #define __HAVE_OLD_DMA 1
#define __HAVE_PCI_DMA 1 #define __HAVE_PCI_DMA 1
#define __HAVE_DRIVER_FOPS_READ 1
#define __HAVE_DRIVER_FOPS_POLL 1
#define __HAVE_MULTIPLE_DMA_QUEUES 1 #define __HAVE_MULTIPLE_DMA_QUEUES 1
#define __HAVE_DMA_WAITQUEUE 1 #define __HAVE_DMA_WAITQUEUE 1
......
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
the circular buffer), is based on Alessandro Rubini's LINUX DEVICE the circular buffer), is based on Alessandro Rubini's LINUX DEVICE
DRIVERS (Cambridge: O'Reilly, 1998), pages 111-113. */ DRIVERS (Cambridge: O'Reilly, 1998), pages 111-113. */
ssize_t DRM(read)(struct file *filp, char __user *buf, size_t count, loff_t *off) ssize_t gamma_fops_read(struct file *filp, char __user *buf, size_t count, loff_t *off)
{ {
drm_file_t *priv = filp->private_data; drm_file_t *priv = filp->private_data;
drm_device_t *dev = priv->dev; drm_device_t *dev = priv->dev;
...@@ -128,7 +128,7 @@ int DRM(write_string)(drm_device_t *dev, const char *s) ...@@ -128,7 +128,7 @@ int DRM(write_string)(drm_device_t *dev, const char *s)
return 0; return 0;
} }
unsigned int DRM(poll)(struct file *filp, struct poll_table_struct *wait) unsigned int gamma_fops_poll(struct file *filp, struct poll_table_struct *wait)
{ {
drm_file_t *priv = filp->private_data; drm_file_t *priv = filp->private_data;
drm_device_t *dev = priv->dev; drm_device_t *dev = priv->dev;
......
...@@ -935,6 +935,8 @@ static int gamma_driver_dma_quiescent(drm_device_t *dev) ...@@ -935,6 +935,8 @@ static int gamma_driver_dma_quiescent(drm_device_t *dev)
void gamma_driver_register_fns(drm_device_t *dev) void gamma_driver_register_fns(drm_device_t *dev)
{ {
DRM(fops).read = gamma_fops_read;
DRM(fops).poll = gamma_fops_poll;
dev->fn_tbl.preinit = gamma_driver_preinit; dev->fn_tbl.preinit = gamma_driver_preinit;
dev->fn_tbl.pretakedown = gamma_driver_pretakedown; dev->fn_tbl.pretakedown = gamma_driver_pretakedown;
dev->fn_tbl.dma_ready = gamma_driver_dma_ready; dev->fn_tbl.dma_ready = gamma_driver_dma_ready;
......
...@@ -90,6 +90,10 @@ extern int DRM(freelist_put)(drm_device_t *dev, drm_freelist_t *bl, ...@@ -90,6 +90,10 @@ extern int DRM(freelist_put)(drm_device_t *dev, drm_freelist_t *bl,
drm_buf_t *buf); drm_buf_t *buf);
extern drm_buf_t *DRM(freelist_get)(drm_freelist_t *bl, int block); extern drm_buf_t *DRM(freelist_get)(drm_freelist_t *bl, int block);
/* externs for gamma changes to the ops */
extern struct file_operations DRM(fops);
extern unsigned int gamma_fops_poll(struct file *filp, struct poll_table_struct *wait);
extern ssize_t gamma_fops_read(struct file *filp, char __user *buf, size_t count, loff_t *off);
#define GLINT_DRI_BUF_COUNT 256 #define GLINT_DRI_BUF_COUNT 256
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment