Bootargs for enabling display

From OMAPpedia

Revision as of 13:35, 4 January 2012 by Mythripk (Talk | contribs)
Jump to: navigation, search

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

align="centre"

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="centre"

  • 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="centre"
echo "0" > /sys/class/graphics/fb0/rotate



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



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



4. Enable rotation angle of 270 degrees: align="centre"
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="centre"

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 <video-source> > 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:

To change the zorder the following command can be used:

# Make GFX topmost:
echo "3" > /sys/devices/platform/omapdss/overlay0/zorder

Enabling/Disabling display

echo "1" > /sys/devices/platform/omapdss/display0/enabled		
cat /sys/devices/platform/omapdss/display0/name
# Set rotation to 180:
echo "2" > /sys/devices/platform/omapdss/display0/rotate

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

cat /sys/devices/platform/omapdss/display0/timings
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.

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.


Standard Display Resolutions

align="centre"

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="centre"

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

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

       echo 1 > /sys/devices/platform/omapdss/manager0/trans_key_enabled
       echo <video-source> > 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 <debugfs>/omapdss/ which show information about clocks and registers.


OMAP3 HDMI

                      Work In Progress

How to deal with display blanking

       echo "0" > /sys/class/graphics/fb0/blank
       echo "0" > /sys/class/graphics/fb1/blank
       Append consoleblank=0 in your booargs
       killall gnome-screensaver
       export DISPLAY=:0.0
       xset s off
       xset –dpms

http://omappedia.org/wiki/Ubuntu_Known_Issues#Screen_Blanking

DSS specific bootargs

DSS specific bootargs
  • consoleblank
        consoleblank=<value>
        - 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=<size>
        - Amount of total VRAM to preallocate. For example, "10M". omapfb
          allocates memory for framebuffers from VRAM.
  • mode
        omapfb.mode=<xres>x<yres>[M][R][-<bpp>][@<refresh>][i][m] or <name>[-<bpp>][@<refresh>]
        - Default video mode for specified displays. For example - "dvi:800x400MR-24@60".
          <xres>, <yres>, <bpp> and <refresh> are decimal numbers and <name> is a string.
          <xres> is resolution in x-axis.
          <yres> is resolution in y-axis.
          <bpp> 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=<fbnum>:<size>[@<physaddr>][,...]
         - 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=<y|n>
         - Enable debug printing. You have to have OMAPFB debug support enabled
           in kernel config.
  • test
         omapfb.test=<y|n>
         - Draw test pattern to framebuffer whenever framebuffer settings change.
           You need to have OMAPFB debug support enabled in kernel config.
  • vrfb
         omapfb.vrfb=<y|n>
         - Use VRFB rotation for all framebuffers.
         (Applicable only for OMAP3)
  • rotate
        omapfb.rotate=<angle>
         - 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=<y|n>
         - Default mirror for all framebuffers. Only works with DMA rotation.
  • def_disp
         omapdss.def_disp=<display>
         - Name of default display, to which all overlays will be connected.
           Common examples are "lcd", "2lcd" or "hdmi".
  • debug
         omapdss.debug=<y|n>
         - 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.

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox