Commit 7167930a authored by Andi Kleen's avatar Andi Kleen Committed by Linus Torvalds

[PATCH] Convert sis fb driver to compat_ioctl

Convert the sis framebuffer driver to compat ioctl.
Signed-off-by: default avatarAndi Kleen <ak@muc.de>
Acked-by: default avatarThomas Winischhofer <thomas@winischhofer.net>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 395747af
...@@ -527,10 +527,6 @@ struct sis_video_info { ...@@ -527,10 +527,6 @@ struct sis_video_info {
int newrom; int newrom;
int registered; int registered;
int warncount; int warncount;
#ifdef SIS_CONFIG_COMPAT
int ioctl32registered;
int ioctl32vblankregistered;
#endif
int sisvga_engine; int sisvga_engine;
int hwcursor_size; int hwcursor_size;
......
...@@ -2192,11 +2192,22 @@ sisfb_ioctl(struct inode *inode, struct file *file, ...@@ -2192,11 +2192,22 @@ sisfb_ioctl(struct inode *inode, struct file *file,
break; break;
default: default:
return -EINVAL; return -ENOIOCTLCMD;
} }
return 0; return 0;
} }
#ifdef CONFIG_COMPAT
static long sisfb_compat_ioctl(struct file *f, unsigned cmd, unsigned long arg, struct fb_info *info)
{
int ret;
lock_kernel();
ret = sisfb_ioctl(NULL, f, cmd, arg, info);
unlock_kernel();
return ret;
}
#endif
static int static int
sisfb_get_fix(struct fb_fix_screeninfo *fix, int con, struct fb_info *info) sisfb_get_fix(struct fb_fix_screeninfo *fix, int con, struct fb_info *info)
{ {
...@@ -2258,7 +2269,10 @@ static struct fb_ops sisfb_ops = { ...@@ -2258,7 +2269,10 @@ static struct fb_ops sisfb_ops = {
.fb_imageblit = cfb_imageblit, .fb_imageblit = cfb_imageblit,
.fb_cursor = soft_cursor, .fb_cursor = soft_cursor,
.fb_sync = fbcon_sis_sync, .fb_sync = fbcon_sis_sync,
.fb_ioctl = sisfb_ioctl .fb_ioctl = sisfb_ioctl,
#ifdef CONFIG_COMPAT
.fb_compat_ioctl = sisfb_compat_ioctl,
#endif
}; };
#endif #endif
...@@ -4791,10 +4805,6 @@ int __devinit sisfb_probe(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -4791,10 +4805,6 @@ int __devinit sisfb_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
ivideo->pcifunc = PCI_FUNC(pdev->devfn); ivideo->pcifunc = PCI_FUNC(pdev->devfn);
ivideo->subsysvendor = pdev->subsystem_vendor; ivideo->subsysvendor = pdev->subsystem_vendor;
ivideo->subsysdevice = pdev->subsystem_device; ivideo->subsysdevice = pdev->subsystem_device;
#ifdef SIS_CONFIG_COMPAT
ivideo->ioctl32registered = 0;
ivideo->ioctl32vblankregistered = 0;
#endif
#ifndef MODULE #ifndef MODULE
if(sisfb_mode_idx == -1) { if(sisfb_mode_idx == -1) {
...@@ -5594,30 +5604,6 @@ int __devinit sisfb_probe(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -5594,30 +5604,6 @@ int __devinit sisfb_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
ivideo->next = card_list; ivideo->next = card_list;
card_list = ivideo; card_list = ivideo;
#ifdef SIS_CONFIG_COMPAT
{
int ret;
/* Our ioctls are all "32/64bit compatible" */
if(register_ioctl32_conversion(FBIOGET_VBLANK, NULL)) {
printk(KERN_ERR "sisfb: Error registering FBIOGET_VBLANK ioctl32 translation\n");
} else {
ivideo->ioctl32vblankregistered = 1;
}
ret = register_ioctl32_conversion(FBIO_ALLOC, NULL);
ret |= register_ioctl32_conversion(FBIO_FREE, NULL);
ret |= register_ioctl32_conversion(SISFB_GET_INFO_SIZE, NULL);
ret |= register_ioctl32_conversion(SISFB_GET_INFO, NULL);
ret |= register_ioctl32_conversion(SISFB_GET_TVPOSOFFSET, NULL);
ret |= register_ioctl32_conversion(SISFB_SET_TVPOSOFFSET, NULL);
ret |= register_ioctl32_conversion(SISFB_SET_LOCK, NULL);
ret |= register_ioctl32_conversion(SISFB_GET_VBRSTATUS, NULL);
ret |= register_ioctl32_conversion(SISFB_GET_AUTOMAXIMIZE, NULL);
ret |= register_ioctl32_conversion(SISFB_SET_AUTOMAXIMIZE, NULL);
if(ret) printk(KERN_ERR "sisfb: Error registering ioctl32 translations\n");
else ivideo->ioctl32registered = 1;
}
#endif
printk(KERN_INFO "sisfb: 2D acceleration is %s, y-panning %s\n", printk(KERN_INFO "sisfb: 2D acceleration is %s, y-panning %s\n",
ivideo->sisfb_accel ? "enabled" : "disabled", ivideo->sisfb_accel ? "enabled" : "disabled",
ivideo->sisfb_ypan ? ivideo->sisfb_ypan ?
...@@ -5649,28 +5635,6 @@ static void __devexit sisfb_remove(struct pci_dev *pdev) ...@@ -5649,28 +5635,6 @@ static void __devexit sisfb_remove(struct pci_dev *pdev)
struct fb_info *sis_fb_info = ivideo->memyselfandi; struct fb_info *sis_fb_info = ivideo->memyselfandi;
int registered = ivideo->registered; int registered = ivideo->registered;
#ifdef SIS_CONFIG_COMPAT
if(ivideo->ioctl32vblankregistered) {
if(unregister_ioctl32_conversion(FBIOGET_VBLANK)) {
printk(KERN_ERR "sisfb: Error unregistering FBIOGET_VBLANK ioctl32 translation\n");
}
}
if(ivideo->ioctl32registered) {
int ret;
ret = unregister_ioctl32_conversion(FBIO_ALLOC);
ret |= unregister_ioctl32_conversion(FBIO_FREE);
ret |= unregister_ioctl32_conversion(SISFB_GET_INFO_SIZE);
ret |= unregister_ioctl32_conversion(SISFB_GET_INFO);
ret |= unregister_ioctl32_conversion(SISFB_GET_TVPOSOFFSET);
ret |= unregister_ioctl32_conversion(SISFB_SET_TVPOSOFFSET);
ret |= unregister_ioctl32_conversion(SISFB_SET_LOCK);
ret |= unregister_ioctl32_conversion(SISFB_GET_VBRSTATUS);
ret |= unregister_ioctl32_conversion(SISFB_GET_AUTOMAXIMIZE);
ret |= unregister_ioctl32_conversion(SISFB_SET_AUTOMAXIMIZE);
if(ret) printk(KERN_ERR "sisfb: Error unregistering ioctl32 translations\n");
}
#endif
/* Unmap */ /* Unmap */
iounmap(ivideo->video_vbase); iounmap(ivideo->video_vbase);
iounmap(ivideo->mmio_vbase); iounmap(ivideo->mmio_vbase);
......
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