1vga_getmodeinfo(3)            Svgalib User Manual           vga_getmodeinfo(3)
2
3
4

NAME

6       vga_getmodeinfo  -  returns pointer to mode information structure for a
7       mode
8

SYNOPSIS

10       #include <vga.h>
11
12       vga_modeinfo *vga_getmodeinfo(int mode );
13
14

DESCRIPTION

16       The function returns a pointer to a statical allocated mode information
17       structure which is filled out with details for a video mode mode.
18
19       #include <vga.h> defines vga_modeinfo as
20
21       typedef struct {
22            int width;
23            int height;
24            int bytesperpixel;
25            int colors;
26            int linewidth;
27            int maxlogicalwidth;
28            int startaddressrange;
29            int maxpixels;
30            int haveblit;
31            int flags;
32       /* Extended fields, not always available: */
33            int chiptype;
34            int memory;
35            int linewidth_unit;
36            char *linear_aperture;
37            int aperture_size;
38            void (*set_aperture_page) (int page);
39            void *extensions;
40       } vga_modeinfo;
41
42       If the given mode is out of range, NULL is returned.  Beware, even when
43       vga_getmodeinfo() returns details about a certain mode, you must  check
44       if  it  is  currently  available  (may  depend on memory size and other
45       details) with vga_hasmode (3).
46
47       The fields meaning in detail:
48
49
50   Basic mode details
51       width  Width of mode in pixels.
52
53       height Height of mode in pixel lines.
54
55       bytesperpixel
56              Bytes per pixel. This is 1, 2, 3, or 4 (for 256, 32K & 64K, 16M,
57              16M$ modes) and 0 for planar VGA modes.
58
59       linewidth
60              Logical  scanline  width  in  bytes.  This  is the memory offset
61              between two pixels above  each  other  in  two  adjacent  screen
62              lines.  It  is  not  valid  to  assume that linewidth == width *
63              bytesperpixel in general!
64
65       colors The number of colors which you can display simultaneously 2, 16,
66              256,  32768, 65536, or 16777216.  Generally 16 and 256 mean that
67              a color lookup table is used. 2 means that only  black/white  is
68              used and the others use some high/true color mode.
69
70   Possible modifications of the memory layout
71       maxlogicalwidth
72              The  maximum logical scanline width (in bytes) which you can set
73              for this mode with vga_setlogicalwidth(3) while still  expecting
74              a perfect screen image.
75
76       startaddressrange
77              Mask  of  changeable bits of start address (in pixels). All bits
78              zero in startaddressrange  must  also  be  zero  in  a  call  to
79              vga_setdisplaystart(3)  when  you want to avoid noisy video sig‐
80              nals.
81
82   Memory size
83       maxpixels
84              Maximum number of pixels that  will  fit  in  a  logical  screen
85              (depends on video memory).
86
87   Further, advanced capabilities
88       haveblit
89              Indicates whether the following bitblit functions are available.
90              It is a logical or of the  following  predefined  values  (which
91              each have only one bit set).
92
93              HAVE_BITBLIT
94                     has vga_bitblt(3) old style accelerator function.
95
96              HAVE_FILLBLIT
97                     has vga_fillblt(3) old style accelerator function.
98
99              HAVE_IMAGEBLIT
100                     has vga_imageblt(3) old style accelerator function.
101
102              HAVE_HLINELISTBLIT
103                     has vga_hlinelistblt(3) old style accelerator function.
104
105              HAVE_BLITWAIT
106                     has vga_blitwait(3) old style accelerator function.
107
108       flags  Miscellaneous flags.  It is a logical or of the following prede‐
109              fined values (which each have only one bit set).
110
111              HAVE_RWPAGE
112                     vga_setreadpage(3) and vga_setwritepage(3) are  available
113                     in this mode.
114
115              IS_INTERLACED
116                     Mode  is  interlaced, which means it will tend to flicker
117                     and the user might be happier if the application  chooses
118                     another mode.
119
120              IS_MODEX
121                     Mode  user  mode  X like memory layout (planar 256 colors
122                     VGA mode). See vga_setmodeX(3) for some explanations.
123
124              IS_DYNAMICMODE
125                     Dynamically  loaded  mode.  This  mode  was  defined   in
126                     /etc/vga/libvga.conf by the user. He will probably prefer
127                     its usage. However, usually this should be of no interest
128                     to the user.
129
130              CAPABLE_LINEAR
131                     Mode  can be set to linear addressing with vga_setlinear‐
132                     addressing(3).
133
134              IS_LINEAR
135                     Linear addressing is already enabled for this mode.
136
137              EXT_INFO_AVAILABLE
138                     The extended fields in this information structure are set
139                     to sensible information. If EXT_INFO_AVAILABLE is not set
140                     you should even not access these fields as you might have
141                     encountered  an  old  version  of  svgalib and the fields
142                     migth actually not have been allocated at all.
143
144              RGB_MISORDERED
145                     For 16M4 modes it means that the 4 bytes per pixel  actu‐
146                     ally  mean  0BGR rather than BGR0 as per default. For 16M
147                     mode it means that the 3 bytes actually mean RGB  instead
148                     of BGR.
149
150                     The  first  is a general limitation of Mach32, the latter
151                     one of Mach32 with a ramdac of type 4. The  vga_  drawing
152                     functions takes this into account.
153
154              HAVE_EXT_SET
155                     A vga_ext_set(3) is available and can be called.
156
157   Extended mode information
158       You  must check for EXT_INFO_AVAILABLE in flags before trying to access
159       these values.
160
161       chiptype
162              the chiptype that was detected/set. This specifies a subtype  of
163              the current vga_getcurrentchipset(3) setting whose value depends
164              on the chipset. It should be only used for debugging  or  inter‐
165              nally.
166
167       memory memory available on the SVGA card in KB.
168
169       linewidth_unit
170              use  only  a  multiple  of this value for set_logicalwidth(3) or
171              set_displaystart(3) to ensure graceful alignment of  lines  onto
172              the vga memory in this mode and for noiseless video signals.
173
174       linear_aperture
175              ptr to a mmaped secondary linear framebuffer (not related to the
176              use of vga_setlinearaddressing(3)) (NULL if unavailable)
177
178       aperture_size
179              size of the secondary framebuffer in KB. 0 if unavailable.
180
181       set_aperture_page
182              a function taking an int as parameter to select a  page  in  the
183              framebuffer  addressed  by  read/writes  to this memory arey (if
184              aperture_size < memory.
185
186       extensions
187              pointer to additional, internal, chipset specific info (contents
188              of the EEPROM for Mach32 driver.)
189
190       The vgatest(6) demo displays most of this info for all supported modes.
191
192

SEE ALSO

194       svgalib(7),  vgagl(7),  libvga.config(5),  vgatest(6),  vga_hasmode(3),
195       vga_init(3),  vga_setmode(3),  vga_getcurrentmode(3),   vga_getdefault‐
196       mode(3),   vga_lastmodenumber(3),  vga_getmodename(3),  vga_getmodenum‐
197       ber(3),    vga_setlogicalwidth(3),    vga_bitblt(3),    vga_fillblt(3),
198       vga_imageblt(3), vga_hlinelistblt(3), vga_blitwait(3), vga_setmodeX(3),
199       vga_getcurrentchipset(3), vga_ext_set(3), vga_setlinearaddressing(3)
200
201

AUTHOR

203       This manual page was edited  by  Michael  Weller  <eowmob@exp-math.uni-
204       essen.de>.  The  exact  source of the referenced function as well as of
205       the original documentation is unknown.
206
207       It is very likely that both are at least to some extent are due to Harm
208       Hanemaayer <H.Hanemaayer@inter.nl.net>.
209
210       Occasionally  this  might be wrong. I hereby asked to be excused by the
211       original author and will happily accept any additions or corrections to
212       this first version of the svgalib manual.
213
214
215
216Svgalib (>= 1.2.11)              27 July 1997               vga_getmodeinfo(3)
Impressum