]> git.lizzy.rs Git - plan9front.git/blob - sys/src/cmd/aux/vga/vesadb.c
exec(2): fix prototypes
[plan9front.git] / sys / src / cmd / aux / vga / vesadb.c
1 #include <u.h>
2 #include <libc.h>
3 #include <bio.h>
4 #include "pci.h"
5 #include "vga.h"
6
7 // VESA Monitor Timing Standard mode definitions as per
8 // VESA and Industry Standards and Guidelines for Computer
9 // Display Monitor Timing, Version 1.0, Revision 0.8, 17 September 1998.
10 //
11 // See /lib/vesa/dmtv1r08.pdf.
12 //
13 // This might go back into vgadb at some point. It's here mainly
14 // so that people don't change it, and so that we can run without vgadb.
15
16 static Mode vesa640x480x60 = {
17         .name = "640x480@60Hz",
18         .x = 640,
19         .y = 480,
20
21         .ht = 800,
22         .shb = 656,
23         .ehb = 656+96,
24
25         .vt = 525,
26         .vrs = 490,
27         .vre = 490+2,
28
29         .frequency = 25175000,
30
31         .hsync = '-',
32         .vsync = '-',
33         .interlace = '\0',
34 };
35
36 static Mode vesa640x480x72 = {
37         .name = "640x480@72Hz",
38         .x = 640,
39         .y = 480,
40
41         .ht = 832,
42         .shb = 664,
43         .ehb = 664+40,
44
45         .vt = 520,
46         .vrs = 489,
47         .vre = 489+3,
48
49         .frequency = 31500000,
50
51         .hsync = '-',
52         .vsync = '-',
53         .interlace = '\0',
54 };
55
56 static Mode vesa640x480x75 = {
57         .name = "640x480@75Hz",
58         .x = 640,
59         .y = 480,
60
61         .ht = 840,
62         .shb = 656,
63         .ehb = 656+64,
64
65         .vt = 500,
66         .vrs = 481,
67         .vre = 481+3,
68
69         .frequency = 31500000,
70
71         .hsync = '-',
72         .vsync = '-',
73         .interlace = '\0',
74 };
75
76 static Mode vesa640x480x85 = {
77         .name = "640x480@85Hz",
78         .x = 640,
79         .y = 480,
80
81         .ht = 832,
82         .shb = 696,
83         .ehb = 696+56,
84
85         .vt = 509,
86         .vrs = 481,
87         .vre = 481+3,
88
89         .frequency = 36000000,
90
91         .hsync = '-',
92         .vsync = '-',
93         .interlace = '\0',
94 };
95
96 static Mode vesa800x600x56 = {
97         .name = "800x600@56Hz",
98         .x = 800,
99         .y = 600,
100
101         .ht = 1024,
102         .shb = 824,
103         .ehb = 824+72,
104
105         .vt = 625,
106         .vrs = 601,
107         .vre = 601+2,
108
109         .frequency = 36000000,
110
111         .hsync = '+',
112         .vsync = '+',
113         .interlace = '\0',
114 };
115
116 static Mode vesa800x600x60 = {
117         .name = "800x600@60Hz",
118         .x = 800,
119         .y = 600,
120
121         .ht = 1056,
122         .shb = 840,
123         .ehb = 840+128,
124
125         .vt = 628,
126         .vrs = 601,
127         .vre = 601+4,
128
129         .frequency = 40000000,
130
131         .hsync = '+',
132         .vsync = '+',
133         .interlace = '\0',
134 };
135
136 static Mode vesa800x600x72 = {
137         .name = "800x600@72Hz",
138         .x = 800,
139         .y = 600,
140
141         .ht = 1040,
142         .shb = 856,
143         .ehb = 856+120,
144
145         .vt = 666,
146         .vrs = 637,
147         .vre = 637+6,
148
149         .frequency = 50000000,
150
151         .hsync = '+',
152         .vsync = '+',
153         .interlace = '\0',
154 };
155
156 static Mode vesa800x600x75 = {
157         .name = "800x600@75Hz",
158         .x = 800,
159         .y = 600,
160
161         .ht = 1056,
162         .shb = 816,
163         .ehb = 816+80,
164
165         .vt = 625,
166         .vrs = 601,
167         .vre = 601+3,
168
169         .frequency = 49500000,
170
171         .hsync = '+',
172         .vsync = '+',
173         .interlace = '\0',
174 };
175
176 static Mode vesa800x600x85 = {
177         .name = "800x600@85Hz",
178         .x = 800,
179         .y = 600,
180
181         .ht = 1048,
182         .shb = 832,
183         .ehb = 832+64,
184
185         .vt = 631,
186         .vrs = 601,
187         .vre = 601+3,
188
189         .frequency = 56250000,
190
191         .hsync = '+',
192         .vsync = '+',
193         .interlace = '\0',
194 };
195
196 static Mode vesa1024x768x60 = {
197         .name = "1024x768@60Hz",
198         .x = 1024,
199         .y = 768,
200
201         .ht = 1344,
202         .shb = 1048,
203         .ehb = 1048+136,
204
205         .vt = 806,
206         .vrs = 771,
207         .vre = 771+6,
208
209         .frequency = 65000000,
210
211         .hsync = '-',
212         .vsync = '-',
213         .interlace = '\0',
214 };
215
216 static Mode vesa1024x768x70 = {
217         .name = "1024x768@70Hz",
218         .x = 1024,
219         .y = 768,
220
221         .ht = 1328,
222         .shb = 1048,
223         .ehb = 1048+136,
224
225         .vt = 806,
226         .vrs = 771,
227         .vre = 771+6,
228
229         .frequency = 75000000,
230
231         .hsync = '-',
232         .vsync = '-',
233         .interlace = '\0',
234 };
235
236 static Mode vesa1024x768x75 = {
237         .name = "1024x768@75Hz",
238         .x = 1024,
239         .y = 768,
240
241         .ht = 1312,
242         .shb = 1040,
243         .ehb = 1040+96,
244
245         .vt = 800,
246         .vrs = 769,
247         .vre = 769+3,
248
249         .frequency = 78750000,
250
251         .hsync = '+',
252         .vsync = '+',
253         .interlace = '\0',
254 };
255
256 static Mode vesa1024x768x85 = {
257         .name = "1024x768@85Hz",
258         .x = 1024,
259         .y = 768,
260
261         .ht = 1376,
262         .shb = 1072,
263         .ehb = 1072+96,
264
265         .vt = 808,
266         .vrs = 769,
267         .vre = 769+3,
268
269         .frequency = 94500000,
270
271         .hsync = '+',
272         .vsync = '+',
273         .interlace = '\0',
274 };
275
276 static Mode vesa1152x864x75 = {
277         .name = "1152x864@75Hz",
278         .x = 1152,
279         .y = 864,
280
281         .ht = 1600,
282         .shb = 1216,
283         .ehb = 1216+128,
284
285         .vt = 900,
286         .vrs = 865,
287         .vre = 865+3,
288
289         .frequency = 108000000,
290
291         .hsync = '+',
292         .vsync = '+',
293         .interlace = '\0',
294 };
295
296 static Mode vesa1280x960x60 = {
297         .name = "1280x960@60Hz",
298         .x = 1280,
299         .y = 960,
300
301         .ht = 1800,
302         .shb = 1376,
303         .ehb = 1376+112,
304
305         .vt = 1000,
306         .vrs = 961,
307         .vre = 961+3,
308
309         .frequency = 108000000,
310
311         .hsync = '+',
312         .vsync = '+',
313         .interlace = '\0',
314 };
315
316 static Mode vesa1280x960x85 = {
317         .name = "1280x960@85Hz",
318         .x = 1280,
319         .y = 960,
320
321         .ht = 1728,
322         .shb = 1344,
323         .ehb = 1344+160,
324
325         .vt = 1011,
326         .vrs = 961,
327         .vre = 961+3,
328
329         .frequency = 148500000,
330
331         .hsync = '+',
332         .vsync = '+',
333         .interlace = '\0',
334 };
335
336 static Mode vesa1280x1024x60 = {
337         .name = "1280x1024@60Hz",
338         .x = 1280,
339         .y = 1024,
340
341         .ht = 1688,
342         .shb = 1328,
343         .ehb = 1328+112,
344
345         .vt = 1066,
346         .vrs = 1025,
347         .vre = 1025+3,
348
349         .frequency = 108000000,
350
351         .hsync = '+',
352         .vsync = '+',
353         .interlace = '\0',
354 };
355
356 static Mode vesa1280x1024x75 = {
357         .name = "1280x1024@75Hz",
358         .x = 1280,
359         .y = 1024,
360
361         .ht = 1688,
362         .shb = 1296,
363         .ehb = 1296+144,
364
365         .vt = 1066,
366         .vrs = 1025,
367         .vre = 1025+3,
368
369         .frequency = 135000000,
370
371         .hsync = '+',
372         .vsync = '+',
373         .interlace = '\0',
374 };
375
376 static Mode vesa1280x1024x85 = {
377         .name = "1280x1024@85Hz",
378         .x = 1280,
379         .y = 1024,
380
381         .ht = 1728,
382         .shb = 1344,
383         .ehb = 1344+160,
384
385         .vt = 1072,
386         .vrs = 1025,
387         .vre = 1025+3,
388
389         .frequency = 157500000,
390
391         .hsync = '+',
392         .vsync = '+',
393         .interlace = '\0',
394 };
395
396 static Mode vesa1600x1200x60 = {
397         .name = "1600x1200@60Hz",
398         .x = 1600,
399         .y = 1200,
400
401         .ht = 2160,
402         .shb = 1664,
403         .ehb = 1664+192,
404
405         .vt = 1250,
406         .vrs = 1201,
407         .vre = 1201+3,
408
409         .frequency = 162000000,
410
411         .hsync = '+',
412         .vsync = '+',
413         .interlace = '\0',
414 };
415
416 static Mode vesa1600x1200x65 = {
417         .name = "1600x1200@65Hz",
418         .x = 1600,
419         .y = 1200,
420
421         .ht = 2160,
422         .shb = 1664,
423         .ehb = 1664+192,
424
425         .vt = 1250,
426         .vrs = 1201,
427         .vre = 1201+3,
428
429         .frequency = 175500000,
430
431         .hsync = '+',
432         .vsync = '+',
433         .interlace = '\0',
434 };
435
436 static Mode vesa1600x1200x70 = {
437         .name = "1600x1200@70Hz",
438         .x = 1600,
439         .y = 1200,
440
441         .ht = 2160,
442         .shb = 1664,
443         .ehb = 1664+192,
444
445         .vt = 1250,
446         .vrs = 1201,
447         .vre = 1201+3,
448
449         .frequency = 189000000,
450
451         .hsync = '+',
452         .vsync = '+',
453         .interlace = '\0',
454 };
455
456 static Mode vesa1600x1200x75 = {
457         .name = "1600x1200@75Hz",
458         .x = 1600,
459         .y = 1200,
460
461         .ht = 2160,
462         .shb = 1664,
463         .ehb = 1664+192,
464
465         .vt = 1250,
466         .vrs = 1201,
467         .vre = 1201+3,
468
469         .frequency = 202500000,
470
471         .hsync = '+',
472         .vsync = '+',
473         .interlace = '\0',
474 };
475
476 static Mode vesa1600x1200x85 = {
477         .name = "1600x1200@85Hz",
478         .x = 1600,
479         .y = 1200,
480
481         .ht = 2160,
482         .shb = 1664,
483         .ehb = 1664+192,
484
485         .vt = 1250,
486         .vrs = 1201,
487         .vre = 1201+3,
488
489         .frequency = 229500000,
490
491         .hsync = '+',
492         .vsync = '+',
493         .interlace = '\0',
494 };
495
496 static Mode vesa1792x1344x60 = {
497         .name = "1792x1344@60Hz",
498         .x = 1792,
499         .y = 1344,
500
501         .ht = 2448,
502         .shb = 1920,
503         .ehb = 1920+200,
504
505         .vt = 1394,
506         .vrs = 1345,
507         .vre = 1345+3,
508
509         .frequency = 204750000,
510
511         .hsync = '-',
512         .vsync = '+',
513         .interlace = '\0',
514 };
515
516 static Mode vesa1792x1344x75 = {
517         .name = "1792x1344@75Hz",
518         .x = 1792,
519         .y = 1344,
520
521         .ht = 2456,
522         .shb = 1888,
523         .ehb = 1888+216,
524
525         .vt = 1417,
526         .vrs = 1345,
527         .vre = 1345+3,
528
529         .frequency = 261000000,
530
531         .hsync = '-',
532         .vsync = '+',
533         .interlace = '\0',
534 };
535
536 static Mode vesa1856x1392x60 = {
537         .name = "1856x1392@60Hz",
538         .x = 1856,
539         .y = 1392,
540
541         .ht = 2528,
542         .shb = 1952,
543         .ehb = 1952+224,
544
545         .vt = 1439,
546         .vrs = 1393,
547         .vre = 1393+3,
548
549         .frequency = 218250000,
550
551         .hsync = '-',
552         .vsync = '+',
553         .interlace = '\0',
554 };
555
556 static Mode vesa1856x1392x75 = {
557         .name = "1856x1392@75Hz",
558         .x = 1856,
559         .y = 1392,
560
561         .ht = 2560,
562         .shb = 1984,
563         .ehb = 1984+224,
564
565         .vt = 1500,
566         .vrs = 1393,
567         .vre = 1393+3,
568
569         .frequency = 288000000,
570
571         .hsync = '-',
572         .vsync = '+',
573         .interlace = '\0',
574 };
575
576 static Mode vesa1920x1440x60 = {
577         .name = "1920x1440@60Hz",
578         .x = 1920,
579         .y = 1440,
580
581         .ht = 2600,
582         .shb = 2048,
583         .ehb = 2048+208,
584
585         .vt = 1500,
586         .vrs = 1441,
587         .vre = 1441+3,
588
589         .frequency = 234000000,
590
591         .hsync = '-',
592         .vsync = '+',
593         .interlace = '\0',
594 };
595
596 static Mode vesa1920x1440x75 = {
597         .name = "1920x1440@75Hz",
598         .x = 1920,
599         .y = 1440,
600
601         .ht = 2640,
602         .shb = 2064,
603         .ehb = 2064+224,
604
605         .vt = 1500,
606         .vrs = 1441,
607         .vre = 1441+3,
608
609         .frequency = 297000000,
610
611         .hsync = '-',
612         .vsync = '+',
613         .interlace = '\0',
614 };
615
616 Mode *vesamodes[] = {
617         &vesa640x480x60,
618         &vesa640x480x72,
619         &vesa640x480x75,
620         &vesa640x480x85,
621         &vesa800x600x56,
622         &vesa800x600x60,
623         &vesa800x600x72,
624         &vesa800x600x75,
625         &vesa800x600x85,
626         &vesa1024x768x60,
627         &vesa1024x768x70,
628         &vesa1024x768x75,
629         &vesa1024x768x85,
630         &vesa1152x864x75,
631         &vesa1280x960x60,
632         &vesa1280x960x85,
633         &vesa1280x1024x60,
634         &vesa1280x1024x75,
635         &vesa1280x1024x85,
636         &vesa1600x1200x60,
637         &vesa1600x1200x65,
638         &vesa1600x1200x70,
639         &vesa1600x1200x75,
640         &vesa1600x1200x85,
641         &vesa1792x1344x60,
642         &vesa1792x1344x75,
643         &vesa1856x1392x60,
644         &vesa1856x1392x75,
645         &vesa1920x1440x60,
646         &vesa1920x1440x75,
647         0
648 };