2 * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
4 * Copyright (c) 1998 Michael Smith and Kazutaka YOKOTA
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer as
12 * the first lines of this file unmodified.
13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the distribution.
17 * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR
18 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20 * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY DIRECT, INDIRECT,
21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 #ifndef _DEV_FB_VESA_H_
32 #define _DEV_FB_VESA_H_
36 /* mandatory fields */
37 u_int8_t v_sig[4]; /* VESA */
38 u_int16_t v_version; /* ver in BCD */
39 u_int32_t v_oemstr; /* OEM string */
40 u_int32_t v_flags; /* flags */
42 #define V_NONVGA (1<<1)
44 u_int32_t v_modetable; /* modes */
45 u_int16_t v_memsize; /* in 64K */
47 u_int16_t v_revision; /* software rev */
48 u_int32_t v_venderstr; /* vender */
49 u_int32_t v_prodstr; /* product name */
50 u_int32_t v_revstr; /* product rev */
51 u_int8_t v_strach[222];
52 u_int8_t v_oemdata[256];
57 /* mandatory fields */
59 #define V_MODESUPP (1<<0) /* VESA mode attributes */
60 #define V_MODEOPTINFO (1<<1)
61 #define V_MODEBIOSOUT (1<<2)
62 #define V_MODECOLOR (1<<3)
63 #define V_MODEGRAPHICS (1<<4)
64 #define V_MODENONVGA (1<<5)
65 #define V_MODENONBANK (1<<6)
66 #define V_MODELFB (1<<7)
67 #define V_MODEVESA (1<<16) /* Private attributes */
70 #define V_WATTREXIST (1<<0)
71 #define V_WATTRREAD (1<<1)
72 #define V_WATTRWRITE (1<<2)
78 u_int16_t v_bpscanline;
79 /* fields optional for 1.0/1.1 implementations */
94 #define V_MMDIRCOLOR 6
99 /* fields for 1.2+ implementations */
100 u_int8_t v_redmasksize;
101 u_int8_t v_redfieldpos;
102 u_int8_t v_greenmasksize;
103 u_int8_t v_greenfieldpos;
104 u_int8_t v_bluemasksize;
105 u_int8_t v_bluefieldpos;
106 u_int8_t v_resmasksize;
107 u_int8_t v_resfieldpos;
108 u_int8_t v_dircolormode;
109 /* 2.0 implementations */
111 u_int32_t v_offscreen;
112 u_int16_t v_offscreensize;
113 /* 3.0 implementations */
114 u_int16_t v_linbpscanline;
115 u_int8_t v_bankipages;
116 u_int8_t v_linipages;
117 u_int8_t v_linredmasksize;
118 u_int8_t v_linredfieldpos;
119 u_int8_t v_lingreenmasksize;
120 u_int8_t v_lingreenfieldpos;
121 u_int8_t v_linbluemasksize;
122 u_int8_t v_linbluefieldpos;
123 u_int8_t v_linresmasksize;
124 u_int8_t v_linresfieldpos;
125 u_int32_t v_maxpixelclock;
126 u_int8_t v_reserved1[190];
131 #define VESA_MODE(x) ((x) >= M_VESA_BASE && (x) <= M_VESA_MODE_MAX)
133 int vesa_load_ioctl(void);
134 int vesa_unload_ioctl(void);
138 #endif /* !_DEV_FB_VESA_H_ */