Back to home page

OSCL-LXR

 
 

    


0001 =================================
0002 modedb default video mode support
0003 =================================
0004 
0005 
0006 Currently all frame buffer device drivers have their own video mode databases,
0007 which is a mess and a waste of resources. The main idea of modedb is to have
0008 
0009   - one routine to probe for video modes, which can be used by all frame buffer
0010     devices
0011   - one generic video mode database with a fair amount of standard videomodes
0012     (taken from XFree86)
0013   - the possibility to supply your own mode database for graphics hardware that
0014     needs non-standard modes, like amifb and Mac frame buffer drivers (which
0015     use macmodes.c)
0016 
0017 When a frame buffer device receives a video= option it doesn't know, it should
0018 consider that to be a video mode option. If no frame buffer device is specified
0019 in a video= option, fbmem considers that to be a global video mode option.
0020 
0021 Valid mode specifiers (mode_option argument)::
0022 
0023     <xres>x<yres>[M][R][-<bpp>][@<refresh>][i][m][eDd]
0024     <name>[-<bpp>][@<refresh>]
0025 
0026 with <xres>, <yres>, <bpp> and <refresh> decimal numbers and <name> a string.
0027 Things between square brackets are optional.
0028 
0029 If 'M' is specified in the mode_option argument (after <yres> and before
0030 <bpp> and <refresh>, if specified) the timings will be calculated using
0031 VESA(TM) Coordinated Video Timings instead of looking up the mode from a table.
0032 If 'R' is specified, do a 'reduced blanking' calculation for digital displays.
0033 If 'i' is specified, calculate for an interlaced mode.  And if 'm' is
0034 specified, add margins to the calculation (1.8% of xres rounded down to 8
0035 pixels and 1.8% of yres).
0036 
0037        Sample usage: 1024x768M@60m - CVT timing with margins
0038 
0039 DRM drivers also add options to enable or disable outputs:
0040 
0041 'e' will force the display to be enabled, i.e. it will override the detection
0042 if a display is connected. 'D' will force the display to be enabled and use
0043 digital output. This is useful for outputs that have both analog and digital
0044 signals (e.g. HDMI and DVI-I). For other outputs it behaves like 'e'. If 'd'
0045 is specified the output is disabled.
0046 
0047 You can additionally specify which output the options matches to.
0048 To force the VGA output to be enabled and drive a specific mode say::
0049 
0050     video=VGA-1:1280x1024@60me
0051 
0052 Specifying the option multiple times for different ports is possible, e.g.::
0053 
0054     video=LVDS-1:d video=HDMI-1:D
0055 
0056 Options can also be passed after the mode, using commas as separator.
0057 
0058        Sample usage: 720x480,rotate=180 - 720x480 mode, rotated by 180 degrees
0059 
0060 Valid options are::
0061 
0062   - margin_top, margin_bottom, margin_left, margin_right (integer):
0063     Number of pixels in the margins, typically to deal with overscan on TVs
0064   - reflect_x (boolean): Perform an axial symmetry on the X axis
0065   - reflect_y (boolean): Perform an axial symmetry on the Y axis
0066   - rotate (integer): Rotate the initial framebuffer by x
0067     degrees. Valid values are 0, 90, 180 and 270.
0068   - panel_orientation, one of "normal", "upside_down", "left_side_up", or
0069     "right_side_up". For KMS drivers only, this sets the "panel orientation"
0070     property on the kms connector as hint for kms users.
0071 
0072 
0073 -----------------------------------------------------------------------------
0074 
0075 What is the VESA(TM) Coordinated Video Timings (CVT)?
0076 =====================================================
0077 
0078 From the VESA(TM) Website:
0079 
0080      "The purpose of CVT is to provide a method for generating a consistent
0081       and coordinated set of standard formats, display refresh rates, and
0082       timing specifications for computer display products, both those
0083       employing CRTs, and those using other display technologies. The
0084       intention of CVT is to give both source and display manufacturers a
0085       common set of tools to enable new timings to be developed in a
0086       consistent manner that ensures greater compatibility."
0087 
0088 This is the third standard approved by VESA(TM) concerning video timings.  The
0089 first was the Discrete Video Timings (DVT) which is  a collection of
0090 pre-defined modes approved by VESA(TM).  The second is the Generalized Timing
0091 Formula (GTF) which is an algorithm to calculate the timings, given the
0092 pixelclock, the horizontal sync frequency, or the vertical refresh rate.
0093 
0094 The GTF is limited by the fact that it is designed mainly for CRT displays.
0095 It artificially increases the pixelclock because of its high blanking
0096 requirement. This is inappropriate for digital display interface with its high
0097 data rate which requires that it conserves the pixelclock as much as possible.
0098 Also, GTF does not take into account the aspect ratio of the display.
0099 
0100 The CVT addresses these limitations.  If used with CRT's, the formula used
0101 is a derivation of GTF with a few modifications.  If used with digital
0102 displays, the "reduced blanking" calculation can be used.
0103 
0104 From the framebuffer subsystem perspective, new formats need not be added
0105 to the global mode database whenever a new mode is released by display
0106 manufacturers. Specifying for CVT will work for most, if not all, relatively
0107 new CRT displays and probably with most flatpanels, if 'reduced blanking'
0108 calculation is specified.  (The CVT compatibility of the display can be
0109 determined from its EDID. The version 1.3 of the EDID has extra 128-byte
0110 blocks where additional timing information is placed.  As of this time, there
0111 is no support yet in the layer to parse this additional blocks.)
0112 
0113 CVT also introduced a new naming convention (should be seen from dmesg output)::
0114 
0115     <pix>M<a>[-R]
0116 
0117     where: pix = total amount of pixels in MB (xres x yres)
0118            M   = always present
0119            a   = aspect ratio (3 - 4:3; 4 - 5:4; 9 - 15:9, 16:9; A - 16:10)
0120           -R   = reduced blanking
0121 
0122           example:  .48M3-R - 800x600 with reduced blanking
0123 
0124 Note: VESA(TM) has restrictions on what is a standard CVT timing:
0125 
0126       - aspect ratio can only be one of the above values
0127       - acceptable refresh rates are 50, 60, 70 or 85 Hz only
0128       - if reduced blanking, the refresh rate must be at 60Hz
0129 
0130 If one of the above are not satisfied, the kernel will print a warning but the
0131 timings will still be calculated.
0132 
0133 -----------------------------------------------------------------------------
0134 
0135 To find a suitable video mode, you just call::
0136 
0137   int __init fb_find_mode(struct fb_var_screeninfo *var,
0138                           struct fb_info *info, const char *mode_option,
0139                           const struct fb_videomode *db, unsigned int dbsize,
0140                           const struct fb_videomode *default_mode,
0141                           unsigned int default_bpp)
0142 
0143 with db/dbsize your non-standard video mode database, or NULL to use the
0144 standard video mode database.
0145 
0146 fb_find_mode() first tries the specified video mode (or any mode that matches,
0147 e.g. there can be multiple 640x480 modes, each of them is tried). If that
0148 fails, the default mode is tried. If that fails, it walks over all modes.
0149 
0150 To specify a video mode at bootup, use the following boot options::
0151 
0152     video=<driver>:<xres>x<yres>[-<bpp>][@refresh]
0153 
0154 where <driver> is a name from the table below.  Valid default modes can be
0155 found in drivers/video/fbdev/core/modedb.c.  Check your driver's documentation.
0156 There may be more modes::
0157 
0158     Drivers that support modedb boot options
0159     Boot Name     Cards Supported
0160 
0161     amifb       - Amiga chipset frame buffer
0162     aty128fb    - ATI Rage128 / Pro frame buffer
0163     atyfb       - ATI Mach64 frame buffer
0164     pm2fb       - Permedia 2/2V frame buffer
0165     pm3fb       - Permedia 3 frame buffer
0166     sstfb       - Voodoo 1/2 (SST1) chipset frame buffer
0167     tdfxfb      - 3D Fx frame buffer
0168     tridentfb   - Trident (Cyber)blade chipset frame buffer
0169     vt8623fb    - VIA 8623 frame buffer
0170 
0171 BTW, only a few fb drivers use this at the moment. Others are to follow
0172 (feel free to send patches). The DRM drivers also support this.