xref: /illumos-gate/usr/src/uts/common/sys/visual_io.h (revision fa9eb222)
17c478bd9Sstevel@tonic-gate /*
27c478bd9Sstevel@tonic-gate  * CDDL HEADER START
37c478bd9Sstevel@tonic-gate  *
47c478bd9Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
5fea9cb91Slq150181  * Common Development and Distribution License (the "License").
6fea9cb91Slq150181  * You may not use this file except in compliance with the License.
77c478bd9Sstevel@tonic-gate  *
87c478bd9Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
97c478bd9Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
107c478bd9Sstevel@tonic-gate  * See the License for the specific language governing permissions
117c478bd9Sstevel@tonic-gate  * and limitations under the License.
127c478bd9Sstevel@tonic-gate  *
137c478bd9Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
147c478bd9Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
157c478bd9Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
167c478bd9Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
177c478bd9Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
187c478bd9Sstevel@tonic-gate  *
197c478bd9Sstevel@tonic-gate  * CDDL HEADER END
207c478bd9Sstevel@tonic-gate  */
21fea9cb91Slq150181 
227c478bd9Sstevel@tonic-gate /*
23fea9cb91Slq150181  * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
247c478bd9Sstevel@tonic-gate  * Use is subject to license terms.
257c478bd9Sstevel@tonic-gate  */
267c478bd9Sstevel@tonic-gate 
277c478bd9Sstevel@tonic-gate #ifndef _SYS_VISUAL_IO_H
287c478bd9Sstevel@tonic-gate #define	_SYS_VISUAL_IO_H
297c478bd9Sstevel@tonic-gate 
307c478bd9Sstevel@tonic-gate #ifdef __cplusplus
317c478bd9Sstevel@tonic-gate extern "C" {
327c478bd9Sstevel@tonic-gate #endif
337c478bd9Sstevel@tonic-gate 
347c478bd9Sstevel@tonic-gate #define	VIOC	('V' << 8)
357c478bd9Sstevel@tonic-gate #define	VIOCF	('F' << 8)
367c478bd9Sstevel@tonic-gate 
377c478bd9Sstevel@tonic-gate 
387c478bd9Sstevel@tonic-gate /*
397c478bd9Sstevel@tonic-gate  * Device Identification
407c478bd9Sstevel@tonic-gate  *
417c478bd9Sstevel@tonic-gate  * VIS_GETIDENTIFIER returns an identifier string to uniquely identify
427c478bd9Sstevel@tonic-gate  * a device type used in the Solaris VISUAL environment.  The identifier
437c478bd9Sstevel@tonic-gate  * must be unique.  We suggest the convention:
447c478bd9Sstevel@tonic-gate  *
457c478bd9Sstevel@tonic-gate  *	<companysymbol><devicetype>
467c478bd9Sstevel@tonic-gate  *
477c478bd9Sstevel@tonic-gate  * for example: SUNWcg6
487c478bd9Sstevel@tonic-gate  */
497c478bd9Sstevel@tonic-gate 
507c478bd9Sstevel@tonic-gate #define	VIS_MAXNAMELEN 128
517c478bd9Sstevel@tonic-gate 
527c478bd9Sstevel@tonic-gate struct vis_identifier {
537c478bd9Sstevel@tonic-gate 	char name[VIS_MAXNAMELEN];	/* <companysymbol><devicename>	*/
547c478bd9Sstevel@tonic-gate };
557c478bd9Sstevel@tonic-gate 
567c478bd9Sstevel@tonic-gate #define	VIS_GETIDENTIFIER	(VIOC | 0)
577c478bd9Sstevel@tonic-gate 
587c478bd9Sstevel@tonic-gate 
597c478bd9Sstevel@tonic-gate 
607c478bd9Sstevel@tonic-gate /*
617c478bd9Sstevel@tonic-gate  * Hardware Cursor Control
627c478bd9Sstevel@tonic-gate  *
637c478bd9Sstevel@tonic-gate  * Devices with hardware cursors may implement these ioctls in their
647c478bd9Sstevel@tonic-gate  * kernel device drivers.
657c478bd9Sstevel@tonic-gate  */
667c478bd9Sstevel@tonic-gate 
677c478bd9Sstevel@tonic-gate 
687c478bd9Sstevel@tonic-gate struct vis_cursorpos {
697c478bd9Sstevel@tonic-gate 	short x;		/* cursor x coordinate	*/
707c478bd9Sstevel@tonic-gate 	short y;		/* cursor y coordinate	*/
717c478bd9Sstevel@tonic-gate };
727c478bd9Sstevel@tonic-gate 
737c478bd9Sstevel@tonic-gate struct vis_cursorcmap {
747c478bd9Sstevel@tonic-gate 	int		version;	/* version			*/
757c478bd9Sstevel@tonic-gate 	int		reserved;
767c478bd9Sstevel@tonic-gate 	unsigned char	*red;		/* red color map elements	*/
777c478bd9Sstevel@tonic-gate 	unsigned char	*green;		/* green color map elements	*/
787c478bd9Sstevel@tonic-gate 	unsigned char	*blue;		/* blue color map elements	*/
797c478bd9Sstevel@tonic-gate };
807c478bd9Sstevel@tonic-gate 
817c478bd9Sstevel@tonic-gate 
827c478bd9Sstevel@tonic-gate /*
837c478bd9Sstevel@tonic-gate  * These ioctls fetch and set various cursor attributes, using the
847c478bd9Sstevel@tonic-gate  * vis_cursor struct.
857c478bd9Sstevel@tonic-gate  */
867c478bd9Sstevel@tonic-gate 
877c478bd9Sstevel@tonic-gate #define	VIS_SETCURSOR	(VIOCF|24)
887c478bd9Sstevel@tonic-gate #define	VIS_GETCURSOR	(VIOCF|25)
897c478bd9Sstevel@tonic-gate 
907c478bd9Sstevel@tonic-gate struct vis_cursor {
917c478bd9Sstevel@tonic-gate 	short			set;		/* what to set		*/
927c478bd9Sstevel@tonic-gate 	short			enable;		/* cursor on/off	*/
937c478bd9Sstevel@tonic-gate 	struct vis_cursorpos	pos;		/* cursor position	*/
947c478bd9Sstevel@tonic-gate 	struct vis_cursorpos	hot;		/* cursor hot spot	*/
957c478bd9Sstevel@tonic-gate 	struct vis_cursorcmap	cmap;		/* color map info	*/
967c478bd9Sstevel@tonic-gate 	struct vis_cursorpos	size;		/* cursor bit map size	*/
977c478bd9Sstevel@tonic-gate 	char			*image;		/* cursor image bits	*/
987c478bd9Sstevel@tonic-gate 	char			*mask;		/* cursor mask bits	*/
997c478bd9Sstevel@tonic-gate };
1007c478bd9Sstevel@tonic-gate 
1017c478bd9Sstevel@tonic-gate #define	VIS_CURSOR_SETCURSOR	0x01		/* set cursor		*/
1027c478bd9Sstevel@tonic-gate #define	VIS_CURSOR_SETPOSITION	0x02		/* set cursor position	*/
1037c478bd9Sstevel@tonic-gate #define	VIS_CURSOR_SETHOTSPOT	0x04		/* set cursor hot spot	*/
1047c478bd9Sstevel@tonic-gate #define	VIS_CURSOR_SETCOLORMAP	0x08		/* set cursor colormap	*/
1057c478bd9Sstevel@tonic-gate #define	VIS_CURSOR_SETSHAPE	0x10		/* set cursor shape	*/
1067c478bd9Sstevel@tonic-gate 
1077c478bd9Sstevel@tonic-gate #define	VIS_CURSOR_SETALL	(VIS_CURSOR_SETCURSOR | \
1087c478bd9Sstevel@tonic-gate     VIS_CURSOR_SETPOSITION	| \
1097c478bd9Sstevel@tonic-gate     VIS_CURSOR_SETHOTSPOT	| \
1107c478bd9Sstevel@tonic-gate     VIS_CURSOR_SETCOLORMAP	| \
1117c478bd9Sstevel@tonic-gate     VIS_CURSOR_SETSHAPE)
1127c478bd9Sstevel@tonic-gate 
1137c478bd9Sstevel@tonic-gate 
1147c478bd9Sstevel@tonic-gate /*
1157c478bd9Sstevel@tonic-gate  * These ioctls fetch and move the current cursor position, using the
1167c478bd9Sstevel@tonic-gate  * vis_cursorposition struct.
1177c478bd9Sstevel@tonic-gate  */
1187c478bd9Sstevel@tonic-gate 
1197c478bd9Sstevel@tonic-gate #define	VIS_MOVECURSOR		(VIOCF|26)
1207c478bd9Sstevel@tonic-gate #define	VIS_GETCURSORPOS	(VIOCF|27)
1217c478bd9Sstevel@tonic-gate 
1227c478bd9Sstevel@tonic-gate /*
1237c478bd9Sstevel@tonic-gate  * VIS_SETCMAP:
1247c478bd9Sstevel@tonic-gate  * VIS_GETCMAP:
1257c478bd9Sstevel@tonic-gate  * Set/Get the indicated color map entries.  The index states the first
1267c478bd9Sstevel@tonic-gate  * color to be update and count specifies the number of entries to be
1277c478bd9Sstevel@tonic-gate  * updated from index.  red, green, and blue are arrays of color
1287c478bd9Sstevel@tonic-gate  * values.  The length of the arrays is count.
1297c478bd9Sstevel@tonic-gate  */
1307c478bd9Sstevel@tonic-gate #define	VIS_GETCMAP	(VIOC|9)
1317c478bd9Sstevel@tonic-gate #define	VIS_PUTCMAP	(VIOC|10)
132fea9cb91Slq150181 struct vis_cmap {
1337c478bd9Sstevel@tonic-gate 	int		index; /* Index into colormap to start updating */
1347c478bd9Sstevel@tonic-gate 	int		count; /* Number of entries to update */
1357c478bd9Sstevel@tonic-gate 	unsigned char	*red; /* List of red values */
1367c478bd9Sstevel@tonic-gate 	unsigned char	*green; /* List of green values */
1377c478bd9Sstevel@tonic-gate 	unsigned char	*blue; /* List of blue values */
1387c478bd9Sstevel@tonic-gate };
1397c478bd9Sstevel@tonic-gate 
1407c478bd9Sstevel@tonic-gate 
1419890ff83SToomas Soome #if defined(_KERNEL) || defined(_STANDALONE)
1427c478bd9Sstevel@tonic-gate /*
1437c478bd9Sstevel@tonic-gate  * The following ioctls are used for communication between the layered
1447c478bd9Sstevel@tonic-gate  * device and the framebuffer.  The layered driver calls the framebuffer
1457c478bd9Sstevel@tonic-gate  * with these ioctls.
1467c478bd9Sstevel@tonic-gate  *
1477c478bd9Sstevel@tonic-gate  * On machines that don't have a prom, kmdb uses the kernel to display
1487c478bd9Sstevel@tonic-gate  * characters.  The kernel in turn will use the routines returned by
1497c478bd9Sstevel@tonic-gate  * VIS_DEVINIT to ask the framebuffer driver to display the data.  The
1507c478bd9Sstevel@tonic-gate  * framebuffer driver CANNOT use any DDI services to display this data.  It
1517c478bd9Sstevel@tonic-gate  * must just dump the data to the framebuffer.  In particular, the mutex and
1527c478bd9Sstevel@tonic-gate  * copy routines do not work.
1537c478bd9Sstevel@tonic-gate  *
1547c478bd9Sstevel@tonic-gate  * On machines without a prom, the framebuffer driver must implement all
1557c478bd9Sstevel@tonic-gate  * of these ioctls to be a console.  On machines with a prom, the
1567c478bd9Sstevel@tonic-gate  * framebuffer driver can set vis_devinit.polledio to NULL.
1577c478bd9Sstevel@tonic-gate  */
1587c478bd9Sstevel@tonic-gate typedef short screen_pos_t;
1597c478bd9Sstevel@tonic-gate typedef short screen_size_t;
1607c478bd9Sstevel@tonic-gate 
1617c478bd9Sstevel@tonic-gate /*
1627c478bd9Sstevel@tonic-gate  * Union of pixel depths
1637c478bd9Sstevel@tonic-gate  */
1647c478bd9Sstevel@tonic-gate typedef union {
1657c478bd9Sstevel@tonic-gate 	unsigned char mono;		/* one-bit */
1667c478bd9Sstevel@tonic-gate 	unsigned char four;		/* four bit */
1677c478bd9Sstevel@tonic-gate 	unsigned char eight;		/* eight bit */
1689890ff83SToomas Soome 	unsigned char sixteen[2];	/* 16 bit */
1697c478bd9Sstevel@tonic-gate 	unsigned char twentyfour[3];	/* 24 bit */
170*fa9eb222SToomas Soome 	unsigned char thirtytwo[4];	/* 32 bit */
1717c478bd9Sstevel@tonic-gate } color_t;
1727c478bd9Sstevel@tonic-gate 
1737c478bd9Sstevel@tonic-gate /*
1747c478bd9Sstevel@tonic-gate  * VIS_DEVINIT:
1757c478bd9Sstevel@tonic-gate  * Initialize the framebuffer as a console device.  The terminal emulator
1767c478bd9Sstevel@tonic-gate  * will provide the following structure to the device driver to be filled in.
1777c478bd9Sstevel@tonic-gate  * The driver is expected to fill it in.
1787c478bd9Sstevel@tonic-gate  *
1797c478bd9Sstevel@tonic-gate  * ioctl(fd, VIS_DEVINIT, struct vis_devinit *)
1807c478bd9Sstevel@tonic-gate  */
1817c478bd9Sstevel@tonic-gate #define	VIS_DEVINIT	(VIOC|1)
182*fa9eb222SToomas Soome #define	VIS_CONS_REV		5 /* Console IO interface version */
1837c478bd9Sstevel@tonic-gate /* Modes */
1847c478bd9Sstevel@tonic-gate #define	VIS_TEXT		0 /* Use text mode when displaying data */
1857c478bd9Sstevel@tonic-gate #define	VIS_PIXEL		1 /* Use pixel mode when displaying data */
1867c478bd9Sstevel@tonic-gate 
1877c478bd9Sstevel@tonic-gate /*
1887c478bd9Sstevel@tonic-gate  * VIS_DEVFINI:
1897c478bd9Sstevel@tonic-gate  * Tells the framebuffer that it is no longer being used as a console.
1907c478bd9Sstevel@tonic-gate  *
1917c478bd9Sstevel@tonic-gate  * ioctl(fd, VIS_DEVFINI, unused)
1927c478bd9Sstevel@tonic-gate  */
1937c478bd9Sstevel@tonic-gate #define	VIS_DEVFINI	(VIOC|2)
1947c478bd9Sstevel@tonic-gate 
1957c478bd9Sstevel@tonic-gate /*
1967c478bd9Sstevel@tonic-gate  * VIS_CONSCURSOR:
1977c478bd9Sstevel@tonic-gate  * Display/Hide cursor on the screen.  The layered driver uses this ioctl to
1987c478bd9Sstevel@tonic-gate  * display, hide, and move the cursor on the console.  The framebuffer driver
1997c478bd9Sstevel@tonic-gate  * is expected to draw a cursor at position (col,row) of size width x height.
2007c478bd9Sstevel@tonic-gate  *
2017c478bd9Sstevel@tonic-gate  * ioctl(fd, VIS_CONSCURSOR, struct vis_conscursor *)
2027c478bd9Sstevel@tonic-gate  */
2037c478bd9Sstevel@tonic-gate #define	VIS_CONSCURSOR		(VIOC|3)
2047c478bd9Sstevel@tonic-gate /* Cursor action - Either display or hide cursor */
2057c478bd9Sstevel@tonic-gate #define	VIS_HIDE_CURSOR		0
2067c478bd9Sstevel@tonic-gate #define	VIS_DISPLAY_CURSOR	1
2077c478bd9Sstevel@tonic-gate #define	VIS_GET_CURSOR		2
2087c478bd9Sstevel@tonic-gate 
2097c478bd9Sstevel@tonic-gate /*
2107c478bd9Sstevel@tonic-gate  * VIS_CONSDISPLAY:
2117c478bd9Sstevel@tonic-gate  * Display data on the framebuffer.  The data will be in the form specified
2127c478bd9Sstevel@tonic-gate  * by the driver during console initialization (see VIS_CONSDEVINIT above).
2137c478bd9Sstevel@tonic-gate  * The driver is expected to display the data at location (row,col).  Width
2147c478bd9Sstevel@tonic-gate  * and height specify the size of the data.
2157c478bd9Sstevel@tonic-gate  *
2167c478bd9Sstevel@tonic-gate  * ioctl(fd, VIS_CONSDISPLAY, struct vis_consdisplay *)
2177c478bd9Sstevel@tonic-gate  */
2187c478bd9Sstevel@tonic-gate 
2197c478bd9Sstevel@tonic-gate #define	VIS_CONSDISPLAY		(VIOC|5)
2207c478bd9Sstevel@tonic-gate 
2217c478bd9Sstevel@tonic-gate /*
2227c478bd9Sstevel@tonic-gate  * VIS_CONSCOPY:
2237c478bd9Sstevel@tonic-gate  * Move data on the framebuffer.  Used to scroll the screen by the terminal
2247c478bd9Sstevel@tonic-gate  * emulator or to move data by applications.  The driver must copy the data
2257c478bd9Sstevel@tonic-gate  * specified by the rectangle (s_col,s_row),(e_col,e_row) to the location
2267c478bd9Sstevel@tonic-gate  * which starts at (t_col,t_row), handling overlapping copies correctly.
2277c478bd9Sstevel@tonic-gate  *
2287c478bd9Sstevel@tonic-gate  * ioctl(fd, VIS_CONSCOPY, struct vis_conscopy *)
2297c478bd9Sstevel@tonic-gate  */
2307c478bd9Sstevel@tonic-gate #define	VIS_CONSCOPY		(VIOC|7)
2317c478bd9Sstevel@tonic-gate 
2329890ff83SToomas Soome /*
2339890ff83SToomas Soome  * VIS_CONSCLEAR:
2349890ff83SToomas Soome  * Clear the screen using provided color. Used on VIS_PIXEL mode.
2359890ff83SToomas Soome  *
2369890ff83SToomas Soome  * ioctl(fd, VIS_CONSCLEAR, struct vis_consclear *)
2379890ff83SToomas Soome  */
2389890ff83SToomas Soome #define	VIS_CONSCLEAR		(VIOC|8)
2399890ff83SToomas Soome 
2409890ff83SToomas Soome struct vis_consclear {
241*fa9eb222SToomas Soome 	color_t	bg_color; /* Background color */
2429890ff83SToomas Soome };
2439890ff83SToomas Soome 
2447c478bd9Sstevel@tonic-gate struct vis_consdisplay {
2457c478bd9Sstevel@tonic-gate 	screen_pos_t	row; /* Row to display data at */
2467c478bd9Sstevel@tonic-gate 	screen_pos_t	col; /* Col to display data at */
2477c478bd9Sstevel@tonic-gate 	screen_size_t	width; /* Width of data */
2487c478bd9Sstevel@tonic-gate 	screen_size_t	height; /* Height of data */
2497c478bd9Sstevel@tonic-gate 	unsigned char	*data; /* Data to display */
250*fa9eb222SToomas Soome 	color_t		fg_color; /* Foreground color */
251*fa9eb222SToomas Soome 	color_t		bg_color; /* Background color */
2527c478bd9Sstevel@tonic-gate };
2537c478bd9Sstevel@tonic-gate 
2547c478bd9Sstevel@tonic-gate struct vis_conscopy {
2557c478bd9Sstevel@tonic-gate 	screen_pos_t	s_row; /* Starting row */
2567c478bd9Sstevel@tonic-gate 	screen_pos_t	s_col; /* Starting col */
2577c478bd9Sstevel@tonic-gate 	screen_pos_t	e_row; /* Ending row */
2587c478bd9Sstevel@tonic-gate 	screen_pos_t	e_col; /* Ending col */
2597c478bd9Sstevel@tonic-gate 	screen_pos_t	t_row; /* Row to move to */
2607c478bd9Sstevel@tonic-gate 	screen_pos_t	t_col; /* Col to move to */
2617c478bd9Sstevel@tonic-gate };
2627c478bd9Sstevel@tonic-gate 
2637c478bd9Sstevel@tonic-gate struct vis_conscursor {
2647c478bd9Sstevel@tonic-gate 	screen_pos_t	row; /* Row to display cursor at */
2657c478bd9Sstevel@tonic-gate 	screen_pos_t	col; /* Col to display cursor at */
2667c478bd9Sstevel@tonic-gate 	screen_size_t	width; /* Width of cursor */
2677c478bd9Sstevel@tonic-gate 	screen_size_t	height; /* Height of cursor */
2687c478bd9Sstevel@tonic-gate 	color_t		fg_color; /* Foreground color */
2697c478bd9Sstevel@tonic-gate 	color_t		bg_color; /* Background color */
2707c478bd9Sstevel@tonic-gate 	short		action; /* Hide or show cursor */
2717c478bd9Sstevel@tonic-gate };
2727c478bd9Sstevel@tonic-gate 
2737c478bd9Sstevel@tonic-gate /*
2747c478bd9Sstevel@tonic-gate  * Each software-console-capable frame buffer driver defines its own
2757c478bd9Sstevel@tonic-gate  * instance of this (with its own name!) and casts to/from this at the
276fea9cb91Slq150181  * interface with the terminal emulator.  These yield somewhat better
2777c478bd9Sstevel@tonic-gate  * type checking than "void *".
2787c478bd9Sstevel@tonic-gate  */
2797c478bd9Sstevel@tonic-gate struct vis_polledio_arg;
280fea9cb91Slq150181 struct vis_modechg_arg;
2817c478bd9Sstevel@tonic-gate 
2827c478bd9Sstevel@tonic-gate /*
2837c478bd9Sstevel@tonic-gate  * Each software-console-capable frame buffer driver supplies these routines
2847c478bd9Sstevel@tonic-gate  * for I/O from "polled" contexts - kmdb, OBP, etc.  No system services are
2857c478bd9Sstevel@tonic-gate  * available.
2867c478bd9Sstevel@tonic-gate  */
2877c478bd9Sstevel@tonic-gate struct vis_polledio {
2887c478bd9Sstevel@tonic-gate 	struct vis_polledio_arg	*arg;
289fea9cb91Slq150181 	void	(*display)(struct vis_polledio_arg *, struct vis_consdisplay *);
2907c478bd9Sstevel@tonic-gate 	void	(*copy)(struct vis_polledio_arg *, struct vis_conscopy *);
2917c478bd9Sstevel@tonic-gate 	void	(*cursor)(struct vis_polledio_arg *, struct vis_conscursor *);
2927c478bd9Sstevel@tonic-gate };
2937c478bd9Sstevel@tonic-gate 
294fea9cb91Slq150181 struct vis_devinit; /* forward decl. for typedef */
295fea9cb91Slq150181 
296fea9cb91Slq150181 typedef void (*vis_modechg_cb_t)(struct vis_modechg_arg *,
297fea9cb91Slq150181     struct vis_devinit *);
298fea9cb91Slq150181 
2999890ff83SToomas Soome typedef uint32_t (*color_map_fn_t)(uint8_t color);
3009890ff83SToomas Soome 
3017c478bd9Sstevel@tonic-gate struct vis_devinit {
302fea9cb91Slq150181 	/*
303fea9cb91Slq150181 	 * This set of fields are used as parameters passed from the
304fea9cb91Slq150181 	 * layered framebuffer driver to the terminal emulator.
305fea9cb91Slq150181 	 */
3067c478bd9Sstevel@tonic-gate 	int		version;	/* Console IO interface version */
3077c478bd9Sstevel@tonic-gate 	screen_size_t	width;		/* Width of the device */
3087c478bd9Sstevel@tonic-gate 	screen_size_t	height;		/* Height of the device */
3097c478bd9Sstevel@tonic-gate 	screen_size_t	linebytes;	/* Bytes per scan line */
3107c478bd9Sstevel@tonic-gate 	int		depth;		/* Device depth */
3119890ff83SToomas Soome 	color_map_fn_t	color_map;	/* Color map tem -> fb */
3127c478bd9Sstevel@tonic-gate 	short		mode;		/* Mode to use when displaying data */
3137c478bd9Sstevel@tonic-gate 	struct vis_polledio *polledio;	/* Polled output routines */
314fea9cb91Slq150181 
315fea9cb91Slq150181 	/*
316fea9cb91Slq150181 	 * The following fields are used as parameters passed from the
317fea9cb91Slq150181 	 * terminal emulator to the underlying framebuffer driver.
318fea9cb91Slq150181 	 */
319fea9cb91Slq150181 	vis_modechg_cb_t modechg_cb;	/* Video mode change callback */
320fea9cb91Slq150181 	struct vis_modechg_arg *modechg_arg; /* Mode change cb arg */
3217c478bd9Sstevel@tonic-gate };
3227c478bd9Sstevel@tonic-gate 
3239890ff83SToomas Soome struct visual_ops {
3249890ff83SToomas Soome 	const struct vis_identifier *ident;
3259890ff83SToomas Soome 	int (*kdsetmode)(int);
3269890ff83SToomas Soome 	int (*devinit)(struct vis_devinit *);
3279890ff83SToomas Soome 	void (*cons_copy)(struct vis_conscopy *);
3289890ff83SToomas Soome 	void (*cons_display)(struct vis_consdisplay *);
3299890ff83SToomas Soome 	void (*cons_cursor)(struct vis_conscursor *);
3309890ff83SToomas Soome 	int (*cons_clear)(struct vis_consclear *);
3319890ff83SToomas Soome 	int (*cons_put_cmap)(struct vis_cmap *);
3329890ff83SToomas Soome };
3339890ff83SToomas Soome 
3349890ff83SToomas Soome #endif	/* _KERNEL || _STANDALONE */
3357c478bd9Sstevel@tonic-gate 
3367c478bd9Sstevel@tonic-gate #ifdef __cplusplus
3377c478bd9Sstevel@tonic-gate }
3387c478bd9Sstevel@tonic-gate #endif
3397c478bd9Sstevel@tonic-gate 
3407c478bd9Sstevel@tonic-gate #endif	/* !_SYS_VISUAL_IO_H */
341