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