1 /*
2  * This file and its contents are supplied under the terms of the
3  * Common Development and Distribution License ("CDDL"), version 1.0.
4  * You may only use this file in accordance with the terms of version
5  * 1.0 of the CDDL.
6  *
7  * A full copy of the text of the CDDL should have accompanied this
8  * source.  A copy of the CDDL is also available via the Internet at
9  * http://www.illumos.org/license/CDDL.
10  */
11 
12 /*
13  * Copyright 2016 Toomas Soome <tsoome@me.com>
14  */
15 
16 #ifndef _GFXP_FB_H
17 #define	_GFXP_FB_H
18 
19 /*
20  * gfxp_fb interfaces.
21  */
22 
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26 
27 #define	TEXT_ROWS		25
28 #define	TEXT_COLS		80
29 
30 struct gfxp_fb_softc {
31 	struct vgaregmap	regs;
32 	struct vgaregmap	fb;
33 	off_t			fb_size;
34 	int			fb_regno;
35 	dev_info_t		*devi;
36 	int			mode;	/* KD_TEXT or KD_GRAPHICS */
37 	caddr_t			text_base;	/* hardware text base */
38 	char			shadow[TEXT_ROWS*TEXT_COLS*2];
39 	caddr_t			current_base;	/* hardware or shadow */
40 	struct {
41 		boolean_t visible;
42 		int row;
43 		int col;
44 	}			cursor;
45 	struct vis_polledio	polledio;
46 	struct {
47 		unsigned char red;
48 		unsigned char green;
49 		unsigned char blue;
50 	}			colormap[VGA8_CMAP_ENTRIES];
51 	unsigned char attrib_palette[VGA_ATR_NUM_PLT];
52 	unsigned int flags;
53 	kmutex_t lock;
54 };
55 
56 /* function definitions */
57 int gfxp_vga_attach(dev_info_t *, ddi_attach_cmd_t, gfxp_fb_softc_ptr_t);
58 int gfxp_vga_detach(dev_info_t *, ddi_detach_cmd_t, gfxp_fb_softc_ptr_t);
59 int gfxp_vga_ioctl(dev_t, int, intptr_t, int, cred_t *, int *,
60     gfxp_fb_softc_ptr_t);
61 int gfxp_vga_devmap(dev_t, devmap_cookie_t, offset_t, size_t, size_t *,
62     uint_t, void *);
63 
64 #ifdef __cplusplus
65 }
66 #endif
67 
68 #endif /* _GFXP_FB_H */
69