1 /*
2  *  Linux Frame Buffer Device Configuration
3  *
4  *  � Copyright 1995-1998 by Geert Uytterhoeven
5  *			(Geert.Uytterhoeven@cs.kuleuven.ac.be)
6  *
7  *  --------------------------------------------------------------------------
8  *
9  *  This file is subject to the terms and conditions of the GNU General Public
10  *  License. See the file COPYING in the main directory of the Linux
11  *  distribution for more details.
12  */
13 
14 
15 #include <stdio.h>
16 #include <sys/types.h>
17 
18 #ifdef __GLIBC__
19 # include <asm/types.h>
20 #endif
21 
22 #include <linux/fb.h>
23 
24 #define FBSET_VERSION   "Linux Frame Buffer Device Configuration " \
25 			"Version 2.1 (23/06/1999)\n"  \
26 			"(C) Copyright 1995-1999 by Geert Uytterhoeven\n"
27 
28 #define LOW		(0)
29 #define HIGH		(1)
30 
31 #define FALSE		(0)
32 #define TRUE		(1)
33 
34 struct color {
35     unsigned int length;
36     unsigned int offset;
37 };
38 
39 struct VideoMode {
40     struct VideoMode *next;
41     const char *name;
42     /* geometry */
43     __u32 xres;
44     __u32 yres;
45     __u32 vxres;
46     __u32 vyres;
47     __u32 depth;
48     __u32 nonstd;
49     /* acceleration */
50     __u32 accel_flags;
51     /* timings */
52     __u32 pixclock;
53     __u32 left;
54     __u32 right;
55     __u32 upper;
56     __u32 lower;
57     __u32 hslen;
58     __u32 vslen;
59     /* flags */
60     unsigned hsync : 1;
61     unsigned vsync : 1;
62     unsigned csync : 1;
63     unsigned gsync : 1;
64     unsigned extsync : 1;
65     unsigned bcast : 1;
66     unsigned laced : 1;
67     unsigned dblscan : 1;
68     unsigned grayscale : 1;
69     /* scanrates */
70     double drate;
71     double hrate;
72     double vrate;
73     /* RGB entries */
74     struct color red, green, blue, transp;
75 };
76 
77 extern FILE *yyin;
78 extern int line;
79 extern const char *Opt_modedb;
80 
81 extern int yyparse(void);
82 extern void Die(const char *fmt, ...) __attribute__ ((noreturn));
83 extern void AddVideoMode(const struct VideoMode *vmode);
84 extern void makeRGBA(struct VideoMode *vmode, const char* opt);
85 
86 void ConvertFromVideoMode(const struct VideoMode *vmode,
87 								 struct fb_var_screeninfo *var);
88 void ConvertToVideoMode(const struct fb_var_screeninfo *var,
89 							   struct VideoMode *vmode);
90 struct VideoMode *FindVideoMode(const char *name);
91 extern struct VideoMode *VideoModes;
92 int fbset_main (int argc, const char *argv[]);
93 void ReadModeDB (void);
94 
95