diff options
Diffstat (limited to 'drivers/staging/gma500/psb_fb.c')
-rw-r--r-- | drivers/staging/gma500/psb_fb.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/drivers/staging/gma500/psb_fb.c b/drivers/staging/gma500/psb_fb.c index 6c75df504c50..6499f28cb2af 100644 --- a/drivers/staging/gma500/psb_fb.c +++ b/drivers/staging/gma500/psb_fb.c @@ -270,6 +270,31 @@ static int psbfb_mmap(struct fb_info *info, struct vm_area_struct *vma) return 0; } +static int psbfb_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg) +{ + struct psb_fbdev *fbdev = info->par; + struct psb_framebuffer *psbfb = fbdev->pfb; + struct drm_device *dev = psbfb->base.dev; + struct drm_psb_private *dev_priv = dev->dev_private; + u32 __user *p = (u32 __user *)arg; + u32 l; + u32 buf[32]; + switch (cmd) { + case 0x12345678: + if (!capable(CAP_SYS_RAWIO)) + return -EPERM; + if (get_user(l, p)) + return -EFAULT; + if (l > 32) + return -EMSGSIZE; + if (copy_from_user(buf, p + 1, l)) + return -EFAULT; + psbfb_2d_submit(dev_priv, buf, l); + return 0; + default: + return -ENOTTY; + } +} static struct fb_ops psbfb_ops = { .owner = THIS_MODULE, @@ -282,6 +307,7 @@ static struct fb_ops psbfb_ops = { .fb_imageblit = psbfb_imageblit, .fb_mmap = psbfb_mmap, .fb_sync = psbfb_sync, + .fb_ioctl = psbfb_ioctl, }; static struct drm_framebuffer *psb_framebuffer_create |