Index: wsconsio.h
===================================================================
RCS file: /cvsroot/src/sys/dev/wscons/wsconsio.h,v
retrieving revision 1.106
diff -u -w -r1.106 wsconsio.h
--- wsconsio.h	21 Jan 2013 14:15:03 -0000	1.106
+++ wsconsio.h	27 Jan 2013 02:41:40 -0000
@@ -603,4 +603,50 @@
 #define WSDISPLAYIO_SET_POLLING	_IOW('W', 103, int)
 #define WSDISPLAYIOMGWEHITANDKILLEDASKUNK WSDISPLAYIO_SET_POLLING
 
+/*
+ * this is supposed to replace WSDISPLAYIO_GINFO, WSDISPLAYIO_GTYPE,
+ * WSDISPLAYIO_LINEBYTES etc.
+ */
+
+/* format type - colour index, 'true' colour etc. */
+#define WSFB_RGB	0
+#define WSFB_CI		1	/* colour indexed, see subtype */
+#define WSFB_GREYSCALE	2
+#define WSFB_YUV	3
+
+struct wsdisplayio_fbinfo {
+	uint32_t fbi_width;			/* in pixels */
+	uint32_t fbi_height;			/* in lines */
+	uint32_t fbi_stride;			/* in bytes */
+	uint32_t fbi_bitsperpixel;
+	uint32_t fbi_pixeltype;			/* see above */
+	union _fbi_subtype {
+		struct _fbi_rgbmasks {
+			/* offsets from the right, size in bits */
+			uint32_t red_offset;
+			uint32_t red_size;
+			uint32_t green_offset;
+			uint32_t green_size;
+			uint32_t blue_offset;
+			uint32_t blue_size;
+			uint32_t alpha_offset;
+			uint32_t alpha_size;
+		} fbi_rgbmasks;
+		struct _fbi_cmapinfo {
+			uint32_t cmap_entries;
+		} fbi_cmapinfo;
+		/* 
+		 * TODO:
+		 * add parameter blocks for greyscale, yuv etc.
+		 */
+	} fbi_subtype;
+	uint64_t fbi_fbsize;			/* framebuffer size in bytes */
+	uint32_t fbi_flags;
+};
+
+/* fbi_flags */
+#define WSFB_VRAM_IS_RAM	1	/* hint for wsfb - don't shadow */
+
+#define WSDISPLAYIO_GET_FBINFO	_IOWR('W', 104, struct wsdisplayio_fbinfo)
+
 #endif /* _DEV_WSCONS_WSCONSIO_H_ */
Index: wsdisplay_util.c
===================================================================
RCS file: /cvsroot/src/sys/dev/wscons/wsdisplay_util.c,v
retrieving revision 1.1
diff -u -w -r1.1 wsdisplay_util.c
--- wsdisplay_util.c	29 Jun 2011 03:09:37 -0000	1.1
+++ wsdisplay_util.c	27 Jan 2013 02:41:41 -0000
@@ -1,7 +1,7 @@
 /*	$NetBSD: wsdisplay_util.c,v 1.1 2011/06/29 03:09:37 macallan Exp $ */
 
 /*-
- * Copyright (c) 2009 Michael Lorenz
+ * Copyright (c) 2011 Michael Lorenz
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -27,6 +27,7 @@
  */
 
 /* some utility functions for use with wsdisplay */
+
 #include <sys/param.h>
 #include <sys/stdint.h>
 #include <sys/systm.h>
@@ -35,6 +36,7 @@
 #include <dev/cons.h>
 
 #include <dev/wscons/wsdisplayvar.h>
+#include <dev/rasops/rasops.h>
 #include <dev/wscons/wsconsio.h>
 
 int
@@ -57,3 +59,30 @@
 	}
 	return ENODEV;
 }
+
+/* convenience function to fill in stuff from rasops_info */
+int
+wsdisplayio_get_fbinfo(struct rasops_info *ri, struct wsdisplayio_fbinfo *fbi)
+{
+	fbi->fbi_width = ri->ri_width;
+	fbi->fbi_height = ri->ri_height;
+	fbi->fbi_stride = ri->ri_stride;
+	fbi->fbi_bitsperpixel = ri->ri_depth;
+	if (ri->ri_depth > 8) {
+		fbi->fbi_pixeltype = WSFB_RGB;
+		fbi->fbi_subtype.fbi_rgbmasks.red_offset = ri->ri_rpos;
+		fbi->fbi_subtype.fbi_rgbmasks.red_size = ri->ri_rnum;
+		fbi->fbi_subtype.fbi_rgbmasks.green_offset = ri->ri_gpos;
+		fbi->fbi_subtype.fbi_rgbmasks.green_size = ri->ri_gnum;
+		fbi->fbi_subtype.fbi_rgbmasks.blue_offset = ri->ri_bpos;
+		fbi->fbi_subtype.fbi_rgbmasks.blue_size = ri->ri_bnum;
+		fbi->fbi_subtype.fbi_rgbmasks.alpha_offset = 0;
+		fbi->fbi_subtype.fbi_rgbmasks.alpha_size = 0;
+	} else {
+		fbi->fbi_subtype.fbi_cmapinfo.cmap_entries = 1 << ri->ri_depth;
+	}
+	fbi->fbi_flags = 0;
+	fbi->fbi_fbsize = ri->ri_stride * ri->ri_height;
+
+	return 0;
+}
Index: wsdisplayvar.h
===================================================================
RCS file: /cvsroot/src/sys/dev/wscons/wsdisplayvar.h,v
retrieving revision 1.49
diff -u -w -r1.49 wsdisplayvar.h
--- wsdisplayvar.h	29 Jun 2011 03:11:59 -0000	1.49
+++ wsdisplayvar.h	27 Jan 2013 02:41:41 -0000
@@ -204,9 +204,15 @@
 int wsdisplay_cfg_ioctl(struct wsdisplay_softc *, u_long, void *,
 			int, struct lwp *);
 
 struct wsdisplayio_edid_info;
 int wsdisplayio_get_edid(device_t, struct wsdisplayio_edid_info *);
 
+struct wsdisplayio_fbinfo;
+struct rasops_info;
+int wsdisplayio_get_fbinfo(struct rasops_info *, struct wsdisplayio_fbinfo *);
+
 #ifdef WSDISPLAY_SCROLLSUPPORT
 void wsdisplay_scroll(void *, int);
 #endif
