modedb.rst 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  1. =================================
  2. modedb default video mode support
  3. =================================
  4. Currently all frame buffer device drivers have their own video mode databases,
  5. which is a mess and a waste of resources. The main idea of modedb is to have
  6. - one routine to probe for video modes, which can be used by all frame buffer
  7. devices
  8. - one generic video mode database with a fair amount of standard videomodes
  9. (taken from XFree86)
  10. - the possibility to supply your own mode database for graphics hardware that
  11. needs non-standard modes, like amifb and Mac frame buffer drivers (which
  12. use macmodes.c)
  13. When a frame buffer device receives a video= option it doesn't know, it should
  14. consider that to be a video mode option. If no frame buffer device is specified
  15. in a video= option, fbmem considers that to be a global video mode option.
  16. Valid mode specifiers (mode_option argument)::
  17. <xres>x<yres>[M][R][-<bpp>][@<refresh>][i][m][eDd]
  18. <name>[-<bpp>][@<refresh>]
  19. with <xres>, <yres>, <bpp> and <refresh> decimal numbers and <name> a string.
  20. Things between square brackets are optional.
  21. Valid names are::
  22. - NSTC: 480i output, with the CCIR System-M TV mode and NTSC color encoding
  23. - NTSC-J: 480i output, with the CCIR System-M TV mode, the NTSC color
  24. encoding, and a black level equal to the blanking level.
  25. - PAL: 576i output, with the CCIR System-B TV mode and PAL color encoding
  26. - PAL-M: 480i output, with the CCIR System-M TV mode and PAL color encoding
  27. If 'M' is specified in the mode_option argument (after <yres> and before
  28. <bpp> and <refresh>, if specified) the timings will be calculated using
  29. VESA(TM) Coordinated Video Timings instead of looking up the mode from a table.
  30. If 'R' is specified, do a 'reduced blanking' calculation for digital displays.
  31. If 'i' is specified, calculate for an interlaced mode. And if 'm' is
  32. specified, add margins to the calculation (1.8% of xres rounded down to 8
  33. pixels and 1.8% of yres).
  34. Sample usage: 1024x768M@60m - CVT timing with margins
  35. DRM drivers also add options to enable or disable outputs:
  36. 'e' will force the display to be enabled, i.e. it will override the detection
  37. if a display is connected. 'D' will force the display to be enabled and use
  38. digital output. This is useful for outputs that have both analog and digital
  39. signals (e.g. HDMI and DVI-I). For other outputs it behaves like 'e'. If 'd'
  40. is specified the output is disabled.
  41. You can additionally specify which output the options matches to.
  42. To force the VGA output to be enabled and drive a specific mode say::
  43. video=VGA-1:1280x1024@60me
  44. Specifying the option multiple times for different ports is possible, e.g.::
  45. video=LVDS-1:d video=HDMI-1:D
  46. Options can also be passed after the mode, using commas as separator.
  47. Sample usage: 720x480,rotate=180 - 720x480 mode, rotated by 180 degrees
  48. Valid options are::
  49. - margin_top, margin_bottom, margin_left, margin_right (integer):
  50. Number of pixels in the margins, typically to deal with overscan on TVs
  51. - reflect_x (boolean): Perform an axial symmetry on the X axis
  52. - reflect_y (boolean): Perform an axial symmetry on the Y axis
  53. - rotate (integer): Rotate the initial framebuffer by x
  54. degrees. Valid values are 0, 90, 180 and 270.
  55. - tv_mode: Analog TV mode. One of "NTSC", "NTSC-443", "NTSC-J", "PAL",
  56. "PAL-M", "PAL-N", or "SECAM".
  57. - panel_orientation, one of "normal", "upside_down", "left_side_up", or
  58. "right_side_up". For KMS drivers only, this sets the "panel orientation"
  59. property on the kms connector as hint for kms users.
  60. -----------------------------------------------------------------------------
  61. What is the VESA(TM) Coordinated Video Timings (CVT)?
  62. =====================================================
  63. From the VESA(TM) Website:
  64. "The purpose of CVT is to provide a method for generating a consistent
  65. and coordinated set of standard formats, display refresh rates, and
  66. timing specifications for computer display products, both those
  67. employing CRTs, and those using other display technologies. The
  68. intention of CVT is to give both source and display manufacturers a
  69. common set of tools to enable new timings to be developed in a
  70. consistent manner that ensures greater compatibility."
  71. This is the third standard approved by VESA(TM) concerning video timings. The
  72. first was the Discrete Video Timings (DVT) which is a collection of
  73. pre-defined modes approved by VESA(TM). The second is the Generalized Timing
  74. Formula (GTF) which is an algorithm to calculate the timings, given the
  75. pixelclock, the horizontal sync frequency, or the vertical refresh rate.
  76. The GTF is limited by the fact that it is designed mainly for CRT displays.
  77. It artificially increases the pixelclock because of its high blanking
  78. requirement. This is inappropriate for digital display interface with its high
  79. data rate which requires that it conserves the pixelclock as much as possible.
  80. Also, GTF does not take into account the aspect ratio of the display.
  81. The CVT addresses these limitations. If used with CRT's, the formula used
  82. is a derivation of GTF with a few modifications. If used with digital
  83. displays, the "reduced blanking" calculation can be used.
  84. From the framebuffer subsystem perspective, new formats need not be added
  85. to the global mode database whenever a new mode is released by display
  86. manufacturers. Specifying for CVT will work for most, if not all, relatively
  87. new CRT displays and probably with most flatpanels, if 'reduced blanking'
  88. calculation is specified. (The CVT compatibility of the display can be
  89. determined from its EDID. The version 1.3 of the EDID has extra 128-byte
  90. blocks where additional timing information is placed. As of this time, there
  91. is no support yet in the layer to parse this additional blocks.)
  92. CVT also introduced a new naming convention (should be seen from dmesg output)::
  93. <pix>M<a>[-R]
  94. where: pix = total amount of pixels in MB (xres x yres)
  95. M = always present
  96. a = aspect ratio (3 - 4:3; 4 - 5:4; 9 - 15:9, 16:9; A - 16:10)
  97. -R = reduced blanking
  98. example: .48M3-R - 800x600 with reduced blanking
  99. Note: VESA(TM) has restrictions on what is a standard CVT timing:
  100. - aspect ratio can only be one of the above values
  101. - acceptable refresh rates are 50, 60, 70 or 85 Hz only
  102. - if reduced blanking, the refresh rate must be at 60Hz
  103. If one of the above are not satisfied, the kernel will print a warning but the
  104. timings will still be calculated.
  105. -----------------------------------------------------------------------------
  106. To find a suitable video mode, you just call::
  107. int __init fb_find_mode(struct fb_var_screeninfo *var,
  108. struct fb_info *info, const char *mode_option,
  109. const struct fb_videomode *db, unsigned int dbsize,
  110. const struct fb_videomode *default_mode,
  111. unsigned int default_bpp)
  112. with db/dbsize your non-standard video mode database, or NULL to use the
  113. standard video mode database.
  114. fb_find_mode() first tries the specified video mode (or any mode that matches,
  115. e.g. there can be multiple 640x480 modes, each of them is tried). If that
  116. fails, the default mode is tried. If that fails, it walks over all modes.
  117. To specify a video mode at bootup, use the following boot options::
  118. video=<driver>:<xres>x<yres>[-<bpp>][@refresh]
  119. where <driver> is a name from the table below. Valid default modes can be
  120. found in drivers/video/fbdev/core/modedb.c. Check your driver's documentation.
  121. There may be more modes::
  122. Drivers that support modedb boot options
  123. Boot Name Cards Supported
  124. amifb - Amiga chipset frame buffer
  125. aty128fb - ATI Rage128 / Pro frame buffer
  126. atyfb - ATI Mach64 frame buffer
  127. pm2fb - Permedia 2/2V frame buffer
  128. pm3fb - Permedia 3 frame buffer
  129. sstfb - Voodoo 1/2 (SST1) chipset frame buffer
  130. tdfxfb - 3D Fx frame buffer
  131. tridentfb - Trident (Cyber)blade chipset frame buffer
  132. vt8623fb - VIA 8623 frame buffer
  133. BTW, only a few fb drivers use this at the moment. Others are to follow
  134. (feel free to send patches). The DRM drivers also support this.