wdenk | eeb1b77 | 2004-03-23 22:53:55 +0000 | [diff] [blame] | 1 | /* |
| 2 | * (C) Copyright 2004 |
| 3 | * Pierre Aubert, Staubli Faverges , <p.aubert@staubli.com> |
| 4 | * |
| 5 | * See file CREDITS for list of people who contributed to this |
| 6 | * project. |
| 7 | * |
| 8 | * This program is free software; you can redistribute it and/or |
| 9 | * modify it under the terms of the GNU General Public License as |
| 10 | * published by the Free Software Foundation; either version 2 of |
| 11 | * the License, or (at your option) any later version. |
| 12 | * |
| 13 | * This program is distributed in the hope that it will be useful, |
| 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 16 | * GNU General Public License for more details. |
| 17 | * |
| 18 | * You should have received a copy of the GNU General Public License |
| 19 | * along with this program; if not, write to the Free Software |
| 20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, |
| 21 | * MA 02111-1307 USA |
| 22 | */ |
| 23 | |
| 24 | |
| 25 | #ifndef CFG_DEFAULT_VIDEO_MODE |
| 26 | #define CFG_DEFAULT_VIDEO_MODE 0x301 |
| 27 | #endif |
| 28 | |
| 29 | /* Some mode definitions */ |
| 30 | #define FB_SYNC_HOR_HIGH_ACT 1 /* horizontal sync high active */ |
| 31 | #define FB_SYNC_VERT_HIGH_ACT 2 /* vertical sync high active */ |
| 32 | #define FB_SYNC_EXT 4 /* external sync */ |
| 33 | #define FB_SYNC_COMP_HIGH_ACT 8 /* composite sync high active */ |
| 34 | #define FB_SYNC_BROADCAST 16 /* broadcast video timings */ |
| 35 | /* vtotal = 144d/288n/576i => PAL */ |
| 36 | /* vtotal = 121d/242n/484i => NTSC */ |
| 37 | #define FB_SYNC_ON_GREEN 32 /* sync on green */ |
| 38 | #define FB_VMODE_NONINTERLACED 0 /* non interlaced */ |
| 39 | #define FB_VMODE_INTERLACED 1 /* interlaced */ |
| 40 | #define FB_VMODE_DOUBLE 2 /* double scan */ |
| 41 | #define FB_VMODE_MASK 255 |
| 42 | |
| 43 | #define FB_VMODE_YWRAP 256 /* ywrap instead of panning */ |
| 44 | #define FB_VMODE_SMOOTH_XPAN 512 /* smooth xpan possible (internally used) */ |
| 45 | #define FB_VMODE_CONUPDATE 512 /* don't update x/yoffset */ |
| 46 | |
| 47 | |
| 48 | /****************************************************************** |
| 49 | * Resolution Struct |
| 50 | ******************************************************************/ |
| 51 | struct ctfb_res_modes { |
| 52 | int xres; /* visible resolution */ |
| 53 | int yres; |
| 54 | /* Timing: All values in pixclocks, except pixclock (of course) */ |
| 55 | int pixclock; /* pixel clock in ps (pico seconds) */ |
| 56 | int left_margin; /* time from sync to picture */ |
| 57 | int right_margin; /* time from picture to sync */ |
| 58 | int upper_margin; /* time from sync to picture */ |
| 59 | int lower_margin; |
| 60 | int hsync_len; /* length of horizontal sync */ |
| 61 | int vsync_len; /* length of vertical sync */ |
| 62 | int sync; /* see FB_SYNC_* */ |
| 63 | int vmode; /* see FB_VMODE_* */ |
| 64 | }; |
| 65 | |
| 66 | /****************************************************************** |
| 67 | * Vesa Mode Struct |
| 68 | ******************************************************************/ |
| 69 | struct ctfb_vesa_modes { |
| 70 | int vesanr; /* Vesa number as in LILO (VESA Nr + 0x200} */ |
| 71 | int resindex; /* index to resolution struct */ |
| 72 | int bits_per_pixel; /* bpp */ |
| 73 | }; |
| 74 | |
| 75 | #define RES_MODE_640x480 0 |
| 76 | #define RES_MODE_800x600 1 |
| 77 | #define RES_MODE_1024x768 2 |
| 78 | #define RES_MODE_960_720 3 |
| 79 | #define RES_MODE_1152x864 4 |
| 80 | #define RES_MODE_1280x1024 5 |
| 81 | #define RES_MODES_COUNT 6 |
| 82 | |
| 83 | #define VESA_MODES_COUNT 19 |
| 84 | |
| 85 | extern const struct ctfb_vesa_modes vesa_modes[]; |
| 86 | extern const struct ctfb_res_modes res_mode_init[]; |
| 87 | |
| 88 | int video_get_params (struct ctfb_res_modes *pPar, char *penv); |