Bootargs for enabling display

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)

=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 KernelModeSetting 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.



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.

{| width="100%" cellspacing="5" cellpadding="0" valign="left" OMAP Display OMAP-FRAMEBUFFER
 * valign="left" style="border:1px solid #999999; text-align:left; width: 33%;" cellpadding="5"|

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.

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



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

  

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


 * Rotation:

 

Blanking and unblanking FB
echo "1" > /sys/class/graphics/fb0/blank echo "0" > /sys/class/graphics/fb0/blank
 * Blanking fb0:
 * Unblanking fb0:

Setting fb0 to more than one overlays
echo "0" > /sys/class/graphics/fb0/overlays echo "1" > /sys/class/graphics/fb0/overlays echo "0,1" > /sys/class/graphics/fb0/overlays
 * Setting fb0 to overlay0:
 * Setting fb0 to overlay1:
 * Setting fb0 to overlay0 and overlay1:

Reading fb attributes
cat /sys/class/graphics/fb0/phys_addr
 * Reading physical address of fb0:

- 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

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

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


 * }



{| width="100%" cellspacing="5" cellpadding="0" valign="left" OMAP Display OVERLAYS
 * valign="left" style="border:1px solid #999999; text-align:left; width: 33%;" cellpadding="5"|

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 <BR> overlay3: VID3 <BR>

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

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

Reading overlay properties
cat /sys/devices/platform/omapdss/overlay0/input_size cat /sys/devices/platform/omapdss/overlay0/name cat /sys/devices/platform/omapdss/overlay0/output_size cat /sys/devices/platform/omapdss/overlay0/position cat /sys/devices/platform/omapdss/overlay0/screen_width cat /sys/devices/platform/omapdss/overlay0/global_alpha
 * Read overlay1 input size
 * Reading overlay0's name
 * Reading output_size of overlay0
 * Reading position of overlay0
 * Reading screen_width of overlay0
 * Reading global_alpha of overlay0, Range: 0-255, 0=transparent 255=opaque

Set overlay's manager
echo "0" > /sys/devices/platform/omapdss/overlay0/enabled echo "lcd" > /sys/devices/platform/omapdss/overlay0/manager echo "1" > /sys/devices/platform/omapdss/overlay0/enabled
 * Set overlay0's manager as lcd
 * }

{| width="100%" cellspacing="5" cellpadding="0" valign="left" <div style="background: #AACC99; border: 1px solid #2C547A; padding: 5px; margin: 3px; font-weight:bold;text-align:center;font-size:120%;">OMAP Display MANAGER
 * valign="left" style="border:1px solid #999999; text-align:left; width: 33%;" cellpadding="5"|

-- 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
cat /sys/devices/platform/omapdss/manager0/display cat /sys/devices/platform/omapdss/manager0/name
 * Reading display name to which manager0 has been attached

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

Set manager properties alpha-blending, transparency key
echo "1" > /sys/devices/platform/omapdss/manager0/alpha_blending_enabled echo "1" > /sys/devices/platform/omapdss/manager0/trans_key_enabled
 * Enable alpha blending for manager0 (0=off, 1=on):
 * Enable transparency key for manager0 (0=off, 1=on):

Setting alpha-blending for seeing three videos simultaneously one over the other
By default all overlays are pointing to the manager lcd echo "1" > /sys/devices/platform/omapdss/manager0/alpha_blending_enabled
 * Enable alpha blending for manager0 (0=off, 1=on):

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
 * Setting alpha value for various overlays:

Then run the video. <BR>
 * 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.



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: echo "3" > /sys/devices/platform/omapdss/overlay0/zorder
 * 1) Make GFX topmost:

Enabling/Disabling display
echo "1" > /sys/devices/platform/omapdss/display0/enabled cat /sys/devices/platform/omapdss/display0/name 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
 * Enable or disable display (0=off, 1=on):
 * Reading the name of display0:
 * Setting rotation angle of display0 (0=0°; 1=90°; 2=180°; 3=270°)
 * 1) Set rotation to 180:
 * Reading timing values of display0:
 * Reading panel-name of display0:

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. echo "1" > /sys/devices/platform/omapdss/display1/enabled echo "0" > /sys/devices/platform/omapdss/overlay1/enabled echo "0" > /sys/devices/platform/omapdss/overlay0/enabled echo "2lcd" > /sys/devices/platform/omapdss/overlay0/manager echo "1" > /sys/devices/platform/omapdss/overlay0/enabled And content on primary LCD would be transferred to secondary LCD.
 * 1) Enable secondary LCD
 * 1) Disable overlay1 which is connected to secondary LCD
 * 1) Disable overlay0 (an overlay must be disabled before changing its properties)
 * 1) Set the manager of overlay0 to display1 which is secondary LCD
 * 1) Enable overlay0 which is now directed to the secondary LCD


 * Sample script to allow movement of video overlays across different displays is shared here.

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

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


 * example C program for swapping overlays is available

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)

echo "0" > /sys/devices/platform/omapdss/display1/enabled echo "pico_DLP" > /sys/devices/platform/omapdss/manager2/display echo "1" > /sys/devices/platform/omapdss/display3/enabled This will switch all the overlay associated with secondary LCD to Pico-DLP.
 * 1) Disable secondary LCD if enabled.
 * 1) Set the secondary manager to Pico-DLP
 * 1) Enable Pico-DLP

Scenario for moving contents from primary-lcd to HDMI
echo "1" > /sys/devices/platform/omapdss/display2/enabled echo "0" > /sys/devices/platform/omapdss/overlay0/enabled echo "tv" > /sys/devices/platform/omapdss/overlay0/manager 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.
 * 1) Enable HDMI
 * 1) Disable overlay0 (an overlay must be disabled before changing its properties)
 * 1) Set the manager of overlay0 to display2 which is HDMI
 * 1) Enable overlay0

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 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)
 * Trans color key

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
echo "0" > /sys/class/graphics/fb0/blank echo "0" > /sys/class/graphics/fb1/blank
 * Unblanking display

Append consoleblank=0 in your booargs
 * Disabling blanking with Penguin UI

killall gnome-screensaver export DISPLAY=:0.0 xset s off xset –dpms
 * Disabling blanking with Ubuntu UI

http://omappedia.org/wiki/Ubuntu_Known_Issues#Screen_Blanking
 * More on display Blanking (From Ubuntu wiki)

DSS specific bootargs

 * BACK to Display Domain Wiki