a. if you want to user framebuffer device on EM8622, you must modify some code.
systems/fbdev/fbdev.c line 467
dfb_fbdev->framebuffer_base = mmap( NULL, shared->fix.smem_len,
PROT_READ | PROT_WRITE, MAP_SHARED,
dfb_fbdev->fd, 0 );
==>
dfb_fbdev->framebuffer_base = mmap( NULL, shared->fix.smem_len,
PROT_READ | PROT_WRITE, 0,
dfb_fbdev->fd, 0 );

b. if you want to use support, you must modify some code.不然會發現游標都沒有出現.主要是因為 directFB 的游標是從外部檔案導入,而非內建在源碼內,又浪費我半天的時間。
src/core/windowstack.c line 72
#define CURSORFILE DATA_DIR "/cursor.dat"
==>
#define CURSORFILE "./cursor.dat"

1. pure build without any package.

CC=arm-elf-gcc CXX=arm-elf-g++ AR=arm-elf-ar RANLIB=arm-elf-ranlib LD=arm-elf-ld \
LDFLAGS=-Wl,-elf2flt="-s32768" \
./configure --target=arm-elf-linux --host=i686-pc-linux --disable-shared --enable-static --disable-sdl \
--enable-gif --disable-jpeg --disable-zlib --disable-png --disable-freetype --without-tools \
--enable-text --disable-x11 --disable-osx --disable-sysfs --disable-vnc --disable-video4linux \
--with-gfxdrivers=none --with-inputdrivers=none --prefix=/sigma

LD=arm-elf-ld make

2. add freetype support must include the follow.
FREETYPE_CFLAGS=-I/sigma/freetype-2.3.5/include \
FREETYPE_LIBS="-L/sigma/freetype-2.3.5/objs/.libs -lfreetype" \
--enable-freetype

3. add jpeg support must include the follow.
LDFLAGS="-L/sigma/jpeg-6b/.libs" \
CFLAGS="-I/sigma/jpeg-6b" \
--enable-jpeg

4. add png support must include the follow.
LDFLAGS="-L/sigma/libpng-1.2.23/.libs" \
CFLAGS="-I/sigma/libpng-1.2.23" \
--enable-png

5. add zlib support must include the follow.
LDFLAGS="-L/sigma/zlib-1.2.3" \
CFLAGS="-I/sigma/zlib-1.2.3" \
--enable-zlib

6. add mouse,kb,joystick support must include the follow.
--with-inputdrivers=linuxinput,joystick,keyboard,ps2mouse,serialmouse

7. full build command
CC=arm-elf-gcc CXX=arm-elf-g++ AR=arm-elf-ar RANLIB=arm-elf-ranlib LD=arm-elf-ld \
LDFLAGS="-L/sigma/jpeg-6b/.libs -L/sigma/libpng-1.2.23/.libs -L/sigma/zlib-1.2.3 -Wl,-elf2flt=-s32768" \
CFLAGS="-I/sigma/jpeg-6b -I/sigma/libpng-1.2.23 -I/sigma/zlib-1.2.3" \
FREETYPE_CFLAGS=-I/sigma/freetype-2.3.5/include \
FREETYPE_LIBS="-L/sigma/freetype-2.3.5/objs/.libs -lfreetype" \
./configure --target=arm-elf-linux --host=i686-pc-linux --disable-shared --enable-static --disable-sdl \
--enable-gif --enable-jpeg --enable-zlib --enable-png --enable-freetype --enable-text \
--disable-x11 --disable-osx --disable-sysfs --disable-vnc --disable-video4linux \
--disable-mmx --disable-sse --with-gfxdrivers=none --without-tools \
--with-inputdrivers=linuxinput,ps2mouse \
--prefix=/sigma

LD=arm-elf-ld make

8. build example
CC=arm-elf-gcc CXX=arm-elf-g++ AR=arm-elf-ar RANLIB=arm-elf-ranlib LD=arm-elf-ld \
LDFLAGS="-Wl,-elf2flt=-s32768" \
DIRECTFB_CFLAGS="-I/sigma/DirectFB-0.9.25.1/include -I/sigma/DirectFB-0.9.25.1/lib/ -D_REENTRANT" \
DIRECTFB_LIBS=" \
-static \
/sigma/DirectFB-0.9.25.1/wm/default/libdirectfbwm_default.o \
/sigma/DirectFB-0.9.25.1/systems/fbdev/libdirectfb_fbdev.o \
/sigma/DirectFB-0.9.25.1/interfaces/IDirectFBFont/libidirectfbfont_ft2.o \
/sigma/DirectFB-0.9.25.1/interfaces/IDirectFBImageProvider/libidirectfbimageprovider_jpeg.o \
/sigma/DirectFB-0.9.25.1/interfaces/IDirectFBImageProvider/libidirectfbimageprovider_gif.o \
/sigma/DirectFB-0.9.25.1/interfaces/IDirectFBImageProvider/libidirectfbimageprovider_png.o \
/sigma/DirectFB-0.9.25.1/inputdrivers/ps2mouse/libdirectfb_ps2mouse.o \
-ldirectfb -L/sigma/DirectFB-0.9.25.1/src/.libs \
-ldirect -L/sigma/DirectFB-0.9.25.1/lib/direct/.libs \
-lfusion -L/sigma/DirectFB-0.9.25.1/lib/fusion/.libs \
-lfreetype -L/sigma/freetype-2.3.5/objs/.libs \
-ljpeg -L/sigma/jpeg-6b/.libs \
-lpng -lz -lm -L/sigma/libpng-1.2.23/.libs \
-lz -L/sigma/zlib-1.2.3 \
-lpthread" \
./configure --target=arm-elf-linux --host=i686-pc-linux

make

9. build example note, modify src/Makefile.in(不要編輯 Makefile,configure 時會被 Makefile.in 替換掉)
a. df_neo 需要 sinf, cosf 等三角函數庫,先移除不要,uClibc 0.9.28 才有提供 sinf, cosf。
SUBDIRS = df_knuckles df_neo spacedream
b. 字型檔要先定義。
-DFONT=\"/mnt/hda/cwming.ttf\"
c. 圖檔路徑要先定義。
-DDATADIR=\"/mnt/hdb/DirectFB-examples-0.9.25/data\"

10. example configure note
a. 使用 directfb-config 查看所需參數,記得修改相對路徑。
/sigma/DirectFB-0.9.25.1/directfb-config --font=ft2 --libs --cflags --imageprovider=jpeg,gif,png
-I/sigma/include/directfb -D_REENTRANT
-static
/sigma/lib/directfb-0.9.25/systems/libdirectfb_fbdev.o
/sigma/lib/directfb-0.9.25/wm/libdirectfbwm_default.o
/sigma/lib/directfb-0.9.25/interfaces/IDirectFBFont/libidirectfbfont_ft2.o -lfreetype
/sigma/lib/directfb-0.9.25/interfaces/IDirectFBImageProvider/libidirectfbimageprovider_jpeg.o -ljpeg /sigma/lib/directfb-0.9.25/interfaces/IDirectFBImageProvider/libidirectfbimageprovider_gif.o /sigma/lib/directfb-0.9.25/interfaces/IDirectFBImageProvider/libidirectfbimageprovider_png.o -lpng -lz -lm
-L/sigma/lib -ldirectfb -lfusion -ldirect -lpthread -lz
b. 要加入 freetype, jpeg,png,zlib 庫的路徑。
c. 加入 png 時,要多一個 -lm,不然會出現找不到 pow 函數的錯誤。

11. performace
chilin[src]# ./df_dok &
---------------------- DirectFB v0.9.25 ---------------------
(c) 2000-2002 convergence integrated media GmbH
(c) 2002-2004 convergence GmbH
-----------------------------------------------------------

(*) DirectFB/Core: Single Application Core. (2007-11-29 01:00)
(*) Direct/Thread: Running 'VT Switcher' (CRITICAL, 154)...
(*) DirectFB/Graphics: Generic Software Rasterizer 0.6 (convergence integrated media GmbH)
(*) DirectFB/Core/WM: Default 0.2 (Convergence GmbH)
(!!!) *** UNIMPLEMENTED [fusion_reactor_set_lock] *** [reactor.c:853]
(*) Direct/Interface: Using 'PNG' implementation of 'IDirectFBImageProvider'.
(*) Direct/Interface: Using 'FT2' implementation of 'IDirectFBFont'.
(*) Direct/Interface: Using 'GIF' implementation of 'IDirectFBImageProvider'.

Benchmarking with 256x256 in 16bit mode... (16bit)

Anti-aliased Text 3.017 secs ( 38.183 KChars/sec)
Anti-aliased Text (blend) 3.224 secs ( 5.583 KChars/sec)
Fill Rectangle 3.058 secs ( 45.005 MPixel/sec)
Fill Rectangle (blend) 4.169 secs ( 1.571 MPixel/sec)
Fill Rectangles [10] 4.305 secs ( 45.669 MPixel/sec)
Fill Rectangles [10] (blend) 41.779 secs ( 1.568 MPixel/sec)
Fill Triangles 3.072 secs ( 30.933 MPixel/sec)
Fill Triangles (blend) 4.300 secs ( 1.524 MPixel/sec)
Draw Rectangle 3.013 secs ( 4.447 KRects/sec)
Draw Rectangle (blend) 3.103 secs ( 0.580 KRects/sec)
Draw Lines [10] 3.044 secs ( 13.140 KLines/sec)
Draw Lines [10] (blend) 3.243 secs ( 1.541 KLines/sec)
Fill Spans 3.039 secs ( 34.503 MPixel/sec)
Fill Spans (blend) 4.270 secs ( 1.534 MPixel/sec)
Blit 3.042 secs ( 19.389 MPixel/sec)
Blit colorkeyed 3.287 secs ( 13.956 MPixel/sec)
Blit destination colorkeyed 3.139 secs ( 10.438 MPixel/sec)
Blit with format conversion 4.354 secs ( 3.010 MPixel/sec)
Blit with colorizing 3.058 secs ( 2.143 MPixel/sec)
Blit from 32bit (blend) 24.315 secs ( 0.269 MPixel/sec)
Blit from 32bit (blend) with colorizing 25.484 secs ( 0.257 MPixel/sec)
Stretch Blit 19.767 secs ( 19.604 MPixel/sec)
Stretch Blit colorkeyed 40.012 secs ( 9.685 MPixel/sec)


創作者介紹

邱小新の工作筆記

台南小新 發表在 痞客邦 PIXNET 留言(0) 人氣()