From b88e2318f7414d5291e18a93bd409465a81b2fa9 Mon Sep 17 00:00:00 2001 From: Hans Verkuil Date: Mon, 6 Oct 2008 08:03:18 +0200 Subject: ivtvfb: Enable DMA write() for kernels < 2.6.22 From: Ian Armstrong Allows kernels < 2.6.22 to use DMA for fbdev write() operations. Priority: normal Signed-off-by: Ian Armstrong Signed-off-by: Hans Verkuil --- linux/drivers/media/video/ivtv/ivtvfb.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'linux/drivers/media/video/ivtv') diff --git a/linux/drivers/media/video/ivtv/ivtvfb.c b/linux/drivers/media/video/ivtv/ivtvfb.c index b448e2c28..1ac3af3fc 100644 --- a/linux/drivers/media/video/ivtv/ivtvfb.c +++ b/linux/drivers/media/video/ivtv/ivtvfb.c @@ -368,8 +368,16 @@ static int ivtvfb_prep_frame(struct ivtv *itv, int cmd, void __user *source, #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 22) static ssize_t ivtvfb_write(struct fb_info *info, const char __user *buf, - size_t count, loff_t *ppos) + size_t count, loff_t *ppos) { +#else +static ssize_t ivtvfb_write(struct file *file, const char __user *buf, + size_t count, loff_t *ppos) +{ + struct inode *inode = file->f_dentry->d_inode; + int fbidx = iminor(inode); + struct fb_info *info = registered_fb[fbidx]; +#endif unsigned long p = *ppos; void *dst; int err = 0; @@ -443,7 +451,6 @@ static ssize_t ivtvfb_write(struct fb_info *info, const char __user *buf, return (err) ? err : count; } -#endif static int ivtvfb_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg) { @@ -909,9 +916,7 @@ static int ivtvfb_blank(int blank_mode, struct fb_info *info) static struct fb_ops ivtvfb_ops = { .owner = THIS_MODULE, -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 22) .fb_write = ivtvfb_write, -#endif .fb_check_var = ivtvfb_check_var, .fb_set_par = ivtvfb_set_par, .fb_setcolreg = ivtvfb_setcolreg, -- cgit v1.2.3