From: Ali Gholami Rudi <ali@rudi.ir>
To: fbdev <linux-fbdev-devel@lists.sourceforge.net>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Andrea Righi <righi.andrea@gmail.com>,
Krzysztof Helt <krzysztof.h1@wp.pl>,
Greg Kroah-Hartman <gregkh@suse.de>,
Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>,
Philippe De Muyter <phdm@macqel.be>,
linux-kernel@vger.kernel.org
Subject: [PATCH 1/2] fbdev: add FBIOFILLRECT ioctl
Date: Mon, 13 Jul 2009 19:48:41 +0430 [thread overview]
Message-ID: <20090713151841.GB1297@lilem.mirepesht> (raw)
In-Reply-To: <20090713151709.GA1297@lilem.mirepesht>
Signed-off-by: Ali Gholami Rudi <ali@rudi.ir>
---
drivers/video/fbmem.c | 25 +++++++++++++++++++++++++
include/linux/fb.h | 1 +
2 files changed, 26 insertions(+), 0 deletions(-)
diff --git a/drivers/video/fbmem.c b/drivers/video/fbmem.c
index a85c818..a90cd0f 100644
--- a/drivers/video/fbmem.c
+++ b/drivers/video/fbmem.c
@@ -1016,6 +1016,25 @@ fb_blank(struct fb_info *info, int blank)
return ret;
}
+static int fb_fillrect_user(struct fb_info *info,
+ struct fb_fillrect *fill)
+{
+ int ret = 0;
+ if (fill->rop != ROP_COPY && fill->rop != ROP_XOR)
+ return -EINVAL;
+ if (!lock_fb_info(info))
+ return -ENODEV;
+ if (fill->dx + fill->width > info->var.xres ||
+ fill->dy + fill->height > info->var.yres) {
+ ret = -EINVAL;
+ goto out;
+ }
+ info->fbops->fb_fillrect(info, fill);
+out:
+ unlock_fb_info(info);
+ return ret;
+}
+
static long do_fb_ioctl(struct fb_info *info, unsigned int cmd,
unsigned long arg)
{
@@ -1026,6 +1045,7 @@ static long do_fb_ioctl(struct fb_info *info, unsigned int cmd,
struct fb_cmap cmap_from;
struct fb_cmap_user cmap;
struct fb_event event;
+ struct fb_fillrect fill;
void __user *argp = (void __user *)arg;
long ret = 0;
@@ -1133,6 +1153,11 @@ static long do_fb_ioctl(struct fb_info *info, unsigned int cmd,
release_console_sem();
unlock_fb_info(info);
break;
+ case FBIOFILLRECT:
+ if (copy_from_user(&fill, argp, sizeof(fill)))
+ return -EFAULT;
+ ret = fb_fillrect_user(info, &fill);
+ break;
default:
if (!lock_fb_info(info))
return -ENODEV;
diff --git a/include/linux/fb.h b/include/linux/fb.h
index f847df9..40cc99a 100644
--- a/include/linux/fb.h
+++ b/include/linux/fb.h
@@ -37,6 +37,7 @@ struct dentry;
#define FBIOGET_HWCINFO 0x4616
#define FBIOPUT_MODEINFO 0x4617
#define FBIOGET_DISPINFO 0x4618
+#define FBIOFILLRECT 0x4619
#define FB_TYPE_PACKED_PIXELS 0 /* Packed Pixels */
next prev parent reply other threads:[~2009-07-13 15:18 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-13 15:17 [PATCH 0/2] fbdev: add fillrect and copyarea ioctls Ali Gholami Rudi
2009-07-13 15:18 ` Ali Gholami Rudi [this message]
2009-07-13 15:20 ` [PATCH 2/2] fbdev: add FBIOCOPYAREA ioctl Ali Gholami Rudi
2009-07-13 15:40 ` [PATCH 0/2] fbdev: add fillrect and copyarea ioctls Arjan van de Ven
2009-07-13 16:25 ` Ali Gholami Rudi
2009-07-14 0:46 ` Dave Airlie
2009-07-14 3:43 ` Ali Gholami Rudi
2009-07-14 3:56 ` Dave Airlie
2009-07-14 9:47 ` Stelios Xanthakis
2009-07-13 16:35 ` Greg KH
2009-07-13 18:53 ` Arnd Bergmann
2009-07-13 19:52 ` Ali Gholami Rudi
2009-07-13 20:08 ` Ali Gholami Rudi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090713151841.GB1297@lilem.mirepesht \
--to=ali@rudi.ir \
--cc=Geert.Uytterhoeven@sonycom.com \
--cc=akpm@linux-foundation.org \
--cc=gregkh@suse.de \
--cc=krzysztof.h1@wp.pl \
--cc=linux-fbdev-devel@lists.sourceforge.net \
--cc=linux-kernel@vger.kernel.org \
--cc=phdm@macqel.be \
--cc=righi.andrea@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox