Changes between Initial Version and Version 1 of linux/display


Ignore:
Timestamp:
10/31/2017 09:06:57 PM (7 years ago)
Author:
Tim Harvey
Comment:

restored from 10/14/2017 cache

Legend:

Unmodified
Added
Removed
Modified
  • linux/display

    v1 v1  
     1[[PageOutline]]
     2
     3= Goals =
     4The purpose of this page is to help educate about display output on upstream Linux (not to be confused with the 'downstream' vendor kernel provided in Yocto).
     5
     6= Direct Rendering Manager (DRM) =
     7DRM is the driver subsystem in the kernel that is able to communicate with video drivers, such as the Freescale I.MX6 processors. Through {{{ioctl()}}} calls, multiple userspace programs can draw to a display at any given time as DRM will manage these requests. DRM is also able to interface with the graphics processor (GPU) in order to hardware accelerate these requests. This is separate from {{{framebuffer}}} in that it only allowed raw writes to a display. DRM exposes some information via sysfs in the {{{/sys/class/drm}}} directory.
     8
     9For example, to retrieve a list of display devices found on your system which were registered by DRM (Gateworks GW540x):
     10{{{#!bash
     11root@OpenWrt:~# ls /sys/class/drm
     12card0           card0-HDMI-A-1  card0-LVDS-1    controlD64      version
     13}}}
     14
     15== Kernel Mode Settings (KMS) ==
     16KMS is part of DRM, but solely focuses on configuring display modes (i.e. screen resolution, refresh rate etc).
     17
     18When booting your kernel, mode settings are read by what appears in the kernel command line, else defaults are chosen. DRM exports some modes available for a given display:
     19{{{#!bash
     20root@OpenWrt:~# cat /sys/class/drm/card0-HDMI-A-1/modes
     211680x1050
     221280x1024
     231280x1024
     241152x864
     251024x768
     261024x768
     27800x600
     28800x600
     29640x480
     30640x480
     31720x400
     32}}}
     33
     34Mode settings can be passed to the kernel via the {{{video=}}} parameter from within U-Boot. The format of this is as follows: {{{video=<conn>:<xres>x<yres>[M][R][-<bpp>][@<refresh>][i][m][eDd]}}}
     35
     36Note the following variables (see also [https://www.kernel.org/doc/Documentation/fb/modedb.txt modedb.txt]):
     37 * {{{<conn>}}}: Connector
     38 * {{{<xres> x <yres>}}}: Resolution
     39 * {{{M}}}: Display timings will be calculated using VESA(TM) Coordinated Video Timings instead of a lookup table (Please see [https://www.kernel.org/doc/Documentation/fb/modedb.txt modedb.txt] for more details)
     40 * {{{R}}}: Do "Reduce Blanking" calculation for digital displays
     41 * {{{-<bpp>}}}: color depth
     42 * {{{i}}}: Calculate timings for an interlaced Mode
     43 * {{{m}}}: Add margins to the calculation (1.8% of xres rounded down to 8 pixels and 1.8% of yres)
     44 * {{{e}}}: Output Forced On
     45 * {{{D}}}: Output Forced On and use Digital Outputs
     46 * {{{d}}}: Output Forced Off
     47
     48Examples:
     49 * Disable both the LVDS and HDMI outputs on a Gateworks GW540x:
     50{{{#!bash
     51setenv video 'video=LVDS-1:d video=HDMI-A-1:d'
     52}}}
     53
     54Then, when booted:
     55{{{#!bash
     56root@OpenWrt:/# dmesg | grep -E "LVDS-1|HDMI-A-1"
     57[    0.000000] Kernel command line: console=ttymxc1,115200 ubi0:ubi ubi.mtd=2 rootfstype=squashfs,ubifs video=LVDS-1:d video=HDMI-A-1:d
     58[   12.181930] [drm] forcing HDMI-A-1 connector OFF
     59[   12.196641] [drm] forcing LVDS-1 connector OFF
     60}}}
     61 * Set HDMI output to 800x600 @ 60Hz refresh rate and disable LVDS:
     62{{{#!bash
     63setenv video 'video=LVDS-1:d video=HDMI-A-1:800x600@60'
     64}}}
     65
     66
     67== Limitations ==
     68Using the upstream kernel currently has some limitations on the imx platform. For example, the driver is limited to the number of display outputs it can do. That means if both LVDS and HDMI were connected, both resolutions would be scaled to the display with the lower resolution. Both outputs are also mirror's of each other and cannot be run independently. However, using the 'downstream' vendor kernel that we provide on our Yocto BSPs do have features that allow for independently controlled displays, even allowing for an 'overlay' buffer for the first two displays.
     69
     70To see more on the downstream vendor kernel provided in Yocto, please see [wiki:Yocto/Video_Out here].
     71
     72== References ==
     73 * ​https://en.wikipedia.org/wiki/Direct_Rendering_Manager
     74 * ​https://en.wikipedia.org/wiki/Mode_setting
     75 * ​https://www.kernel.org/doc/Documentation/fb/modedb.txt