1
2
3
4
5
6
7#include <edid.h>
8
9#ifndef CONFIG_SYS_DEFAULT_VIDEO_MODE
10#define CONFIG_SYS_DEFAULT_VIDEO_MODE 0x301
11#endif
12
13
14#define FB_SYNC_HOR_HIGH_ACT 1
15#define FB_SYNC_VERT_HIGH_ACT 2
16#define FB_SYNC_EXT 4
17#define FB_SYNC_COMP_HIGH_ACT 8
18#define FB_SYNC_BROADCAST 16
19
20
21#define FB_SYNC_ON_GREEN 32
22#define FB_VMODE_NONINTERLACED 0
23#define FB_VMODE_INTERLACED 1
24#define FB_VMODE_DOUBLE 2
25#define FB_VMODE_MASK 255
26
27#define FB_VMODE_YWRAP 256
28#define FB_VMODE_SMOOTH_XPAN 512
29#define FB_VMODE_CONUPDATE 512
30
31
32
33
34
35struct ctfb_res_modes {
36 int xres;
37 int yres;
38 int refresh;
39
40 int pixclock;
41 int pixclock_khz;
42 int left_margin;
43 int right_margin;
44 int upper_margin;
45 int lower_margin;
46 int hsync_len;
47 int vsync_len;
48 int sync;
49 int vmode;
50};
51
52
53
54
55struct ctfb_vesa_modes {
56 int vesanr;
57 int resindex;
58 int bits_per_pixel;
59};
60
61#define RES_MODE_640x480 0
62#define RES_MODE_800x600 1
63#define RES_MODE_1024x768 2
64#define RES_MODE_960_720 3
65#define RES_MODE_1152x864 4
66#define RES_MODE_1280x1024 5
67#define RES_MODE_1280x720 6
68#define RES_MODE_1360x768 7
69#define RES_MODE_1920x1080 8
70#define RES_MODE_1920x1200 9
71#define RES_MODES_COUNT 10
72
73#define VESA_MODES_COUNT 19
74
75extern const struct ctfb_vesa_modes vesa_modes[];
76extern const struct ctfb_res_modes res_mode_init[];
77
78int video_get_params (struct ctfb_res_modes *pPar, char *penv);
79
80int video_get_video_mode(unsigned int *xres, unsigned int *yres,
81 unsigned int *depth, unsigned int *freq, const char **options);
82
83void video_get_ctfb_res_modes(int default_mode, unsigned int default_depth,
84 const struct ctfb_res_modes **mode_ret,
85 unsigned int *depth_ret,
86 const char **options);
87
88void video_get_option_string(const char *options, const char *name,
89 char *dest, int dest_len, const char *def);
90
91int video_get_option_int(const char *options, const char *name, int def);
92
93int video_edid_dtd_to_ctfb_res_modes(struct edid_detailed_timing *t,
94 struct ctfb_res_modes *mode);
95
96
97
98
99
100
101
102
103
104void video_ctfb_mode_to_display_timing(const struct ctfb_res_modes *mode,
105 struct display_timing *timing);
106