lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAL3m8eA=46wdwVosiE54eNx3FOuLyxfE5axKs_HjyMTGxDHRDw@mail.gmail.com>
Date:	Thu, 21 Jun 2012 07:22:50 -0500
From:	Strake <strake888@...il.com>
To:	Florian Tobias Schandinat <FlorianSchandinat@....de>,
	linux-fbdev@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH] fbdev: Add ioctls FBIO_COPYRECT, FBIO_FILLRECT, lest these
 operations be done in software.

From: Matthew Farkas-Dyck <strake888@...il.com>

Add ioctls FBIO_COPYRECT, FBIO_FILLRECT, lest these operations be done
in software.

Signed-off-by: Matthew Farkas-Dyck <strake888@...il.com>
---

Reason: If it can be done in hardware, it ought to be. This will
enable user-mode software to do so.

commit 2c002c58b6c5d5b211423da8eaa242ca443fdd72
Author: strake <strake888@...il.com>
Date:   Wed Jan 1 19:10:24 2003 -0500

    Add ioctls FBIO_COPYRECT, FBIO_FILLRECT

diff --git a/drivers/video/fbmem.c b/drivers/video/fbmem.c
index 4ac1201..f525e91 100644
--- a/drivers/video/fbmem.c
+++ b/drivers/video/fbmem.c
@@ -1019,6 +1019,8 @@ 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_copyarea copy;
+	struct fb_fillrect fill;
 	void __user *argp = (void __user *)arg;
 	long ret = 0;

@@ -1126,6 +1128,26 @@ static long do_fb_ioctl(struct fb_info *info,
unsigned int cmd,
 		console_unlock();
 		unlock_fb_info(info);
 		break;
+	case FBIO_FILLRECT:
+		if (copy_from_user(&fill, argp, sizeof(fill)))
+			return -EFAULT;
+		if (!lock_fb_info(info))
+			return -ENODEV;
+		console_lock();
+		(*(info->fbops->fb_fillrect))(info, &fill);
+		console_unlock();
+		unlock_fb_info(info);
+		break;
+	case FBIO_COPYRECT:
+		if (copy_from_user(&copy, argp, sizeof(copy)))
+			return -EFAULT;
+		if (!lock_fb_info(info))
+			return -ENODEV;
+		console_lock();
+		(*(info->fbops->fb_copyarea))(info, &copy);
+		console_unlock();
+		unlock_fb_info(info);
+		break;
 	default:
 		if (!lock_fb_info(info))
 			return -ENODEV;
diff --git a/include/linux/fb.h b/include/linux/fb.h
index d1631d3..fc18459 100644
--- a/include/linux/fb.h
+++ b/include/linux/fb.h
@@ -39,6 +39,8 @@
 #define FBIOPUT_MODEINFO        0x4617
 #define FBIOGET_DISPINFO        0x4618
 #define FBIO_WAITFORVSYNC	_IOW('F', 0x20, __u32)
+#define FBIO_COPYRECT		_IOW('F', 0x22, struct fb_copyarea)
+#define FBIO_FILLRECT		_IOW('F', 0x23, struct fb_fillrect)

 #define FB_TYPE_PACKED_PIXELS		0	/* Packed Pixels	*/
 #define FB_TYPE_PLANES			1	/* Non interleaved planes */
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ