VAR-SOM-MX6 Dual Displays

From Variscite Wiki
Revision as of 09:30, 28 April 2016 by Eran (talk | contribs)

Use Dual Displays, LVDS & HDMI:

1. If you want to use two independent displays (not mirror them), make sure that the display controllers of the two lvds channels, defined in the kernel device tree, are set to different displays and the same ipu.
i.e: If you're using the MX6CustomBoard with a quad core SOM, use the following patch and compile a new imx6q-var-som.dtb (refer to the Linux out of tree section for how to compile the device tree):

diff --git a/arch/arm/boot/dts/imx6q-var-som.dts
b/arch/arm/boot/dts/imx6q-var-som.dts
index 5eeda5c..fc4dec4 100644
--- a/arch/arm/boot/dts/imx6q-var-som.dts
+++ b/arch/arm/boot/dts/imx6q-var-som.dts
@@ -145,11 +145,11 @@

 &ldb {
        lvds-channel@0 {
-               crtc = "ipu1-di0";
+               crtc = "ipu2-di0";
        };

        lvds-channel@1 {
-               crtc = "ipu2-di0";
+               crtc = "ipu2-di1";
        };
 };


2. Change the videoargs variable in the U-Boot environment.
In this example, HDMI is set to be the primary screen and LVDS to be the secondary - you can switch mxcfb0 and mxcfb1 if you want it the other way around:

setenv videoargs 'setenv bootargs ${bootargs} video=mxcfb0:dev=hdmi,1920x1080M@60,if=RGB24 video=mxcfb1:dev=ldb,800x480M@60,if=RGB24; i2c dev 2; if i2c probe 0x38; then setenv bootargs ${bootargs} screen_alternate=yes;'


3. Activate the secondary display:

echo 0 > /sys/class/graphics/fb2/blank


At this point you should see the desktop on the primary screen, and a black screen on the secondary.

/dev/fb0  is the primary screen, and  /dev/fb1  is its overlay.
/dev/fb2  is the secondary screen, and  /dev/fb3  is its overlay.

Display modes:

Following are some commands to get and set the display mode of each screen.

Print the current display mode on each display (if you don't change it, it should be like in the U-Boot bootargs in step 2):

cat /sys/class/graphics/fb0/mode
cat /sys/class/graphics/fb2/mode


List the supported modes for each display:

cat /sys/class/graphics/fb0/modes
cat /sys/class/graphics/fb2/modes


Set the current mode to one of the supported modes:

echo A_SUPPORTED_MODE > /sys/class/graphics/fb0/mode
echo A_SUPPORTED_MODE > /sys/class/graphics/fb2/mode