videomodes.h 2.5 KB

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