Sfoglia il codice sorgente

BUILD 624
-fw_printenv /fw_setenv
- fbvncserver eventhandling angepassen, rotation aus kernel cmdline beachten
- SDL 1 library blit32 für fbdev eingefürt

Reinhard Russinger 6 anni fa
parent
commit
46a063d817

+ 1 - 1
board/GfA/Display001/BUILD

@@ -1 +1 @@
-623
+624

BIN
board/GfA/Display001/rootfs/usr/sbin/fbvncserver


+ 1 - 0
configs/Display001_4.4.104_rt21_Qt5.7_defconfig

@@ -231,6 +231,7 @@ BR2_PACKAGE_TI_GFX=y
 BR2_PACKAGE_TI_GFX_EGLIMAGE=y
 BR2_PACKAGE_TI_GFX_ES8=y
 BR2_PACKAGE_TI_UTILS=y
+BR2_PACKAGE_UBOOT_TOOLS=y
 BR2_PACKAGE_USB_MODESWITCH_DATA=y
 BR2_PACKAGE_USBMOUNT=y
 BR2_PACKAGE_USBUTILS=y

+ 166 - 0
patches/0008-SDL-add-NOKBD-blit32.patch

@@ -0,0 +1,166 @@
+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;

+ 73 - 0
patches/0009-uboot-tools-add-GfA-env.patch

@@ -0,0 +1,73 @@
+diff --git a/package/uboot-tools/0004-Add-GfA-Default-Environment.patch b/package/uboot-tools/0004-Add-GfA-Default-Environment.patch
+new file mode 100644
+index 0000000..e09b7bb
+--- /dev/null
++++ b/package/uboot-tools/0004-Add-GfA-Default-Environment.patch
+@@ -0,0 +1,67 @@
++diff --git a/tools/env/fw_env.h b/tools/env/fw_env.h
++index cd9c567..e75e711 100644
++--- a/tools/env/fw_env.h
+++++ b/tools/env/fw_env.h
++@@ -35,16 +35,60 @@
++ #endif
++ 
++ #ifndef CONFIG_BOOTDELAY
++-#define CONFIG_BOOTDELAY	5	/* autoboot after 5 seconds	*/
+++#define CONFIG_BOOTDELAY	1	/* autoboot after 5 seconds	*/
++ #endif
++ 
++-#ifndef CONFIG_BOOTCOMMAND
+++/*#ifndef CONFIG_BOOTCOMMAND
++ #define CONFIG_BOOTCOMMAND							\
++ 	"bootp; "								\
++ 	"setenv bootargs root=/dev/nfs nfsroot=${serverip}:${rootpath} "	\
++ 	"ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}::off; "	\
++ 	"bootm"
++ #endif
+++*/
+++
+++#ifndef CONFIG_EXTRA_ENV_SETTINGS 
+++#define CONFIG_EXTRA_ENV_SETTINGS \
+++        "ramboot=fatload mmc 0 0x80200000 uImage; " \
+++                "fatload mmc 0 0x80F00000 Display001.dtb; " \
+++                "fdt addr 0x80F00000; " \
+++                "fatload mmc 0 0x81000000 initrd.gz; " \
+++                "setenv initrdsize 0x${filesize}; " \   
+++                "setenv bootargs console=ttyO0,115200 initrd=0x81000000,${initrdsize} " \
+++                        "root=/dev/ram0 rw init=/sbin/init debug initcall_debug earlyprintk; " \
+++                "bootm 0x80200000 - 0x80F00000\0" \
+++        "sdboot=fatload mmc 0 0x80200000 uImage; " \
+++                "fatload mmc 0 0x80F00000 Display001.dtb; " \
+++                "fdt addr 0x80F00000; " \
+++                "setenv bootargs console=ttyO0,115200 " \
+++                        "root=/dev/mmcblk0p2 rw rootwait vram=50M cma=50M; " \
+++                "bootm 0x80200000 - 0x80F00000\0" \
+++        "emmcboot=fatload mmc 1 0x80200000 uImage; " \
+++                "fatload mmc 1 0x80F00000 Display001.dtb; " \
+++                "fdt addr 0x80F00000; " \
+++                "setenv bootargs console=ttyO0,115200 " \
+++                        "root=/dev/mmcblk1p2 rw rootwait vram=50M cma=50M; " \
+++                "bootm 0x80200000 - 0x80F00000\0" \
+++        "bootcmd=mw.l 0x80020000 0x0040033c; " \
+++                "if cmp 0x80020000 0x44e10040 1; " \
+++                "then " \
+++                  "echo ---emmc--; " \
+++                  "mmc rescan; " \
+++                  "if fatload mmc 0:1 0x80200000 MLO; then " \
+++                    "run sdboot; " \
+++                  "else " \
+++                    "run emmcboot; " \
+++                  "fi; " \
+++                "else echo --sd--; " \
+++                  "mmc rescan; " \
+++                  "if fatload mmc 0:1 0x80200000 MLO; then " \
+++                    "run sdboot; " \
+++                  "else " \
+++                    "run emmcboot; " \
+++                  "fi; " \
+++                "fi;\0"
+++#endif
+++
++ 
++ struct env_opts {
++ #ifdef CONFIG_FILE