-
Notifications
You must be signed in to change notification settings - Fork 125
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
- Loading branch information
Showing
17 changed files
with
196 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,3 +5,4 @@ fixup_file=fixup_rc.dat | |
[pi4] | ||
start_file=recover4.elf | ||
fixup_file=fixup4rc.dat | ||
max_framebuffers=2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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]> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters