Skip to content

Commit

Permalink
Auto display switching works on HDMI0/1, DSI. Need to create patch.
Browse files Browse the repository at this point in the history
dual switching
Fix type in kernelconfig7l
Set max_framebuffers=2
Add con2fbmap components
  • Loading branch information
procount committed Nov 6, 2020
1 parent 0fd9121 commit 62836e3
Show file tree
Hide file tree
Showing 17 changed files with 196 additions and 8 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@ Please note that in some cases it may extract the files into a folder, if this i

## Change History

### V3.5.2

- **KERNEL** - Fix issue with PI4 8GB models
- **Translations** - Update it translations
- **HDMI** - Automatic switching between HDMI0 and HDMI1

### V3.5

- **KERNEL** - Bump firmware & kernel as NOOBS 3.5 for CM4
Expand Down
5 changes: 4 additions & 1 deletion README_PINN.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

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).

This README relates to v3.5
This README relates to v3.5.2

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

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

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.
(Note that Composite mode is no longer available by default on the PI4 model)

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.

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:
- `display=<display mode number>` (e.g. `display=1` or `display=3`)
Expand Down
3 changes: 2 additions & 1 deletion buildroot/.config
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#
# Automatically generated file; DO NOT EDIT.
# Buildroot 2015.02-git-00125-g50a736e Configuration
# Buildroot 2015.02-git-00001-g354d4c8-dirty Configuration
#
BR2_HAVE_DOT_CONFIG=y

Expand Down Expand Up @@ -347,6 +347,7 @@ BR2_PACKAGE_RECOVERY=y
BR2_PACKAGE_REBOOTP=y
BR2_PACKAGE_RPI_WIFI_FIRMWARE=y
BR2_PACKAGE_PIGZ=y
BR2_PACKAGE_CON2FBMAP=y

#
# Audio and video applications
Expand Down
2 changes: 1 addition & 1 deletion buildroot/kernelconfig-recovery.armv7l
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ CONFIG_USB=y
CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
CONFIG_USB_XHCI_HCD=y
CONFIG_USB_XHCI_PLATFORM=y
CONFIG_USB_EHCI_HCD=y
# CONFIG_USB_EHCI_HCDis not set
CONFIG_USB_DWCOTG=y
CONFIG_USB_STORAGE=y
CONFIG_USB_UAS=y
Expand Down
1 change: 1 addition & 0 deletions buildroot/package/Config.in
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ menu "Target packages"
source "package/rebootp/Config.in"
source "package/rpi-wifi-firmware/Config.in"
source "package/pigz/Config.in"
source "package/con2fbmap/Config.in"

menu "Audio and video applications"
source "package/alsa-utils/Config.in"
Expand Down
7 changes: 7 additions & 0 deletions buildroot/package/con2fbmap/Config.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
config BR2_PACKAGE_CON2FBMAP
bool "con2fbmap"
### build dependencies
### runtime dependencies
help
Change tty console to a different framebuffer device /dev/fbX

25 changes: 25 additions & 0 deletions buildroot/package/con2fbmap/con2fbmap.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#############################################################
#
# con2fbmap system
#
#############################################################


CON2FBMAP_VERSION = 1.0
CON2FBMAP_SITE = $(TOPDIR)/../con2fbmap
CON2FBMAP_SITE_METHOD = local
CON2FBMAP_LICENSE = BSD-3c
CON2FBMAP_LICENSE_FILES = LICENSE.txt
CON2FBMAP_INSTALL_STAGING = NO

define CON2FBMAP_BUILD_CMDS
cd $(@D)
$(MAKE) -C $(@D) all
$(TARGET_STRIP) $(@D)/con2fbmap
endef

define CON2FBMAP_INSTALL_TARGET_CMDS
$(INSTALL) -m 0755 $(@D)/con2fbmap $(TARGET_DIR)/usr/bin/con2fbmap
endef

$(eval $(generic-package))
33 changes: 30 additions & 3 deletions buildroot/package/recovery/init
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
/bin/hostname -F /etc/hostname
/bin/mount -t tmpfs tmpfs /tmp

export PS1="\u@\h:\w#"

#modprobe 8188eu
modprobe 8192cu

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

export QWS_DISPLAY="LinuxFb"

present=`tvservice -l | sed -n -e 's|^Display Number \(.*\),.*$|\1| p'`
for dev in $present; do
fitted=`tvservice -n -v $dev 2>/dev/null`
if [[ "$fitted" != "" ]]; then
case $dev in
0) #7in touchscreen
export QWS_DISPLAY="LinuxFb:size=800x480:depth=32:0"
break;
;;
2) #normal HDMI0
export QWS_DISPLAY="LinuxFb:/dev/fb0"
break;
;;
7) #Secondary HDMI1
export QWS_DISPLAY="LinuxFb:/dev/fb1"
/usr/bin/con2fbmap 2 1
/usr/bin/con2fbmap 3 1
break;
;;
esac
fi
done


# Enable syslog
/etc/init.d/S01logging start > /dev/null

Expand All @@ -45,7 +69,7 @@ fi

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

if grep -q ssh /proc/cmdline; then
Expand All @@ -56,6 +80,9 @@ if grep -q ssh /proc/cmdline; then
fi





# Mouse acceleration
#export QWS_MOUSE_PROTO=:accel=1

Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion buildroot/package/recovery/recovery.mk
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ define RECOVERY_INSTALL_TARGET_CMDS
mkdir -p $(TARGET_DIR)/settings $(TARGET_DIR)/mnt2 $(TARGET_DIR)/mnt/os $(TARGET_DIR)/boot
# allow mount to automatically mount ntfs drives
(cd $(TARGET_DIR)/sbin; ln -sf mount.ntfs-3g mount.ntfs)
$(INSTALL) -m 0755 package/recovery/.profile $(TARGET_DIR)/root/.profile
$(INSTALL) -m 0755 package/recovery/profile $(TARGET_DIR)/root/.profile
endef

$(eval $(generic-package))
1 change: 1 addition & 0 deletions buildroot/package/rpi-firmware/config.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ fixup_file=fixup_rc.dat
[pi4]
start_file=recover4.elf
fixup_file=fixup4rc.dat
max_framebuffers=2
6 changes: 6 additions & 0 deletions changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -599,4 +599,10 @@ Fixes the incorrect recovery.cmdline bug in v2.5.2.
- **Clarify** - Clarify text between replace & reinstall
- **Logs** - Add Show Log in Fix up menu

### V3.5.2

- **KERNEL** - Fix issue with PI4 8GB models
- **Translations** - Update it translations
- **HDMI** - Automatic switching between HDMI0 and HDMI1


10 changes: 10 additions & 0 deletions con2fbmap/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
CC=$(PWD)/output/host/usr/bin/arm-buildroot-linux-uclibcgnueabi-gcc

all: con2fbmap
$(MAKE) $(AM_MAKEFLAGS) con2fbmap

con2fbmap: con2fbmap.c
$(CC) -static con2fbmap.c -o con2fbmap



29 changes: 29 additions & 0 deletions con2fbmap/con2fbmap.1
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
.TH con2fbmap 1 2006-01-18 2.1 "Linux frame buffer utils"
.SH NAME
con2fbmap \- shows and sets mapping between consoles and framebuffer devices.
.SH SYNOPSIS
.B con2fbmap
.RI console
.RI [ framebuffer ]
.SH DESCRIPTION
.B This documentation is not finished
.PP
.B con2fbmap
is a system utility to show or change the mapping of the consoles to the
frame buffer device. The frame buffer device provides a simple and unique
interface to access different kinds of graphic displays.
.PP
Frame buffer devices are accessed via special device nodes located in the
/dev directory. The naming scheme for these nodes is always
.IR \fBfb < n >,
where
.I n
is the number of the used frame buffer device.
.PP
.SH OPTIONS
The first option must be there, and identify the console on which to work.
If the second option is not set, con2fbmap shows the current mapping of
identified console. If the second argument is given (as a number) con2fbmap
maps the identified console to said framebuffer device.
.TP
Sven LUTHER <[email protected]>
66 changes: 66 additions & 0 deletions con2fbmap/con2fbmap.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
#include <errno.h>
#include <string.h>
#include <sys/ioctl.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <linux/fb.h>

#define DEFAULT_FRAMEBUFFER "/dev/fb0"
#define DEFAULT_FRAMEBUFFER_DEVFS "/dev/fb/0"

const char *programname;

void Usage(void)
{
fprintf(stderr, "\nUsage: %s console [framebuffer]\n\n", programname);
exit(1);
}

int main(int argc, char *argv[])
{
int do_write = 0;
char *fbpath; /* any frame buffer will do */
int fd;
struct fb_con2fbmap map;

programname = argv[0];
switch (argc) {
case 3:
do_write = 1;
map.framebuffer = atoi(argv[2]);
case 2:
map.console = atoi(argv[1]);
break;
default:
Usage();
}

if (access("/dev/.devfsd", F_OK) == 0) /* devfs detected */
fbpath = DEFAULT_FRAMEBUFFER_DEVFS;
else
fbpath = DEFAULT_FRAMEBUFFER;

if ((fd = open(fbpath, O_RDONLY)) == -1) {
fprintf(stderr, "open %s: %s\n", fbpath, strerror(errno));
exit(1);
}
if (do_write) {
if (ioctl(fd, FBIOPUT_CON2FBMAP, &map)) {
fprintf(stderr, "ioctl FBIOPUT_CON2FBMAP: %s\n", strerror(errno));
exit(1);
}
} else {
if (ioctl(fd, FBIOGET_CON2FBMAP, &map)) {
fprintf(stderr, "ioctl FBIOGET_CON2FBMAP: %s\n", strerror(errno));
exit(1);
}
printf("console %d is mapped to framebuffer %d\n", map.console,
map.framebuffer);
}
close(fd);
exit(0);
}
6 changes: 6 additions & 0 deletions history.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ PINN is a version of the NOOBS Operating System Installer for the Raspberry Pi w

## Change History

### V3.5.2

- **KERNEL** - Fix issue with PI4 8GB models
- **Translations** - Update it translations
- **HDMI** - Automatic switching between HDMI0 and HDMI1

### V3.5

- **KERNEL** - Bump firmware & kernel as NOOBS 3.5 for CM4
Expand Down
2 changes: 1 addition & 1 deletion recovery/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#define CONFIG_H

/* Version number displayed in the title bar */
#define VERSION_NUMBER "3.5.1"
#define VERSION_NUMBER "3.5.2"

/* Color of the background */
// #define BACKGROUND_COLOR Qt::white
Expand Down

0 comments on commit 62836e3

Please sign in to comment.