]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - sys/alpha/include/pc/vesa.h
unfinished sblive driver, playback/mixer only for now - not enabled in
[FreeBSD/FreeBSD.git] / sys / alpha / include / pc / vesa.h
1 /*-
2  * Copyright (c) 1998 Kazutaka YOKOTA (yokota@zodiac.mech.utsunomiya-u.ac.jp)
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  * 1. Redistributions of source code must retain the above copyright
9  *    notice, this list of conditions and the following disclaimer.
10  * 2. Redistributions in binary form must reproduce the above copyright
11  *    notice, this list of conditions and the following disclaimer in the
12  *    documentation and/or other materials provided with the distribution.
13  * 3. The name of the author may not be used to endorse or promote 
14  *    products derived from this software without specific prior written 
15  *    permission.
16  *
17  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
18  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
21  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27  * SUCH DAMAGE.
28  *
29  * $FreeBSD$
30  * from: i386/include/pc vesa.h,v 1.1
31  */
32
33 #ifndef _MACHINE_PC_VESA_H
34 #define _MACHINE_PC_VESA_H
35
36 struct vesa_info
37 {
38     /* mandatory fields */
39     u_int8_t            v_sig[4] __attribute__ ((packed));      /* VESA */
40     u_int16_t           v_version __attribute__ ((packed));     /* ver in BCD */
41     u_int32_t           v_oemstr __attribute__ ((packed));      /* OEM string */
42     u_int32_t           v_flags __attribute__ ((packed));       /* flags */
43 #define V_DAC8          (1<<0)
44 #define V_NONVGA        (1<<1)
45 #define V_SNOW          (1<<2)
46     u_int32_t           v_modetable __attribute__ ((packed));   /* modes */
47     u_int16_t           v_memsize __attribute__ ((packed));     /* in 64K */
48     /* 2.0 */
49     u_int16_t           v_revision __attribute__ ((packed));    /* software rev */
50     u_int32_t           v_venderstr __attribute__ ((packed));   /* vender */
51     u_int32_t           v_prodstr __attribute__ ((packed));     /* product name */
52     u_int32_t           v_revstr __attribute__ ((packed));      /* product rev */
53 };
54
55 struct vesa_mode 
56 {
57     /* mandatory fields */
58     u_int16_t           v_modeattr;
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 */
68     u_int8_t            v_waattr;
69     u_int8_t            v_wbattr;
70 #define V_WATTREXIST    (1<<0)
71 #define V_WATTRREAD     (1<<1)
72 #define V_WATTRWRITE    (1<<2)
73     u_int16_t           v_wgran;
74     u_int16_t           v_wsize;
75     u_int16_t           v_waseg;
76     u_int16_t           v_wbseg;
77     u_int32_t           v_posfunc;
78     u_int16_t           v_bpscanline;
79     /* fields optional for 1.0/1.1 implementations */
80     u_int16_t           v_width;
81     u_int16_t           v_height;
82     u_int8_t            v_cwidth;
83     u_int8_t            v_cheight;
84     u_int8_t            v_planes;
85     u_int8_t            v_bpp;
86     u_int8_t            v_banks;
87     u_int8_t            v_memmodel;
88 #define V_MMTEXT        0
89 #define V_MMCGA         1
90 #define V_MMHGC         2
91 #define V_MMEGA         3
92 #define V_MMPACKED      4
93 #define V_MMSEQU256     5
94 #define V_MMDIRCOLOR    6
95 #define V_MMYUV         7
96     u_int8_t            v_banksize;
97     u_int8_t            v_ipages;
98     u_int8_t            v_reserved0;
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 */
110     u_int32_t           v_lfb;
111     u_int32_t           v_offscreen;
112     u_int8_t            v_offscreensize;
113 };
114
115 #ifdef _KERNEL
116
117 #define VESA_MODE(x)    ((x) >= M_VESA_BASE)
118
119 int vesa_load_ioctl(void);
120 int vesa_unload_ioctl(void);
121
122 #ifndef VESA_MODULE
123 int vesa_load(void);
124 #endif
125
126 #endif /* _KERNEL */
127
128 #endif /* !_MACHINE_PC_VESA_H */