blob: d83993a563ae1bf062c38ded938d6b92de922686 [file] [log] [blame]
wdenkeeb1b772004-03-23 22:53:55 +00001/*
2 * (C) Copyright 2004
3 * Pierre Aubert, Staubli Faverges , <p.aubert@staubli.com>
4 *
Wolfgang Denk3765b3e2013-10-07 13:07:26 +02005 * SPDX-License-Identifier: GPL-2.0+
wdenkeeb1b772004-03-23 22:53:55 +00006 */
7
8
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +02009#ifndef CONFIG_SYS_DEFAULT_VIDEO_MODE
10#define CONFIG_SYS_DEFAULT_VIDEO_MODE 0x301
wdenkeeb1b772004-03-23 22:53:55 +000011#endif
12
13/* Some mode definitions */
14#define FB_SYNC_HOR_HIGH_ACT 1 /* horizontal sync high active */
15#define FB_SYNC_VERT_HIGH_ACT 2 /* vertical sync high active */
16#define FB_SYNC_EXT 4 /* external sync */
17#define FB_SYNC_COMP_HIGH_ACT 8 /* composite sync high active */
18#define FB_SYNC_BROADCAST 16 /* broadcast video timings */
19 /* vtotal = 144d/288n/576i => PAL */
20 /* vtotal = 121d/242n/484i => NTSC */
21#define FB_SYNC_ON_GREEN 32 /* sync on green */
22#define FB_VMODE_NONINTERLACED 0 /* non interlaced */
23#define FB_VMODE_INTERLACED 1 /* interlaced */
24#define FB_VMODE_DOUBLE 2 /* double scan */
25#define FB_VMODE_MASK 255
26
27#define FB_VMODE_YWRAP 256 /* ywrap instead of panning */
28#define FB_VMODE_SMOOTH_XPAN 512 /* smooth xpan possible (internally used) */
29#define FB_VMODE_CONUPDATE 512 /* don't update x/yoffset */
30
31
32/******************************************************************
33 * Resolution Struct
34 ******************************************************************/
35struct ctfb_res_modes {
36 int xres; /* visible resolution */
37 int yres;
38 /* Timing: All values in pixclocks, except pixclock (of course) */
39 int pixclock; /* pixel clock in ps (pico seconds) */
40 int left_margin; /* time from sync to picture */
41 int right_margin; /* time from picture to sync */
42 int upper_margin; /* time from sync to picture */
43 int lower_margin;
44 int hsync_len; /* length of horizontal sync */
45 int vsync_len; /* length of vertical sync */
46 int sync; /* see FB_SYNC_* */
47 int vmode; /* see FB_VMODE_* */
48};
49
50/******************************************************************
51 * Vesa Mode Struct
52 ******************************************************************/
53struct ctfb_vesa_modes {
54 int vesanr; /* Vesa number as in LILO (VESA Nr + 0x200} */
55 int resindex; /* index to resolution struct */
56 int bits_per_pixel; /* bpp */
57};
58
59#define RES_MODE_640x480 0
60#define RES_MODE_800x600 1
61#define RES_MODE_1024x768 2
62#define RES_MODE_960_720 3
63#define RES_MODE_1152x864 4
64#define RES_MODE_1280x1024 5
65#define RES_MODES_COUNT 6
66
67#define VESA_MODES_COUNT 19
68
69extern const struct ctfb_vesa_modes vesa_modes[];
70extern const struct ctfb_res_modes res_mode_init[];
71
72int video_get_params (struct ctfb_res_modes *pPar, char *penv);
Timur Tabia5dbdc82011-03-21 16:38:49 -050073
74int video_get_video_mode(unsigned int *xres, unsigned int *yres,
75 unsigned int *depth, unsigned int *freq, const char **options);