VAR-SOM-MX6 Dual Displays: Difference between revisions

From Variscite Wiki
m (Eran moved page Dual Displays to VAR-SOM-MX6 Dual Displays without leaving a redirect)
No edit summary
(5 intermediate revisions by 2 users not shown)
Line 1: Line 1:
= Use Dual Displays, LVDS & HDMI: =
{{PageHeader|VAR-SOM-MX6 Dual Displays}}
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.<br>
{{DocImage|category1=Yocto|category2=VAR-SOM-MX6}} __toc__
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 [[VAR-SOM-MX6_Yocto_Fido_R3_Build_Linux_out_of_tree | Linux out of tree]] section for how to compile the device tree):
= Use Dual Displays: LVDS & HDMI =
<pre>
1. Set the LVDS's display controllers to use same IPU in device tree.<br>
For example, using the MX6CustomBoard with VAR-SOM-MX6 Quad SOM, use the following patch and compile a new imx6q-var-som.dtb
<syntaxhighlight lang="diff">
diff --git a/arch/arm/boot/dts/imx6q-var-som.dts
diff --git a/arch/arm/boot/dts/imx6q-var-som.dts
b/arch/arm/boot/dts/imx6q-var-som.dts
b/arch/arm/boot/dts/imx6q-var-som.dts
Line 21: Line 23:
         };
         };
  };
  };
</pre>
</syntaxhighlight>
<br>
<br>
2. Change the videoargs variable in the U-Boot environment.<br>
2. Change the videoargs variable in the U-Boot environment.<br>
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:
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:
<pre>
<pre>
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;'
setenv videoargs 'setenv bootargs ${bootargs} video=mxcfb0:dev=hdmi,1920x1080M@60,if=RGB24 video=mxcfb1:dev=ldb,800x480M@60,if=RGB24;'
</pre>
</pre>
<br>
<br>
Line 39: Line 41:
<span style="font-family:Consolas;">/dev/fb2</span>&nbsp; is the secondary screen, and &nbsp;<span style="font-family:Consolas;">/dev/fb3</span>&nbsp; is its overlay.<br>
<span style="font-family:Consolas;">/dev/fb2</span>&nbsp; is the secondary screen, and &nbsp;<span style="font-family:Consolas;">/dev/fb3</span>&nbsp; is its overlay.<br>
<br>
<br>
==Display modes:==
==Display modes==
Following are some commands to get and set the display mode of each screen.<br>
Following are some commands to get and set the display mode of each screen.<br>
<br>
<br>

Revision as of 08:34, 30 November 2018

VAR-SOM-MX6 Dual Displays

Use Dual Displays: LVDS & HDMI

1. Set the LVDS's display controllers to use same IPU in device tree.
For example, using the MX6CustomBoard with VAR-SOM-MX6 Quad SOM, use the following patch and compile a new imx6q-var-som.dtb

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;'


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