svn commit: r258491 - user/ed/newcons/sys/dev/fb

Aleksandr Rybalko ray at FreeBSD.org
Fri Nov 22 23:36:42 UTC 2013


Author: ray
Date: Fri Nov 22 23:36:41 2013
New Revision: 258491
URL: http://svnweb.freebsd.org/changeset/base/258491

Log:
  Implement minimum ioctls set for framebuffer device.
  
  Sponsored by:	The FreeBSD Foundation

Modified:
  user/ed/newcons/sys/dev/fb/fbd.c

Modified: user/ed/newcons/sys/dev/fb/fbd.c
==============================================================================
--- user/ed/newcons/sys/dev/fb/fbd.c	Fri Nov 22 22:12:11 2013	(r258490)
+++ user/ed/newcons/sys/dev/fb/fbd.c	Fri Nov 22 23:36:41 2013	(r258491)
@@ -109,8 +109,39 @@ static int
 fb_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int fflag,
     struct thread *td)
 {
+	struct fb_info *info;
+	int error;
 
-	return (0);
+	error = 0;
+	info = dev->si_drv1;
+
+	switch (cmd) {
+	case FBIOGTYPE:
+		bcopy(info, (struct fbtype *)data, sizeof(struct fbtype));
+		break;
+
+	case FBIO_GETWINORG:	/* get frame buffer window origin */
+		*(u_int *)data = 0;
+		break;
+
+	case FBIO_GETDISPSTART:	/* get display start address */
+		((video_display_start_t *)data)->x = 0;
+		((video_display_start_t *)data)->y = 0;
+		break;
+
+	case FBIO_GETLINEWIDTH:	/* get scan line width in bytes */
+		*(u_int *)data = info->fb_stride;
+		break;
+
+	case FBIO_BLANK:	/* blank display */
+		error = 0;	/* TODO */
+		break;
+
+	default:
+		error = ENOIOCTL;
+		break;
+	}
+	return (error);
 }
 
 static int


More information about the svn-src-user mailing list