Skip to content

Commit 62836e3

Browse files
committed
Auto display switching works on HDMI0/1, DSI. Need to create patch.
dual switching Fix type in kernelconfig7l Set max_framebuffers=2 Add con2fbmap components
1 parent 0fd9121 commit 62836e3

17 files changed

+196
-8
lines changed

README.md

+6
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,12 @@ Please note that in some cases it may extract the files into a folder, if this i
4343

4444
## Change History
4545

46+
### V3.5.2
47+
48+
- **KERNEL** - Fix issue with PI4 8GB models
49+
- **Translations** - Update it translations
50+
- **HDMI** - Automatic switching between HDMI0 and HDMI1
51+
4652
### V3.5
4753

4854
- **KERNEL** - Bump firmware & kernel as NOOBS 3.5 for CM4

README_PINN.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
The latest version of [PINN](http://downloads.sourceforge.net/projects/pinn/pinn-lite.zip) can be downloaded from [sourceforge](http://www.sourceforge.net/projects/pinn).
77

8-
This README relates to v3.5
8+
This README relates to v3.5.2
99

1010
<sup>(PINN-lite does not include any operating systems at all. It is more akin to `NOOBS-lite` rather than `NOOBS`. For that reason, the filename that you download is called `pinn-lite.zip`. More recently, `pinn.zip` has also been made available for download which includes versions of Raspbian and LibreELEC.)</sup>
1111

@@ -345,6 +345,9 @@ Two editors are available in the recovery shell: vi and nano. Only the Tiny vers
345345
### How to change display output modes
346346

347347
By default, PINN will output over HDMI at your display’s preferred resolution, even if no HDMI display is connected. If you do not see any output on your HDMI display or are using the composite output, press 1, 2, 3 or 4 on your keyboard to select HDMI preferred mode (1), HDMI safe mode (2), composite PAL mode (3), or composite NTSC mode (4), respectively.
348+
(Note that Composite mode is no longer available by default on the PI4 model)
349+
350+
From v3.5.2, PINN can automatically detect which of the 2 HDMI ports are connected and switch to using the correct one. If both are connected, it will ue HDMI 0. If the DSI touchscreen is attached, this will take precedence over the 2 HDMI ports.
348351

349352
If you don't have a keyboard, you can still change the display mode used by PINN through editing the `recovery.cmdline` file in the root PINN directory prior to first boot and appending the following argument:
350353
- `display=<display mode number>` (e.g. `display=1` or `display=3`)

buildroot/.config

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#
22
# Automatically generated file; DO NOT EDIT.
3-
# Buildroot 2015.02-git-00125-g50a736e Configuration
3+
# Buildroot 2015.02-git-00001-g354d4c8-dirty Configuration
44
#
55
BR2_HAVE_DOT_CONFIG=y
66

@@ -347,6 +347,7 @@ BR2_PACKAGE_RECOVERY=y
347347
BR2_PACKAGE_REBOOTP=y
348348
BR2_PACKAGE_RPI_WIFI_FIRMWARE=y
349349
BR2_PACKAGE_PIGZ=y
350+
BR2_PACKAGE_CON2FBMAP=y
350351

351352
#
352353
# Audio and video applications

buildroot/kernelconfig-recovery.armv7l

+1-1
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ CONFIG_USB=y
191191
CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
192192
CONFIG_USB_XHCI_HCD=y
193193
CONFIG_USB_XHCI_PLATFORM=y
194-
CONFIG_USB_EHCI_HCD=y
194+
# CONFIG_USB_EHCI_HCDis not set
195195
CONFIG_USB_DWCOTG=y
196196
CONFIG_USB_STORAGE=y
197197
CONFIG_USB_UAS=y

buildroot/package/Config.in

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ menu "Target packages"
88
source "package/rebootp/Config.in"
99
source "package/rpi-wifi-firmware/Config.in"
1010
source "package/pigz/Config.in"
11+
source "package/con2fbmap/Config.in"
1112

1213
menu "Audio and video applications"
1314
source "package/alsa-utils/Config.in"

buildroot/package/con2fbmap/Config.in

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
config BR2_PACKAGE_CON2FBMAP
2+
bool "con2fbmap"
3+
### build dependencies
4+
### runtime dependencies
5+
help
6+
Change tty console to a different framebuffer device /dev/fbX
7+
+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#############################################################
2+
#
3+
# con2fbmap system
4+
#
5+
#############################################################
6+
7+
8+
CON2FBMAP_VERSION = 1.0
9+
CON2FBMAP_SITE = $(TOPDIR)/../con2fbmap
10+
CON2FBMAP_SITE_METHOD = local
11+
CON2FBMAP_LICENSE = BSD-3c
12+
CON2FBMAP_LICENSE_FILES = LICENSE.txt
13+
CON2FBMAP_INSTALL_STAGING = NO
14+
15+
define CON2FBMAP_BUILD_CMDS
16+
cd $(@D)
17+
$(MAKE) -C $(@D) all
18+
$(TARGET_STRIP) $(@D)/con2fbmap
19+
endef
20+
21+
define CON2FBMAP_INSTALL_TARGET_CMDS
22+
$(INSTALL) -m 0755 $(@D)/con2fbmap $(TARGET_DIR)/usr/bin/con2fbmap
23+
endef
24+
25+
$(eval $(generic-package))

buildroot/package/recovery/init

+30-3
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111
/bin/hostname -F /etc/hostname
1212
/bin/mount -t tmpfs tmpfs /tmp
1313

14-
export PS1="\u@\h:\w#"
15-
1614
#modprobe 8188eu
1715
modprobe 8192cu
1816

@@ -35,6 +33,32 @@ echo 2 >/sys/module/vt/parameters/cur_default
3533
/sbin/getty -L tty3 0 vt100 &
3634
/sbin/getty -L ttyAMA0 115200 vt100 &
3735

36+
export QWS_DISPLAY="LinuxFb"
37+
38+
present=`tvservice -l | sed -n -e 's|^Display Number \(.*\),.*$|\1| p'`
39+
for dev in $present; do
40+
fitted=`tvservice -n -v $dev 2>/dev/null`
41+
if [[ "$fitted" != "" ]]; then
42+
case $dev in
43+
0) #7in touchscreen
44+
export QWS_DISPLAY="LinuxFb:size=800x480:depth=32:0"
45+
break;
46+
;;
47+
2) #normal HDMI0
48+
export QWS_DISPLAY="LinuxFb:/dev/fb0"
49+
break;
50+
;;
51+
7) #Secondary HDMI1
52+
export QWS_DISPLAY="LinuxFb:/dev/fb1"
53+
/usr/bin/con2fbmap 2 1
54+
/usr/bin/con2fbmap 3 1
55+
break;
56+
;;
57+
esac
58+
fi
59+
done
60+
61+
3862
# Enable syslog
3963
/etc/init.d/S01logging start > /dev/null
4064

@@ -45,7 +69,7 @@ fi
4569

4670
if grep -q vncshare /proc/cmdline; then
4771
#VNC server AND framebuffer for screen sharing
48-
export QWS_DISPLAY="VNC:LinuxFB:size=800x480:depth=32:0"
72+
export QWS_DISPLAY="VNC:"$QWS_DISPLAY
4973
fi
5074

5175
if grep -q ssh /proc/cmdline; then
@@ -56,6 +80,9 @@ if grep -q ssh /proc/cmdline; then
5680
fi
5781

5882

83+
84+
85+
5986
# Mouse acceleration
6087
#export QWS_MOUSE_PROTO=:accel=1
6188

File renamed without changes.

buildroot/package/recovery/recovery.mk

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ define RECOVERY_INSTALL_TARGET_CMDS
4242
mkdir -p $(TARGET_DIR)/settings $(TARGET_DIR)/mnt2 $(TARGET_DIR)/mnt/os $(TARGET_DIR)/boot
4343
# allow mount to automatically mount ntfs drives
4444
(cd $(TARGET_DIR)/sbin; ln -sf mount.ntfs-3g mount.ntfs)
45-
$(INSTALL) -m 0755 package/recovery/.profile $(TARGET_DIR)/root/.profile
45+
$(INSTALL) -m 0755 package/recovery/profile $(TARGET_DIR)/root/.profile
4646
endef
4747

4848
$(eval $(generic-package))

buildroot/package/rpi-firmware/config.txt

+1
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ fixup_file=fixup_rc.dat
55
[pi4]
66
start_file=recover4.elf
77
fixup_file=fixup4rc.dat
8+
max_framebuffers=2

changes.md

+6
Original file line numberDiff line numberDiff line change
@@ -599,4 +599,10 @@ Fixes the incorrect recovery.cmdline bug in v2.5.2.
599599
- **Clarify** - Clarify text between replace & reinstall
600600
- **Logs** - Add Show Log in Fix up menu
601601

602+
### V3.5.2
603+
604+
- **KERNEL** - Fix issue with PI4 8GB models
605+
- **Translations** - Update it translations
606+
- **HDMI** - Automatic switching between HDMI0 and HDMI1
607+
602608

con2fbmap/Makefile

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
CC=$(PWD)/output/host/usr/bin/arm-buildroot-linux-uclibcgnueabi-gcc
2+
3+
all: con2fbmap
4+
$(MAKE) $(AM_MAKEFLAGS) con2fbmap
5+
6+
con2fbmap: con2fbmap.c
7+
$(CC) -static con2fbmap.c -o con2fbmap
8+
9+
10+

con2fbmap/con2fbmap.1

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
.TH con2fbmap 1 2006-01-18 2.1 "Linux frame buffer utils"
2+
.SH NAME
3+
con2fbmap \- shows and sets mapping between consoles and framebuffer devices.
4+
.SH SYNOPSIS
5+
.B con2fbmap
6+
.RI console
7+
.RI [ framebuffer ]
8+
.SH DESCRIPTION
9+
.B This documentation is not finished
10+
.PP
11+
.B con2fbmap
12+
is a system utility to show or change the mapping of the consoles to the
13+
frame buffer device. The frame buffer device provides a simple and unique
14+
interface to access different kinds of graphic displays.
15+
.PP
16+
Frame buffer devices are accessed via special device nodes located in the
17+
/dev directory. The naming scheme for these nodes is always
18+
.IR \fBfb < n >,
19+
where
20+
.I n
21+
is the number of the used frame buffer device.
22+
.PP
23+
.SH OPTIONS
24+
The first option must be there, and identify the console on which to work.
25+
If the second option is not set, con2fbmap shows the current mapping of
26+
identified console. If the second argument is given (as a number) con2fbmap
27+
maps the identified console to said framebuffer device.
28+
.TP
29+
Sven LUTHER <[email protected]>

con2fbmap/con2fbmap.c

+66
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
#include <stdio.h>
2+
#include <stdlib.h>
3+
#include <unistd.h>
4+
#include <fcntl.h>
5+
#include <errno.h>
6+
#include <string.h>
7+
#include <sys/ioctl.h>
8+
#include <sys/types.h>
9+
#include <sys/stat.h>
10+
#include <linux/fb.h>
11+
12+
#define DEFAULT_FRAMEBUFFER "/dev/fb0"
13+
#define DEFAULT_FRAMEBUFFER_DEVFS "/dev/fb/0"
14+
15+
const char *programname;
16+
17+
void Usage(void)
18+
{
19+
fprintf(stderr, "\nUsage: %s console [framebuffer]\n\n", programname);
20+
exit(1);
21+
}
22+
23+
int main(int argc, char *argv[])
24+
{
25+
int do_write = 0;
26+
char *fbpath; /* any frame buffer will do */
27+
int fd;
28+
struct fb_con2fbmap map;
29+
30+
programname = argv[0];
31+
switch (argc) {
32+
case 3:
33+
do_write = 1;
34+
map.framebuffer = atoi(argv[2]);
35+
case 2:
36+
map.console = atoi(argv[1]);
37+
break;
38+
default:
39+
Usage();
40+
}
41+
42+
if (access("/dev/.devfsd", F_OK) == 0) /* devfs detected */
43+
fbpath = DEFAULT_FRAMEBUFFER_DEVFS;
44+
else
45+
fbpath = DEFAULT_FRAMEBUFFER;
46+
47+
if ((fd = open(fbpath, O_RDONLY)) == -1) {
48+
fprintf(stderr, "open %s: %s\n", fbpath, strerror(errno));
49+
exit(1);
50+
}
51+
if (do_write) {
52+
if (ioctl(fd, FBIOPUT_CON2FBMAP, &map)) {
53+
fprintf(stderr, "ioctl FBIOPUT_CON2FBMAP: %s\n", strerror(errno));
54+
exit(1);
55+
}
56+
} else {
57+
if (ioctl(fd, FBIOGET_CON2FBMAP, &map)) {
58+
fprintf(stderr, "ioctl FBIOGET_CON2FBMAP: %s\n", strerror(errno));
59+
exit(1);
60+
}
61+
printf("console %d is mapped to framebuffer %d\n", map.console,
62+
map.framebuffer);
63+
}
64+
close(fd);
65+
exit(0);
66+
}

history.md

+6
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ PINN is a version of the NOOBS Operating System Installer for the Raspberry Pi w
55

66
## Change History
77

8+
### V3.5.2
9+
10+
- **KERNEL** - Fix issue with PI4 8GB models
11+
- **Translations** - Update it translations
12+
- **HDMI** - Automatic switching between HDMI0 and HDMI1
13+
814
### V3.5
915

1016
- **KERNEL** - Bump firmware & kernel as NOOBS 3.5 for CM4

recovery/config.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#define CONFIG_H
33

44
/* Version number displayed in the title bar */
5-
#define VERSION_NUMBER "3.5.1"
5+
#define VERSION_NUMBER "3.5.2"
66

77
/* Color of the background */
88
// #define BACKGROUND_COLOR Qt::white

0 commit comments

Comments
 (0)