diff --git a/SOFTWARE/A64-TERES/linux-a64/drivers/video/sunxi/disp2/disp/dev_disp.c b/SOFTWARE/A64-TERES/linux-a64/drivers/video/sunxi/disp2/disp/dev_disp.c index 55bed5a4..b86c57af 100755 --- a/SOFTWARE/A64-TERES/linux-a64/drivers/video/sunxi/disp2/disp/dev_disp.c +++ b/SOFTWARE/A64-TERES/linux-a64/drivers/video/sunxi/disp2/disp/dev_disp.c @@ -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); diff --git a/SOFTWARE/A64-TERES/linux-a64/drivers/video/sunxi/disp2/disp/dev_fb.c b/SOFTWARE/A64-TERES/linux-a64/drivers/video/sunxi/disp2/disp/dev_fb.c index 2fe1865c..26e8db5c 100755 --- a/SOFTWARE/A64-TERES/linux-a64/drivers/video/sunxi/disp2/disp/dev_fb.c +++ b/SOFTWARE/A64-TERES/linux-a64/drivers/video/sunxi/disp2/disp/dev_fb.c @@ -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; iHDMI 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. diff --git a/SOFTWARE/A64-TERES/teres1-lcd-hdmi-switch/change-display b/SOFTWARE/A64-TERES/teres1-lcd-hdmi-switch/change-display index da27ac63..569ceef3 100644 --- a/SOFTWARE/A64-TERES/teres1-lcd-hdmi-switch/change-display +++ b/SOFTWARE/A64-TERES/teres1-lcd-hdmi-switch/change-display @@ -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 diff --git a/SOFTWARE/A64-TERES/teres1-lcd-hdmi-switch/a64-olinuxino-hdmi.dtb b/SOFTWARE/A64-TERES/teres1-lcd-hdmi-switch/opt/teres/hdmi/a64-olinuxino.dtb similarity index 60% rename from SOFTWARE/A64-TERES/teres1-lcd-hdmi-switch/a64-olinuxino-hdmi.dtb rename to SOFTWARE/A64-TERES/teres1-lcd-hdmi-switch/opt/teres/hdmi/a64-olinuxino.dtb index 91040f73..0a0c4fc8 100644 Binary files a/SOFTWARE/A64-TERES/teres1-lcd-hdmi-switch/a64-olinuxino-hdmi.dtb and b/SOFTWARE/A64-TERES/teres1-lcd-hdmi-switch/opt/teres/hdmi/a64-olinuxino.dtb differ diff --git a/SOFTWARE/A64-TERES/teres1-lcd-hdmi-switch/opt/teres/hdmi/xorg/20-teres-lcd.conf b/SOFTWARE/A64-TERES/teres1-lcd-hdmi-switch/opt/teres/hdmi/xorg/20-teres-lcd.conf new file mode 100644 index 00000000..283ffc96 --- /dev/null +++ b/SOFTWARE/A64-TERES/teres1-lcd-hdmi-switch/opt/teres/hdmi/xorg/20-teres-lcd.conf @@ -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 + diff --git a/SOFTWARE/A64-TERES/teres1-lcd-hdmi-switch/opt/teres/hdmi/xorg/30-teres-hdmi.conf b/SOFTWARE/A64-TERES/teres1-lcd-hdmi-switch/opt/teres/hdmi/xorg/30-teres-hdmi.conf new file mode 100644 index 00000000..2051c579 --- /dev/null +++ b/SOFTWARE/A64-TERES/teres1-lcd-hdmi-switch/opt/teres/hdmi/xorg/30-teres-hdmi.conf @@ -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 diff --git a/SOFTWARE/A64-TERES/teres1-lcd-hdmi-switch/opt/teres/hdmi/xorg/99-teres-disp.conf b/SOFTWARE/A64-TERES/teres1-lcd-hdmi-switch/opt/teres/hdmi/xorg/99-teres-disp.conf new file mode 100644 index 00000000..491ceb8a --- /dev/null +++ b/SOFTWARE/A64-TERES/teres1-lcd-hdmi-switch/opt/teres/hdmi/xorg/99-teres-disp.conf @@ -0,0 +1,7 @@ +Section "ServerLayout" + Identifier "MultyDisplay" + Screen 0 "LCD" + Screen 1 "HDMI" RightOf "LCD" + Option "Xinerama" "on" +# Option "Clone" "off" +EndSection diff --git a/SOFTWARE/A64-TERES/teres1-lcd-hdmi-switch/a64-olinuxino-lcd.dtb b/SOFTWARE/A64-TERES/teres1-lcd-hdmi-switch/opt/teres/lcd/a64-olinuxino.dtb similarity index 100% rename from SOFTWARE/A64-TERES/teres1-lcd-hdmi-switch/a64-olinuxino-lcd.dtb rename to SOFTWARE/A64-TERES/teres1-lcd-hdmi-switch/opt/teres/lcd/a64-olinuxino.dtb diff --git a/SOFTWARE/A64-TERES/teres1-lcd-hdmi-switch/opt/teres/lcd/xorg/20-teres-lcd.conf b/SOFTWARE/A64-TERES/teres1-lcd-hdmi-switch/opt/teres/lcd/xorg/20-teres-lcd.conf new file mode 100644 index 00000000..283ffc96 --- /dev/null +++ b/SOFTWARE/A64-TERES/teres1-lcd-hdmi-switch/opt/teres/lcd/xorg/20-teres-lcd.conf @@ -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 + diff --git a/SOFTWARE/A64-TERES/teres1-lcd-hdmi-switch/opt/teres/lcd/xorg/99-teres-disp.conf b/SOFTWARE/A64-TERES/teres1-lcd-hdmi-switch/opt/teres/lcd/xorg/99-teres-disp.conf new file mode 100644 index 00000000..dbed02a8 --- /dev/null +++ b/SOFTWARE/A64-TERES/teres1-lcd-hdmi-switch/opt/teres/lcd/xorg/99-teres-disp.conf @@ -0,0 +1,4 @@ +Section "ServerLayout" + Identifier "SingleDisplay" + Screen 0 "LCD" +EndSection