Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1866993
  • 博文数量: 473
  • 博客积分: 13997
  • 博客等级: 上将
  • 技术积分: 5953
  • 用 户 组: 普通用户
  • 注册时间: 2010-01-22 11:52
文章分类

全部博文(473)

文章存档

2014年(8)

2013年(38)

2012年(95)

2011年(181)

2010年(151)

分类: LINUX

2012-06-14 00:37:30

This articles talks about bootargs required to be added for enabling DSS. Starting with 2.6.34 (or L24.7) although DSS is enabled in defconfig, one needs to add some boot arguments to enable display and see penguin logos at the bootup time (skip to 27 min:14sec)

Contents []
[] Basic usage [] Enabling basic display with bootargs
Note: if using omapdrm instead of omapfb then no bootargs are required. The driver will automatically enable all displays that are detected at boot time, and configure a resolution based on the capabilities of the monitor (ie. for DVI/HDMI, based on the EDID). For more control, see the page on the nouveau wiki, in particular scroll down to the 'Forcing Modes' section. It is not recommended to change DSS overlay->manager->dssdev routing via sysfs as described below, as it will likely confuse the driver and/or userspace processes using KMS API. (In fact there should arguably be a kernel build option to make omapdss sysfs read-only.) Instead the drm/kms provided API should be used for configuring display routing.

align=

This should be added, if display is to be enabled. By default this value is set to zero:

vram=10M

The size of each frambuffer device can be specified:

omapfb.vram=0:2M,1:5M

In this case fb0 = 2M and fb1 = 5M. A maximum of 3 fb devices can be created. If the size is not specified, frame buffers with default size are created. Each fb device will have a size of display resolution * 4 (32 bpp).

[] Advanced users

Sysfs entries and bootargs provided by DSS2.

OMAP Display OMAP-FRAMEBUFFER
[] General sysfs entries for FB [] Mirrorring and Rotation of OMAPFB

To use these sysfs we need to allocate VRFB in OMAP3 and TILER in OMAP4. This must be specified at the boot time through bootargs.

For example: Please pass omapfb.tiler=y through bootargs if you wish to use rotation feature through bootargs.

  • Enable mirroring:
echo "1" > /sys/class/graphics/fb0/mirror

align=

  • Disable mirroring:
echo "0" > /sys/class/graphics/fb0/mirror


  • View rotation type, where 0 = DMA rotation, 1 = VRFB rotation, and 2 = TILER rotation: (OMAP3 supports VRFB and OMAP4 supports rotation using TILER)
cat /sys/class/graphics/fb0/rotate_type


  • Rotation:
1. Enable rotation angle of 0 degrees: align=
echo "0" > /sys/class/graphics/fb0/rotate



2. Enable rotation angle of 90 degrees: align=
echo "1" > /sys/class/graphics/fb0/rotate



3. Enable rotation angle of 180 degrees: align=
echo "2" > /sys/class/graphics/fb0/rotate



4. Enable rotation angle of 270 degrees: align=
echo "3" > /sys/class/graphics/fb0/rotate
[] Blanking and unblanking FB
  • Blanking fb0:
echo "1" > /sys/class/graphics/fb0/blank
  • Unblanking fb0:
echo "0" > /sys/class/graphics/fb0/blank [] Setting fb0 to more than one overlays
  • Setting fb0 to overlay0:
echo "0" > /sys/class/graphics/fb0/overlays
  • Setting fb0 to overlay1:
echo "1" > /sys/class/graphics/fb0/overlays
  • Setting fb0 to overlay0 and overlay1:
echo "0,1" > /sys/class/graphics/fb0/overlays [] Cloning contents of fb0 to LCD and 2LCD
  • Setting fb1 to null:
echo "" > /sys/class/graphics/fb1/overlays
  • Setting fb0 to overlay0 and overlay1:
echo "0,1" > /sys/class/graphics/fb0/overlays
  • Enabling overlay0 and overlay1:
echo "1" > /sys/devices/platform/omapdss/overlay0/enabled echo "1" > /sys/devices/platform/omapdss/overlay1/enabled
  • Setting overlay0 to LCD and overlay1 to 2LCD
echo "0" > /sys/devices/platform/omapdss/overlay0/enabled echo "lcd" > /sys/devices/platform/omapdss/overlay0/manager echo "1" > /sys/devices/platform/omapdss/overlay0/enabled echo "0" > /sys/devices/platform/omapdss/overlay1/enabled echo "2lcd" > /sys/devices/platform/omapdss/overlay1/manager echo "1" > /sys/devices/platform/omapdss/overlay1/enabled
  • Enable LCD and 2LCD
echo "1" > /sys/devices/platform/omapdss/display0/enabled echo "1" > /sys/devices/platform/omapdss/display1/enabled
align=
[] Reading fb attributes
  • Reading physical address of fb0:
cat /sys/class/graphics/fb0/phys_addr

- If we are using normal SDRAM buffer the address is generally of the range: 0x8XXXXXXX

- If we pass omapfb.tiler=y in bootargs, TILER buffer is allocated. And we get phys_addr = 0x68000000 to 0x7FFFFFFF


  • Reading virtual address of fb0
cat /sys/class/graphics/fb0/virt_addr


  • Reading size of fb0 (in bytes)
cat /sys/class/graphics/fb0/size

align=centre

OMAP Display OVERLAYS

Overlay here means a software overlay. In hardware it is called as pipeline.
-- Number of overlays for OMAP3: 3
overlay0: GFX,
overlay1: VID1,
overlay2: VID2

-- Number of overlays for OMAP4: 4
overlay0: GFX,
overlay1: VID1,
overlay2: VID2
overlay3: VID3

[] Set overlay properties
  • Set overlay0 ON:
echo "1" > /sys/devices/platform/omapdss/overlay0/enabled
  • Set overlay0 OFF:
echo "0" > /sys/devices/platform/omapdss/overlay0/enabled

An overlay should be enabled if you want to see something on it.

[] Reading overlay properties
  • Read overlay1 input size
cat /sys/devices/platform/omapdss/overlay0/input_size
  • Reading overlay0's name
cat /sys/devices/platform/omapdss/overlay0/name
  • Reading output_size of overlay0
cat /sys/devices/platform/omapdss/overlay0/output_size
  • Reading position of overlay0
cat /sys/devices/platform/omapdss/overlay0/position
  • Reading screen_width of overlay0
cat /sys/devices/platform/omapdss/overlay0/screen_width
  • Reading global_alpha of overlay0, Range: 0-255, 0=transparent 255=opaque
cat /sys/devices/platform/omapdss/overlay0/global_alpha [] Set overlay's manager
  • Set overlay0's manager as lcd
echo "0" > /sys/devices/platform/omapdss/overlay0/enabled echo "lcd" > /sys/devices/platform/omapdss/overlay0/manager echo "1" > /sys/devices/platform/omapdss/overlay0/enabled


OMAP Display MANAGER

-- Number of managers for OMAP3 = 2 manager0: lcd manager1: tv

-- Number of managers for OMAP4 = 3 manager0: lcd manager1: tv manager2: 2lcd

[] Read manager attributes
  • Reading display name to which manager0 has been attached
cat /sys/devices/platform/omapdss/manager0/display cat /sys/devices/platform/omapdss/manager0/name

This would give a name from the list above (lcd, tv)

[] Set manager properties alpha-blending, transparency key
  • Enable alpha blending for manager0 (0=off, 1=on):
echo "1" > /sys/devices/platform/omapdss/manager0/alpha_blending_enabled
  • Enable transparency key for manager0 (0=off, 1=on):
echo "1" > /sys/devices/platform/omapdss/manager0/trans_key_enabled [] Setting alpha-blending for seeing three videos simultaneously one over the other

By default all overlays are pointing to the manager lcd

  • Enable alpha blending for manager0 (0=off, 1=on):
echo "1" > /sys/devices/platform/omapdss/manager0/alpha_blending_enabled


  • Setting alpha value for various overlays:
echo "50" > /sys/devices/platform/omapdss/overlay1/global_alpha echo "150" > /sys/devices/platform/omapdss/overlay2/global_alpha echo "200" > /sys/devices/platform/omapdss/overlay3/global_alpha

Then run the video.

  • Trans color key
echo 1 > /sys/devices/platform/omapdss/manager0/trans_key_enabled echo > sys/devices/platform/omapdss/manager0/trans_key_type echo 16777215 > sys/devices/platform/omapdss/manager0/trans_key_ value (16777215 for white )(FF0000 to get red)
[] Zorder of an overlay [Specific to OMAP4 Not Applicable to OMAP3]

An object with a Z-order of 1 would be visually "underneath" an object with a Z-order of 2 or greater.

Image: 700 pixels

The default zorders are:

  • Overlay 0 -> 0
  • Overlay 1 -> 1
  • Overlay 2 -> 2
  • Overlay 3 -> 3

To change the zorder the following command can be used:

# Make GFX topmost: echo "3" > /sys/devices/platform/omapdss/overlay0/zorder [] Enabling/Disabling display
  • Enable or disable display (0=off, 1=on):
echo "1" > /sys/devices/platform/omapdss/display0/enabled
  • Reading the name of display0:
cat /sys/devices/platform/omapdss/display0/name
  • Setting rotation angle of display0 (0=0°; 1=90°; 2=180°; 3=270°)
# Set rotation to 180: echo "2" > /sys/devices/platform/omapdss/display0/rotate
  • Reading timing values of display0:

Display timings include: pixclock,xres/hfp/hbp/hsw,yres/vfp/vbp/vsw.

cat /sys/devices/platform/omapdss/display0/timings
  • Reading panel-name of display0:
cat /sys/devices/platform/omapdss/display0/panel_name [] Setting tear-elimination of display0 to ON or OFF [Specific to OMAP4 DSI] echo "0" > /sys/devices/platform/omapdss/display0/tear_elim [] Scenario for moving contents from primary LCD to secondary LCD [Specific to OMAP4]

By default overlay0 is connected to display0 (primary LCD), and overlay1 is connected to display1 which is secondary LCD.

# Enable secondary LCD echo "1" > /sys/devices/platform/omapdss/display1/enabled # Disable overlay1 which is connected to secondary LCD echo "0" > /sys/devices/platform/omapdss/overlay1/enabled # Disable overlay0 (an overlay must be disabled before changing its properties) echo "0" > /sys/devices/platform/omapdss/overlay0/enabled # Set the manager of overlay0 to display1 which is secondary LCD echo "2lcd" > /sys/devices/platform/omapdss/overlay0/manager # Enable overlay0 which is now directed to the secondary LCD echo "1" > /sys/devices/platform/omapdss/overlay0/enabled

And content on primary LCD would be transferred to secondary LCD.

  • Sample script to allow movement of video overlays across different displays is shared .
[] Scenario for swapping contents between primary LCD and secondary LCD [Specific to OMAP4]

By default overlay0 is connected to display0 (primary lcd) and overlay1 is connected to display1 which is (secondary lcd)

# Enable primary LCD: echo "1" > /sys/devices/platform/omapdss/display0/enabled # Enable secondary LCD: echo "1" > /sys/devices/platform/omapdss/display1/enabled # Disable overlay0 (n overlay must be disabled before changing its properties): echo "0" > /sys/devices/platform/omapdss/overlay0/enabled # Set the manager of overlay0 to display1 which is secondary LCD: echo "2lcd" > /sys/devices/platform/omapdss/overlay0/manager # Enable overlay0: echo "1" > /sys/devices/platform/omapdss/overlay0/enabled # Disable overlay1 (an overlay must be disabled before changing its properties): echo "0" > /sys/devices/platform/omapdss/overlay1/enabled # Set the manager of overlay1 to display0 which is primary LCD: echo "lcd" > /sys/devices/platform/omapdss/overlay0/manager # Enable overlay1: echo "1" > /sys/devices/platform/omapdss/overlay0/enabled # Turn off primary display (display0) echo "0" > /sys/devices/platform/omapdss/display0/enabled

And content on primary LCD would be transferred to secondary LCD.


  • example C program for swapping overlays is available
[] Standard Display Resolutions

align=

[] Scenario for switching contents from secondary LCD to Pico-DLP [Specific to OMAP4]

(This needs to be done till 24.10 do not enable this option for L24.11)

This is needed in kernel configuration (with `make menuconfig`):

Device Drivers ---> Graphics support ---> -*- OMAP2/3/4 Display Subsystem support (EXPERIMENTAL) ----> [*] Use DSI PLL for PCLK (EXPERIMENTAL) # Disable secondary LCD if enabled. echo "0" > /sys/devices/platform/omapdss/display1/enabled # Set the secondary manager to Pico-DLP echo "pico_DLP" > /sys/devices/platform/omapdss/manager2/display # Enable Pico-DLP echo "1" > /sys/devices/platform/omapdss/display3/enabled

This will switch all the overlay associated with secondary LCD to Pico-DLP.

[] OMAP4 HDMI

align=

[] Scenario for moving contents from primary-lcd to HDMI # Enable HDMI echo "1" > /sys/devices/platform/omapdss/display2/enabled # Disable overlay0 (an overlay must be disabled before changing its properties) echo "0" > /sys/devices/platform/omapdss/overlay0/enabled # Set the manager of overlay0 to display2 which is HDMI echo "tv" > /sys/devices/platform/omapdss/overlay0/manager # Enable overlay0 echo "1" > /sys/devices/platform/omapdss/overlay0/enabled

And content on overlay 0 of primary lcd would be transferred to HDMI.It works similarly for all other overlay's.

[] How to enable HDMI in hot-plug detect mode

Enable HDMI in hot-plug detect mode:

echo 1 > /sys/devices/platform/omapdss/display2/hpd_enabled

Once you do this you should be able to plug in or plug out the HDMI cable and when plugged in it will detect and set the timing to default value ie set.

[] How to read and set EDID timings for HDMI

kernel before 3.0 Display all the supported EDID timings and audio/video formats supported (if extended bit is present):

cat /sys/devices/platform/omapdss/display2/custom_edid_timing

Set one of the displayed EDID timing supported by the TV:

echo 41 > /sys/devices/platform/omapdss/display2/custom_edid_timing

In order to set HDMI timing 4 then set 41, append 0 or 1 based on whether it is a DVI/HDMI respectively.

echo 160 > /sys/devices/platform/omapdss/display2/custom_edid_timings

To set the timing to 1280 1024 for a DVI monitor code will be 16 (hexadecimal value of 0x10) and mode will be 0 for DVI.

For kernel after 3.0

Set one of the timing supported by the TV:

echo "pixel_clock,x_res/hfp/hbp/hsw,y_res/vfp/vbp/vsw" > /sys/devices/platform/omapdss/display1/timings

For ex: To set 640 * 480 VGA resolution.

echo " 25175,640/16/48/96,480/11/31/2" > /sys/devices/platform/omapdss/display1/timings


Find the timing information in the HDMI 1.3 specification.For some of the VESA resolution refer to the below mentioned details

Code Mode Timing values Refresh Rate 4(0x4) 0 {640, 480, 25175, 96, 16, 48, 2 , 11, 31} 60Hz 9(0x9) 0 {800, 600, 40000, 128, 40, 88, 4 , 1, 23} 60Hz 14(0xE) 0 {848, 480, 33750, 112, 16, 112, 8 , 6, 23} 60Hz 23(0x17) 0 {1280, 768, 71000, 128, 64, 192, 7 , 3, 20} 60Hz 28(0x1C) 0 {1280, 800, 83500, 128, 72, 200, 6 , 3, 22} 60Hz 39(0x27) 0 {1360, 768, 85500, 112, 64, 256, 6 , 3, 18} 60Hz 32(0x20) 0 {1280, 960, 108000, 112, 96, 312, 3 , 1, 36} 60Hz 35(0x23) 0 {1280, 1024, 108000, 112, 48, 248, 3 , 1, 38} 60Hz 16(0x10) 0 {1024, 768, 65000, 136, 24, 160, 6, 3, 29} 60Hz 42(0x2A) 0 {1400, 1050, 121750, 144, 88, 232, 4, 3, 32} 60Hz 47(0x2F) 0 {1440, 900, 106500, 152, 80, 232, 6, 3, 25} 60Hz 58(0x3A) 0 {1680, 1050, 146250, 176 , 104, 280, 6, 3, 30} 60Hz 81(0x51) 0 {1366, 768, 85500, 143, 70, 213, 3, 3, 24} 60Hz 82(0x52) 0 {1920, 1080, 148500, 44, 88, 80, 5, 4, 36} 60Hz 22(0x16) 0 {1280, 768, 68250, 32, 48, 80, 7, 3, 12} 60Hz 41(0x29) 0 {1400, 1050, 101000, 32, 48, 80, 4, 3, 23} 60Hz 57(0x39) 0 {1680, 1050, 119000, 32, 48, 80, 6, 3, 21} 60Hz 1 1 {640, 480, 25200, 96, 16, 48, 2, 10, 33} 60Hz 19 1 {1280, 720, 74250, 40, 440, 220, 5, 5, 20} 50Hz 4 1 {1280, 720, 74250, 40, 110, 220, 5, 5, 20} 59.94HZ 2 1 {720, 480, 27000, 62, 16, 60, 6, 9, 30} 59.94HZ 37 1 {2880, 576, 108000, 256, 48, 272, 5, 5, 39} 50HZ 6 1 {1440, 480, 27000, 124, 38, 114, 3, 4, 15} 59.94Hz 21 1 {1440, 576, 27000, 126, 24, 138, 3, 2, 19} 50Hz 20 1 {1920, 1080, 74250, 44, 528, 148, 2, 5, 15} 50Hz 5 1 {1920, 1080, 74250, 44, 88, 148, 2, 5, 15} 60Hz 16 1 {1920, 1080, 148500, 44, 88, 148, 5, 4, 36} 60Hz 17 1 {720, 576, 27000, 64, 12, 68, 5, 5, 39} 50Hz 29 1 {1440, 576, 54000, 128, 24, 136, 5, 5, 39} 50Hz 31 1 {1920, 1080, 148500, 44, 528, 148, 5, 4, 36} 50Hz 35 1 {2880, 480, 108000, 248, 64, 240, 6, 9, 30} 59.94Hz
  • Please Note that mode is equally important in setting the timing thus mode has to be appended to the code while setting the timing value through sysfs.*
[] How to profile HDMI EVENSYNC

Apply this patch and enable and disable HDMI , When disabled it will print the statistics of Number of framedone EVENSYNC IRQ's recieved in the us displayed: HDMI profiling patch

  • Trans color key
echo 1 > /sys/devices/platform/omapdss/manager0/trans_key_enabled echo > sys/devices/platform/omapdss/manager0/trans_key_type echo 16777215 > sys/devices/platform/omapdss/manager0/trans_key_ value (16777215 for white )(FF0000 to get red)

There are also some debugfs files at /omapdss/ which show information about clocks and registers.


[] OMAP3 HDMI Work In Progress [] How to deal with display blanking
  • Unblanking display
echo "0" > /sys/class/graphics/fb0/blank echo "0" > /sys/class/graphics/fb1/blank
  • Disabling blanking with Penguin UI
Append consoleblank=0 in your booargs
  • Disabling blanking with Ubuntu UI
killall gnome-screensaver export DISPLAY=:0.0 xset s off xset –dpms
  • More on display Blanking (From Ubuntu wiki)

[] DSS specific bootargs
DSS specific bootargs
  • consoleblank
consoleblank= - To set the value of display blanking interval timer in seconds. - Set it to "0" if you wish to disable the blanking timer.
  • vram
vram= - Amount of total VRAM to preallocate. For example, "10M". omapfb allocates memory for framebuffers from VRAM.
  • mode
omapfb.mode=x[M][R][-][@][i][m] or [-][@] - Default video mode for specified displays. For example - "dvi:800x400MR-24@60". , , and are decimal numbers and is a string. is resolution in x-axis. is resolution in y-axis. is bit per pixel. [M] will allow to compute the timings using VESA(tm) Coordinated Video Timings (CVT). [R] will allow to compute with reduced blanking (for flatpanels). [i] will allow to compute interlaced mode. [m] will add margins equal to 1.8% of xres rounded down to 8 pixels, and 1.8% of yres. NOTE: The char 'i' and 'm' must be after 'M' and 'R'. Example: Just for information: 1024x768MR-8@60m = Reduced blank with margins at 60Hz. For more information, See drivers/video/modedb.c. There are also two special modes: "pal" and "ntsc" that can be used to tv out.
  • vram
omapfb.vram=:[@][,...] - VRAM allocated for a framebuffer. Normally omapfb allocates vram depending on the display size. With this you can manually allocate more or define the physical address of each framebuffer. For example, "1:4M" to allocate 4M for fb1.
  • debug
omapfb.debug= - Enable debug printing. You have to have OMAPFB debug support enabled in kernel config.
  • test
omapfb.test= - Draw test pattern to framebuffer whenever framebuffer settings change. You need to have OMAPFB debug support enabled in kernel config.
  • vrfb
omapfb.vrfb= - Use VRFB rotation for all framebuffers. (Applicable only for OMAP3)
  • rotate
omapfb.rotate= - Default rotation applied to all framebuffers. 0 - 0 degree rotation 1 - 90 degree rotation 2 - 180 degree rotation 3 - 270 degree rotation
  • mirror
omapfb.mirror= - Default mirror for all framebuffers. Only works with DMA rotation.
  • def_disp
omapdss.def_disp= - Name of default display, to which all overlays will be connected. Common examples are "lcd", "2lcd" or "hdmi".
  • debug
omapdss.debug= - Enable debug printing. You have to have DSS debug support enabled in kernel config.
  • tearing
panel-taal.dsi_te_sync=<1|0> - Enables synchronization with Panel-Taal's tearing interrupt. The value is 1 by default.
  • HDMI
This holds only for L24.8 release or earlier. Auto detection for TV is enabled post L24.8. omapdss.hdmicode = {Timing value supported by the TV} omapdss.hdmimode = {Mode DVI or HDMI depending on the timing} - By default the value of hdmicode = 16 {1080p} and hdmimode = 1 {HDMI mode} is taken.
阅读(1707) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~