浏览代码

wrk with fbvnc and bistrosps working

Reinhard Russinger 3 年之前
父节点
当前提交
109f2a44dd

+ 1 - 1
board/PSG/iot2050/BUILD

@@ -1 +1 @@
-138
+143

+ 1 - 1
board/PSG/iot2050/boot.cmd

@@ -1,5 +1,5 @@
 env exists fdtfile || setenv fdtfile k3-am6528-iot2050-basic-oldfw.dtb
-setenv bootargs root=/dev/mmcblk0p1 rw console=ttyS3,115200n8 earlycon=ns16550a,mmio32,0x02810000 mtdparts=47040000.spi.0:512k(ospi.tiboot3),2m(ospi.tispl),4m(ospi.u-boot),128k(ospi.env),128k(ospi.env.backup),1m(ospi.sysfw),64k(pru0-fw),64k(pru1-fw),64k(rtu0-fw),64k(rtu1-fw),-@8m(ospi.rootfs) random.trust_cpu=on rootwait
+setenv bootargs root=/dev/mmcblk0p1 rw console=ttyS3,115200n8 earlycon=ns16550a,mmio32,0x02810000 mtdparts=47040000.spi.0:512k(ospi.tiboot3),2m(ospi.tispl),4m(ospi.u-boot),128k(ospi.env),128k(ospi.env.backup),1m(ospi.sysfw),64k(pru0-fw),64k(pru1-fw),64k(rtu0-fw),64k(rtu1-fw),-@8m(ospi.rootfs) random.trust_cpu=on consoleblank=0 rootwait
 echo Loading /boot/${fdtfile}...
 load ${devtype} ${devnum}:1 ${fdt_addr_r} /boot/${fdtfile}
 echo Loading /boot/Image...

+ 24 - 0
board/PSG/iot2050/rootfs/etc/init.d/S99fbvncserver

@@ -0,0 +1,24 @@
+#!/bin/sh
+#
+# Start fbvncserver
+#
+
+case "$1" in
+  start)
+        echo -e "Starting fbvncserevr ...\n"
+        fbvncserver -t /dev/input/event1 -k /dev/null -P /etc/vncpwd &
+        ;;
+  stop)
+        echo -e "Stopping fbvncserver ...\n"
+        killall fbvncserver
+        ;;
+  restart|reload)
+        "$0" stop
+        "$0" start
+        ;;
+  *)
+        echo "Usage: $0 {start|stop|restart}"
+        exit 1
+esac
+
+exit $?

二进制
board/PSG/iot2050/rootfs/usr/sbin/fbvncserver


+ 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_PACKAGE_SDL2_DIRECTFB=y
+BR2_PACKAGE_SDL2_KMSDRM=y
+BR2_PACKAGE_SDL2_OPENGLES=y
+BR2_PACKAGE_SDL2_GFX=y
+BR2_PACKAGE_SDL2_IMAGE=y
+BR2_PACKAGE_SDL2_MIXER=y
+BR2_PACKAGE_SDL2_NET=y
+BR2_PACKAGE_SDL2_TTF=y
 BR2_PACKAGE_QT5=y
 BR2_PACKAGE_QT5BASE_MYSQL=y
 BR2_PACKAGE_QT5BASE_SQLITE_SYSTEM=y
@@ -188,8 +216,6 @@ BR2_PACKAGE_SQLITE_NO_SYNC=y
 BR2_PACKAGE_LIBCONFIG=y
 BR2_PACKAGE_GD=y
 BR2_PACKAGE_LIBJPEG=y
-BR2_PACKAGE_LIBSVG=y
-BR2_PACKAGE_WEBP=y
 BR2_PACKAGE_WEBP_DEMUX=y
 BR2_PACKAGE_LIBFTDI=y
 BR2_PACKAGE_LIBGPIOD=y

+ 229 - 0
patches/0007-sdl-patches.patch

@@ -0,0 +1,229 @@
+diff --git a/package/sdl/0003-add-SDL_NOKBD.patch b/package/sdl/0003-add-SDL_NOKBD.patch
+new file mode 100644
+index 0000000..d944555
+--- /dev/null
++++ b/package/sdl/0003-add-SDL_NOKBD.patch
+@@ -0,0 +1,55 @@
++diff --git a/src/video/fbcon/SDL_fbvideo.c b/src/video/fbcon/SDL_fbvideo.c
++index 5e58809..81830b6 100644
++--- a/src/video/fbcon/SDL_fbvideo.c
+++++ b/src/video/fbcon/SDL_fbvideo.c
++@@ -793,9 +793,11 @@ static int FB_VideoInit(_THIS, SDL_PixelFormat *vformat)
++ 	}
++ 
++ 	/* Enable mouse and keyboard support */
++-	if ( FB_OpenKeyboard(this) < 0 ) {
++-		FB_VideoQuit(this);
++-		return(-1);
+++	if (!SDL_getenv("SDL_NOKBD")){
+++		if ( FB_OpenKeyboard(this) < 0 ) {
+++			FB_VideoQuit(this);
+++			return(-1);
+++			}
++ 	}
++ 	if ( FB_OpenMouse(this) < 0 ) {
++ 		const char *sdl_nomouse;
++@@ -944,7 +946,7 @@ static SDL_Surface *FB_SetVGA16Mode(_THIS, SDL_Surface *current,
++ 
++ 	/* Set the terminal into graphics mode */
++ 	if ( FB_EnterGraphicsMode(this) < 0 ) {
++-		return(NULL);
+++		if (!SDL_getenv("SDL_NOKBD")) return(NULL);
++ 	}
++ 
++ 	/* Restore the original palette */
++@@ -1009,7 +1011,7 @@ static SDL_Surface *FB_SetVideoMode(_THIS, SDL_Surface *current,
++ 
++ 	/* Set the terminal into graphics mode */
++ 	if ( FB_EnterGraphicsMode(this) < 0 ) {
++-		return(NULL);
+++		if (!SDL_getenv("SDL_NOKBD")) return(NULL);
++ 	}
++ 
++ 	/* Restore the original palette */
++@@ -1919,7 +1921,7 @@ static void FB_VideoQuit(_THIS)
++ 			SDL_memcpy(flip_address[0], flip_address[1], this->screen->pitch * this->screen->h);
++ 		}
++ 
++-		if ( !dontClearPixels && this->screen->pixels && FB_InGraphicsMode(this) ) {
+++		if ( (!dontClearPixels && this->screen->pixels && FB_InGraphicsMode(this)) || SDL_getenv("SDL_NOKBD") ) {
++ #if defined(__powerpc__) || defined(__ia64__)	/* SIGBUS when using SDL_memset() ?? */
++ 			Uint8 *rowp = (Uint8 *)this->screen->pixels;
++ 			int left = this->screen->pitch*this->screen->h;
++@@ -1968,7 +1970,7 @@ static void FB_VideoQuit(_THIS)
++ 		}
++ 
++ 		/* Restore the original video mode and palette */
++-		if ( FB_InGraphicsMode(this) ) {
+++		if ( FB_InGraphicsMode(this) || SDL_getenv("SDL_NOKBD") ) {
++ 			FB_RestorePalette(this);
++ 			ioctl(console_fd, FBIOPUT_VSCREENINFO, &saved_vinfo);
++ 		}
+diff --git a/package/sdl/0004-sdl-fbdev-blit32.patch b/package/sdl/0004-sdl-fbdev-blit32.patch
+new file mode 100644
+index 0000000..e06a57a
+--- /dev/null
++++ b/package/sdl/0004-sdl-fbdev-blit32.patch
+@@ -0,0 +1,99 @@
++diff --git a/src/video/fbcon/SDL_fbvideo.c b/src/video/fbcon/SDL_fbvideo.c
++index 81830b6..1399140 100644
++--- a/src/video/fbcon/SDL_fbvideo.c
+++++ b/src/video/fbcon/SDL_fbvideo.c
++@@ -165,6 +165,10 @@ static void FB_RestorePalette(_THIS);
++ static FB_bitBlit FB_blit16;
++ static FB_bitBlit FB_blit16blocked;
++ 
+++static FB_bitBlit FB_blit32;
+++static FB_bitBlit FB_blit32blocked;
+++
+++
++ static int SDL_getpagesize(void)
++ {
++ #ifdef HAVE_GETPAGESIZE
++@@ -1119,6 +1123,10 @@ static SDL_Surface *FB_SetVideoMode(_THIS, SDL_Surface *current,
++ 			blitFunc = (rotate == FBCON_ROTATE_NONE ||
++ 					rotate == FBCON_ROTATE_UD) ?
++ 				FB_blit16 : FB_blit16blocked;
+++		} else if (vinfo.bits_per_pixel == 32) {
+++			blitFunc = (rotate == FBCON_ROTATE_NONE ||
+++					rotate == FBCON_ROTATE_UD) ?
+++				FB_blit32 : FB_blit32blocked;
++ 		} else {
++ #ifdef FBCON_DEBUG
++ 			fprintf(stderr, "Init vinfo:\n");
++@@ -1495,6 +1503,57 @@ static void FB_blit16blocked(Uint8 *byte_src_pos, int src_right_delta, int src_d
++ 	}
++ }
++ 
+++static void FB_blit32(Uint8 *byte_src_pos, int src_right_delta, int src_down_delta,
+++		Uint8 *byte_dst_pos, int dst_linebytes, int width, int height)
+++{
+++	int w;
+++	Uint32 *src_pos = (Uint32 *)byte_src_pos;
+++	Uint32 *dst_pos = (Uint32 *)byte_dst_pos;
+++
+++	while (height) {
+++		Uint32 *src = src_pos;
+++		Uint32 *dst = dst_pos;
+++		for (w = width; w != 0; w--) {
+++			*dst = *src;
+++			src += src_right_delta;
+++			dst++;
+++		}
+++		dst_pos = (Uint32 *)((Uint8 *)dst_pos + dst_linebytes);
+++		src_pos += src_down_delta;
+++		height--;
+++	}
+++}
+++
+++#define BLOCKSIZE_W 32
+++#define BLOCKSIZE_H 32
+++
+++static void FB_blit32blocked(Uint8 *byte_src_pos, int src_right_delta, int src_down_delta, 
+++		Uint8 *byte_dst_pos, int dst_linebytes, int width, int height)
+++{
+++	int w;
+++	Uint32 *src_pos = (Uint32 *)byte_src_pos;
+++	Uint32 *dst_pos = (Uint32 *)byte_dst_pos;
+++
+++	while (height > 0) {
+++		Uint32 *src = src_pos;
+++		Uint32 *dst = dst_pos;
+++		for (w = width; w > 0; w -= BLOCKSIZE_W) {
+++			FB_blit32((Uint8 *)src,
+++					src_right_delta,
+++					src_down_delta,
+++					(Uint8 *)dst,
+++					dst_linebytes,
+++					min(w, BLOCKSIZE_W),
+++					min(height, BLOCKSIZE_H));
+++			src += src_right_delta * BLOCKSIZE_W;
+++			dst += BLOCKSIZE_W;
+++		}
+++		dst_pos = (Uint32 *)((Uint8 *)dst_pos + dst_linebytes * BLOCKSIZE_H);
+++		src_pos += src_down_delta * BLOCKSIZE_H;
+++		height -= BLOCKSIZE_H;
+++	}
+++}
+++
++ static void FB_DirectUpdate(_THIS, int numrects, SDL_Rect *rects)
++ {
++ 	int width = cache_vinfo.xres;
++@@ -1507,10 +1566,10 @@ static void FB_DirectUpdate(_THIS, int numrects, SDL_Rect *rects)
++ 		return;
++ 	}
++ 
++-	if (cache_vinfo.bits_per_pixel != 16) {
++-		SDL_SetError("Shadow copy only implemented for 16 bpp");
++-		return;
++-	}
+++//	if (cache_vinfo.bits_per_pixel != 16) {
+++//		SDL_SetError("Shadow copy only implemented for 16 bpp");
+++//		return;
+++//	}
++ 
++ 	for (i = 0; i < numrects; i++) {
++ 		int x1, y1, x2, y2;
+diff --git a/package/sdl/Config.in b/package/sdl/Config.in
+index 9f1e34d..65ac8a2 100644
+--- a/package/sdl/Config.in
++++ b/package/sdl/Config.in
+@@ -17,6 +17,10 @@ config BR2_PACKAGE_SDL_DIRECTFB
+ 	bool "SDL DirectFB video driver"
+ 	depends on BR2_PACKAGE_DIRECTFB
+ 
++config BR2_PACKAGE_SDL_QTOPIA
++	bool "SDL Qtopia video driver"
++	depends on BR2_PACKAGE_QT
++
+ config BR2_PACKAGE_SDL_X11
+ 	bool "SDL X11 video driver"
+ 	depends on BR2_PACKAGE_XORG7
+diff --git a/package/sdl/sdl.hash b/package/sdl/sdl.hash
+index 2c46975..ad59b90 100644
+--- a/package/sdl/sdl.hash
++++ b/package/sdl/sdl.hash
+@@ -1,4 +1,2 @@
+ # Locally calculated after checking pgp signature
+ sha256	d6d316a793e5e348155f0dd93b979798933fb98aa1edebcc108829d6474aad00	SDL-1.2.15.tar.gz
+-# Locally computed
+-sha256	bb117c0fbd7f57f64170b690285d7df07c2371b578e3b3cd3aa2e1155ef461a0	COPYING
+diff --git a/package/sdl/sdl.mk b/package/sdl/sdl.mk
+index 7389cd3..38b4b97 100644
+--- a/package/sdl/sdl.mk
++++ b/package/sdl/sdl.mk
+@@ -7,10 +7,8 @@
+ SDL_VERSION = 1.2.15
+ SDL_SOURCE = SDL-$(SDL_VERSION).tar.gz
+ SDL_SITE = http://www.libsdl.org/release
+-SDL_LICENSE = LGPL-2.1+
++SDL_LICENSE = LGPLv2.1+
+ SDL_LICENSE_FILES = COPYING
+-SDL_CPE_ID_VENDOR = libsdl
+-SDL_CPE_ID_PRODUCT = simple_directmedia_layer
+ SDL_INSTALL_STAGING = YES
+ 
+ # we're patching configure.in, but package cannot autoreconf with our version of
+@@ -25,8 +23,6 @@ HOST_SDL_PRE_CONFIGURE_HOOKS += SDL_RUN_AUTOGEN
+ SDL_DEPENDENCIES += host-automake host-autoconf host-libtool
+ HOST_SDL_DEPENDENCIES += host-automake host-autoconf host-libtool
+ 
+-SDL_CONF_OPTS += --enable-video-qtopia=no
+-
+ ifeq ($(BR2_PACKAGE_SDL_FBCON),y)
+ SDL_CONF_OPTS += --enable-video-fbcon=yes
+ else
+@@ -41,6 +37,13 @@ else
+ SDL_CONF_OPTS += --enable-video-directfb=no
+ endif
+ 
++ifeq ($(BR2_PACKAGE_SDL_QTOPIA),y)
++SDL_CONF_OPTS += --enable-video-qtopia=yes
++SDL_DEPENDENCIES += qt
++else
++SDL_CONF_OPTS += --enable-video-qtopia=no
++endif
++
+ ifeq ($(BR2_PACKAGE_SDL_X11),y)
+ SDL_CONF_OPTS += --enable-video-x11=yes
+ SDL_DEPENDENCIES += \