summaryrefslogtreecommitdiff
path: root/package/fbv/fbv-1.0b-avr32.patch
blob: d56f6eb178683cb10f028523bd59788cfa9f230d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
diff -ur fbv-1.0b/configure fbv-1.0b-avr32/configure
--- fbv-1.0b/configure	2004-09-07 13:29:27.000000000 +0200
+++ fbv-1.0b-avr32/configure	2006-05-04 11:10:06.000000000 +0200
@@ -21,6 +21,7 @@
 unset png
 unset bmp
 unset dfb
+unset CC
 
 help(){
 cat << EOF >&2
@@ -33,6 +34,7 @@
 General:
   --help	print this message
   --libs=LIBS	additional libraries required (try -lX11 for ungif, -lz for PNG)
+  --cc=CC	specify compiler to use
   
 Directory and file names:
   --prefix=PREFIX	install files in PREFIX [/usr/local]
@@ -53,7 +55,7 @@
 --long help,\
 prefix:,srcdir:,bindir:,\
 infodir:,mandir:,\
-without-libungif,without-libjpeg,without-libpng,without-bmp,libs: \
+without-libungif,without-libjpeg,without-libpng,without-bmp,libs:,cc: \
 -n "$BASENAME" -- "$@")
 
 if [ $? != 0 ] ; then help ; exit 1 ; fi
@@ -65,6 +67,7 @@
 	case "$1" in
 		-h|--help) help ; exit 0 ;;
 		--libs) libs="$2"; shift 2 ;;
+		--cc) CC="$2"; shift 2 ;;
 		--prefix) prefix="$2" ; shift 2 ;;
 		--srcdir) srcdir="$2" ; shift 2 ;;
 		--bindir) bindir="$2" ; shift 2 ;;
@@ -80,6 +83,7 @@
 	esac
 done
 
+[ -z "$CC" ] && CC=cc
 [ -z "$prefix" ] && prefix="/usr/local"
 [ -z "$bindir" ] && bindir="${prefix}/bin"
 [ -z "$mandir" ] && mandir="${prefix}/man"
@@ -106,12 +110,12 @@
 ungif="no"
 echo "libungif check" >>./config.log
 echo "  1st:" >>./config.log
-cc 2>>./config.log >>./config.log -o \$\$~test \$\$~test.c -lungif $libs
+$CC 2>>./config.log >>./config.log -o \$\$~test \$\$~test.c -lungif $libs
 if [ -e \$\$~test ]; then
 	libs="-lungif $libs" ; ungif="yes"
 else
 	echo "  2nd: -lX11 -L$xdir/lib" >>./config.log
-	cc 2>>./config.log >>./config.log -o \$\$~test \$\$~test.c -lungif -lX11 -L$xdir/lib $libs
+	$CC 2>>./config.log >>./config.log -o \$\$~test \$\$~test.c -lungif -lX11 -L$xdir/lib $libs
 	if [ -e \$\$~test ]; then
 	libs="-lungif -lX11 -L$xdir/lib $libs" ; ungif="yes"
 	fi
@@ -124,7 +128,7 @@
 echo -n "checking for libjpeg presence... "
 if [ "$jpeg" != "disabled" ]; then
 jpeg="no"
-cc 2>>./config.log >>./config.log -o \$\$~test \$\$~test.c -ljpeg $libs
+$CC 2>>./config.log >>./config.log -o \$\$~test \$\$~test.c -ljpeg $libs
 if [ -e \$\$~test ]; then
 	libs="-ljpeg $libs" ; jpeg="yes"
 fi
@@ -135,7 +139,7 @@
 echo -n "checking for libpng presence... "
 if [ "$png" != "disabled" ]; then
 png="no"
-cc 2>>./config.log >>./config.log -o \$\$~test \$\$~test.c -lpng $libs
+$CC 2>>./config.log >>./config.log -o \$\$~test \$\$~test.c -lpng $libs
 if [ -e \$\$~test ]; then
 	libs="-lpng $libs" ; png="yes"
 fi
diff -ur fbv-1.0b/fb_display.c fbv-1.0b-avr32/fb_display.c
--- fbv-1.0b/fb_display.c	2004-09-07 14:09:43.000000000 +0200
+++ fbv-1.0b-avr32/fb_display.c	2006-05-04 13:30:25.000000000 +0200
@@ -18,8 +18,6 @@
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */
 
-#include <linux/fb.h>
-
 #include <stdio.h>
 #include <stdlib.h>
 #include <sys/types.h>
@@ -31,7 +29,9 @@
 #include <asm/types.h>
 #include <string.h>
 #include <errno.h>
+#include <linux/fb.h>
 #include "config.h"
+
 /* Public Use Functions:
  *
  * extern void fb_display(unsigned char *rgbbuff,
@@ -276,9 +276,6 @@
 	    for(i = 0; i < yc; i++, fbptr += scr_xs * cpp, imptr += pic_xs * cpp)
 			memcpy(fbptr, imptr, xc * cpp);
 		
-	if(cpp == 1)
-	    set8map(fh, &map_back);
-	
 	munmap(fb, scr_xs * scr_ys * cpp);
 }
 
@@ -293,17 +290,17 @@
 inline static unsigned short make15color(unsigned char r, unsigned char g, unsigned char b)
 {
     return (
-	(((r >> 3) & 31) << 10) |
+	(((r >> 3) & 31)) |
 	(((g >> 3) & 31) << 5)  |
-	 ((b >> 3) & 31)        );
+	 ((b >> 3) & 31) << 10);
 }
 
 inline static unsigned short make16color(unsigned char r, unsigned char g, unsigned char b)
 {
     return (
-	(((r >> 3) & 31) << 11) |
-	(((g >> 2) & 63) << 5)  |
-	 ((b >> 3) & 31)        );
+	(((r >> 3) & 31))      |
+	(((g >> 3) & 31) << 5) |
+	 ((b >> 3) & 31) << 10);
 }
 
 void* convertRGB2FB(int fh, unsigned char *rgbbuff, unsigned long count, int bpp, int *cpp)
@@ -342,9 +339,9 @@
 	    *cpp = 4;
 	    i_fbbuff = (unsigned int *) malloc(count * sizeof(unsigned int));
 	    for(i = 0; i < count ; i++)
-		i_fbbuff[i] = ((rgbbuff[i*3] << 16) & 0xFF0000) |
+		i_fbbuff[i] = ((rgbbuff[i*3+2] << 16) & 0xFF0000) |
 			    ((rgbbuff[i*3+1] << 8) & 0xFF00) |
-			    (rgbbuff[i*3+2] & 0xFF);
+			    (rgbbuff[i*3] & 0xFF);
 	    fbbuff = (void *) i_fbbuff;
 	    break;
 	default: