Enabling dual display mode (#29)

* enabling dual display mode

* Add files via upload

* enabling dual display

* Update README.md

* Delete a64-olinuxino-hdmi.dtb

* Delete a64-olinuxino-lcd.dtb
This commit is contained in:
Chris Boudacoff 2018-12-05 10:39:08 +02:00 committed by Dimitar Gamishev
parent dd39027f52
commit 5452cea412
11 changed files with 133 additions and 29 deletions

@ -410,7 +410,7 @@ static s32 parser_disp_init_para(const struct device_node *np, disp_init_para *
}
//fb0
init_para->buffer_num[0]= 2;
init_para->buffer_num[0]= 1;
if (of_property_read_u32(np, "fb0_format", &value) < 0) {
__wrn("of_property_read disp_init.fb0_format fail\n");
@ -431,7 +431,7 @@ static s32 parser_disp_init_para(const struct device_node *np, disp_init_para *
init_para->fb_height[0]= value;
//fb1
init_para->buffer_num[1]= 2;
init_para->buffer_num[1]= 1;
if (of_property_read_u32(np, "fb1_format", &value) < 0) {
__wrn("of_property_read disp_init.fb1_format fail\n");
@ -449,7 +449,7 @@ static s32 parser_disp_init_para(const struct device_node *np, disp_init_para *
init_para->fb_height[1]= value;
//fb2
init_para->buffer_num[2]= 2;
init_para->buffer_num[2]= 1;
if (of_property_read_u32(np, "fb2_format", &value) < 0) {
__inf("of_property_read disp_init.fb2_format fail\n");
@ -587,7 +587,10 @@ static void start_work(struct work_struct *work)
__inf("sel=%d, output_type=%d, lcd_reg=%d, hdmi_reg=%d\n",
screen_id, output_type, lcd_registered, hdmi_registered);
if (((disp_mode == DISP_INIT_MODE_SCREEN0) && (screen_id == 0))
|| ((disp_mode == DISP_INIT_MODE_SCREEN1) && (screen_id == 1))) {
|| ((disp_mode == DISP_INIT_MODE_SCREEN1) && (screen_id == 1))
|| ((disp_mode == DISP_INIT_MODE_TWO_DIFF_SCREEN || disp_mode == DISP_INIT_MODE_TWO_SAME_SCREEN)
&& (screen_id == 0 || screen_id == 1)))
{
if ((output_type == DISP_OUTPUT_TYPE_LCD)) {
if (lcd_registered && bsp_disp_get_output_type(screen_id) != DISP_OUTPUT_TYPE_LCD) {
bsp_disp_device_switch(screen_id, output_type, output_mode);

@ -1224,10 +1224,36 @@ s32 fb_init(struct platform_device *pdev)
if (g_disp_drv.disp_init.b_init) {
u32 fb_num = 0;
u32 disp_mode = g_disp_drv.disp_init.disp_mode;
switch (disp_mode) {
case DISP_INIT_MODE_TWO_DIFF_SCREEN:
fb_num = 2;
break;
case DISP_INIT_MODE_SCREEN0:
case DISP_INIT_MODE_SCREEN1:
case DISP_INIT_MODE_TWO_SAME_SCREEN:
case DISP_INIT_MODE_TWO_DIFF_SCREEN_SAME_CONTENTS:
default:
fb_num = 1;
break;
}
fb_num = 1;
for (i = 0; i<fb_num; i++) {
u32 screen_id = g_disp_drv.disp_init.disp_mode;
u32 screen_id = 0;
switch (disp_mode) {
case DISP_INIT_MODE_SCREEN0:
case DISP_INIT_MODE_TWO_SAME_SCREEN:
case DISP_INIT_MODE_TWO_DIFF_SCREEN_SAME_CONTENTS:
screen_id = 0;
break;
case DISP_INIT_MODE_SCREEN1:
screen_id = 1;
break;
case DISP_INIT_MODE_TWO_DIFF_SCREEN:
screen_id = i;
break;
}
if (g_disp_drv.para.boot_info.sync) {
screen_id = g_disp_drv.para.boot_info.disp;
@ -1248,7 +1274,18 @@ s32 fb_init(struct platform_device *pdev)
g_disp_drv.disp_init.output_type[screen_id], g_disp_drv.disp_init.output_mode[screen_id]);
fb_para.output_height = bsp_disp_get_screen_height_from_output_type(screen_id,
g_disp_drv.disp_init.output_type[screen_id], g_disp_drv.disp_init.output_mode[screen_id]);
fb_para.fb_mode = screen_id;
switch (disp_mode) {
case DISP_INIT_MODE_TWO_SAME_SCREEN:
fb_para.fb_mode = FB_MODE_DUAL_SAME_SCREEN_TB;
break;
case DISP_INIT_MODE_TWO_DIFF_SCREEN_SAME_CONTENTS:
fb_para.fb_mode = FB_MODE_DUAL_DIFF_SCREEN_SAME_CONTENTS;
break;
default:
fb_para.fb_mode = screen_id;
break;
}
display_fb_request(i, &fb_para);
#if defined(CONFIG_DISP2_SUNXI_BOOT_COLORBAR)

@ -1,7 +1,7 @@
# LCD(eDP)<->HDMI video switcher for Teres-I laptop
Script and DTB files that allow to switch video output medium
from LCD(1366x768) to HDMI(1280x720) and the other way around.
from LCD(1366x768) to Dual display mode LCD(1366x768)+HDMI(1920x1080) and the other way around.
**WARNING! You need cable with mini HDMI connector to connect your monitor or TV
(THE MINI HDMI CONNECTOR IS DIFFERENT FROM THE REGULAR HDMI CONNECTOR)**
@ -16,15 +16,13 @@ How to install?
0. Download the files from this repository.
1. Copy a64-olinuxino-hdmi.dtb and a64-olinuxino-lcd.dtb in /boot/a64/ directory,
where the default a64-olinuxino.dtb file is located. The command should be:
1. Copy files opt/teres... to /opt/teres recoursive. The command should be:
```
# sudo cp _path_to_file/a64-olinuxino-hdmi.dtb /boot/a64/
# sudo cp _path_to_file/a64-olinuxino-lcd.dtb /boot/a64/
# sudo cp _path_to_file/teres /opt/teres -R
```
2. copy change-display in /usr/sbin directory
```
# sudo cp path_to_file/change-display /usr/sbin
# sudo cp path_to_file/change-display /usr/local/sbin
```
3. Start the script change-display with
```
@ -38,19 +36,9 @@ and follow the on-screen instructions.
1. Can I have HDMI and LCD working at the same time?
A: It might be possible but we couldn't get it working. If you manage to do it,
please share what you did so we can update this guide, we would test and publish it.
A: Yes.
2. I changed the video output to HDMI but I don't have a cable with fitting mini HDMI
connector nor HDMI minotor? What now?
A: Either find a cable with fitting connector and HDMI monitor or re-write
the official image to a micro SD card and transfer it to the eMMC. Refer to
chapter 10 of the user's manual "10. Installing a fresh official image to TERES-I".
3. Does this work when I boot from the eMMC (e.g. I don't boot from a card)???
2. Does this work when I boot from the eMMC (e.g. I don't boot from a card)???
A: Yes.
First experimental release.

@ -20,8 +20,8 @@ mount $boot_device /boot
choices=$(dialog \
--title "Configure display output" \
--menu "\nChoose an option: \n" 10 60 7 \
1 "Enable HDMI display output" \
2 "Enable LCD display output" \
1 "Enable LCD+HDMI display outputs" \
2 "Disable HDMI display output" \
2>&1 >/dev/tty)
[[ -z $choices ]] && exit 0
@ -30,14 +30,18 @@ do
case $choice in
1)
[[ -e /boot/a64/a64-olinuxino-hdmi.dtb ]] && \
cp -f /boot/a64/a64-olinuxino-hdmi.dtb /boot/a64/a64-olinuxino.dtb
cp -f /opt/teres/hdmi/a64-olinuxino.dtb /boot/a64/a64-olinuxino.dtb
! grep -q "hdmi" /etc/modules && echo "hdmi" >> /etc/modules
rm /etc/X11/xorg.conf.d/*
cp /opt/teres/hdmi/xorg/* /etc/X11/xorg.conf.d
;;
2)
[[ -e /boot/a64/a64-olinuxino-lcd.dtb ]] && \
cp -f /boot/a64/a64-olinuxino-lcd.dtb /boot/a64/a64-olinuxino.dtb
cp -f /opt/teres/lcd/a64-olinuxino.dtb /boot/a64/a64-olinuxino.dtb
sed -i '/hdmi/d' /etc/modules
rm /etc/X11/xorg.conf.d/*
cp /opt/teres/lcd/xorg/* /etc/X11/xorg.conf.d
;;
esac
done

@ -0,0 +1,21 @@
Section "Device"
Identifier "TERES-LCD"
Driver "fbturbo"
Option "fbdev" "/dev/fb0"
Option "SwapbuffersWait" "true"
EndSection
Section "Monitor"
Identifier "LCD-TERES"
EndSection
Section "Screen"
Identifier "LCD"
Device "TERES-LCD"
Monitor "LCD-TERES"
Option "Primary" "true"
SubSection "Display"
Modes "1366x768"
ViewPort 0 0
Virtual 1366 768
EndSubSection
EndSection

@ -0,0 +1,19 @@
Section "Device"
Identifier "TERES-HDMI"
Driver "fbturbo"
Option "fbdev" "/dev/fb1"
Option "SwapbuffersWait" "true"
EndSection
Section "Monitor"
Identifier "HDMI-TERES"
EndSection
Section "Screen"
Identifier "HDMI"
Device "TERES-HDMI"
Monitor "HDMI-TERES"
SubSection "Display"
Modes "1920x1080"
ViewPort 0 1
Virtual 1920 1080
EndSubSection
EndSection

@ -0,0 +1,7 @@
Section "ServerLayout"
Identifier "MultyDisplay"
Screen 0 "LCD"
Screen 1 "HDMI" RightOf "LCD"
Option "Xinerama" "on"
# Option "Clone" "off"
EndSection

@ -0,0 +1,21 @@
Section "Device"
Identifier "TERES-LCD"
Driver "fbturbo"
Option "fbdev" "/dev/fb0"
Option "SwapbuffersWait" "true"
EndSection
Section "Monitor"
Identifier "LCD-TERES"
EndSection
Section "Screen"
Identifier "LCD"
Device "TERES-LCD"
Monitor "LCD-TERES"
Option "Primary" "true"
SubSection "Display"
Modes "1366x768"
ViewPort 0 0
Virtual 1366 768
EndSubSection
EndSection

@ -0,0 +1,4 @@
Section "ServerLayout"
Identifier "SingleDisplay"
Screen 0 "LCD"
EndSection