To DTV or to IPTV, it is a question!
 最新公告
站点日历
最新日志
最新回复
最新留言
日志搜索

友情链接
 登陆信息
 统计信息
DirectFB porting to uCLinux

1 DirectFB porting to uCLinux/EM8620L platform

1.1 Development Environment

1.1.1 EM8620L target platform environment

Item Element Resources
Hardware EM8620L http://www.sigmadesigns.com
Software kernel = uCLinux-2.4.22 ToolChains
DirectFB = DirectFB-0.9.22
freetype = freetype-2.1.3
libjpeg = jpeg-6b ftp://ftp.uu.net/graphics/jpeg/jpegsrc.v6b.tar.gz
libpng = png-1.2.2
zlib = zlib-1.1.4 http://www.zlib.net/zlib-1.1.4.tar.gz

1.1.2 x86 host machine environment

Item Element Resources
OS Linux ( Redhat FC3 ) http://ftp.redhat.com/pub/redhat/linux/
host compiler gcc 3.3.4 http://www.gnu.org/software/gcc/
cross compiler arm-elf-gcc

1.2 Install DirectFB

1.2.1 Prepare libraries used in DirectFB

  • Extract each source code
  • Make a directory to hold all libs and includes 
    # mkdir DFB
    # cd DFB
    # mkdir lib
    # mkdir include
     
  • create libjpeg
             
    # cd jpeg-6b
    # CC=arm-elf-gcc CXX=arm-elf-g++ AR=arm-elf-ar \
            RANLIB=arm-elf-ranlib LD=arm-elf-ld ./configure \
            --target arm-elf-linux --host x86-pc-linux \
            --disable-shared --enable-static

    Edit Makefile
    Change Line 39 from
    LIBTOOL = ./libtool  to LIBTOOL = libtool

    Replace all "--mode" with "--tag" in Makefile

    # make libjpeg.a
    # cp libjpeg.a ../DFB/lib/
    # cp jpeglib.h ../DFB/include/
  • create zlib

    # CC=arm-elf-gcc CXX=arm-elf-g++ AR=arm-elf-ar \
            RANLIB=arm-elf-ranlib LD=arm-elf-ld ./configure
           
    modify Makefile for cross compile
    line 30 : AR=arm-elf-ar  to AR=arm-elf-ar cr
    # make
    # cp libjz.a ../DFB/lib/
    # cp ../zlib-1.1.4/zconf.h ../DFB/include/
    # cp zlib.h ../DFB/include/
  • create libpng

    # cp scripts/makefile.linux Makefile 

    modify Makefile for cross compile
    line 11 : change "gcc" to "arm-elf-gcc" 
    line 39 : change "ranlib" to "arm-elf-ranlib"
    line 59 : change "ar" to "arm-elf-ar"
    line 20&21
    ZLIBLIB=../DFB/lib
    ZLIBINC=../DFB/include

    # make libpng.a
    # cp libpng.a ../DFB/lib/
    # cp png.h ../DFB/include/
  • create freetype

    # CC=arm-elf-gcc CXX=arm-elf-g++ AR=arm-elf-ar \
            RANLIB=arm-elf-ranlib LD=arm-elf-ld \
    ./configure
    # make 
    # cp objs/.libs/libfreetype.a ../DFB/lib/
    # cp -r include/* ../DFB/include
  • Cross Compile DirectFB for uCLinux

    # CFLAGS=-I/home/RMT/Project/Develop/DFB/include \
            LDFLAGS=-L/home/RMT/Project/Develop/DFB/lib \
            CC=arm-elf-gcc CXX=arm-elf-g++ AR=arm-elf-ar \
            RANLIB=arm-elf-ranlib LD=arm-elf-ld \
            ./configure --target arm-elf-linux --host x86-pc-linux \
            --disable-shared --enable-static --disable-sdl \
            --with-gfxdrivers=none --with-inputdrivers=none \
            --prefix=/home/RMT/Project/DFB

    # LD=arm-elf-ld make
    # make install
    # export PKG_CONFIG_PATH=(your pkgconfig):$PKG_CONFIG_PATH
    Now all DFB libs and includes are in /home/RMT/Project/DFB

1.2.2 Prepare Demo software

    Through previous steps, you have installed DirectFB to  EM8620L uCLinux environment. To confirm everything created and installed properly use DirectFB demo program. You can download these demo program from DirectFB project website, that name is "DirectFB-examples". We used version 0.9.18. You can download from following Web site.

    As we faced some problem compiling these demo program for SH-4 Linux, we installed to x86 Linux first, then retarget to SH-4 Linux using following step.

1.2.4 Benchmark program

    Demo program named df_dok is DirectFB benchmark. If you run this without any options, it automatically runs set of benchmark program using graphics acceleration capability, and display result as graph. We use this benchmark score to tune DirectFB library for SM501.

1.2.5 Cross compiling

    Like other Linux application program, DirectFB is designed to compile only on x86 Linux. We struggled this time to compile DirectFB for SH-4 Linux and finally we success this cross porting. However we think this is a kind of handwork way. When you try to run demo program on non-x86 Linux, x86 reference looks mandatory. I suggest you start DirectFB implementation from x86 Linux.

1.3 Writing DirectFB driver

1.3.1 Graphics driver detection procedure

    Graphics chip drivers are located under /usr/local/lib/directfb-0.9.20/gfxdrivers There is no special installation procedure to add your own driver. DirectFB checks all drivers in driver_probe routine. When DirectFB detect correct driver in this process, DirectFB enables this driver. If driver does not works then move to next driver check, if all drivers does not much, DirectFB runs software mode without dedicated graphics driver. We have tentatively modified this process force to use SM501 driver.

1.3.2 Enabling hardware graphics acceleration capability

    Drawing routine set command parameters to use 2D acceleration capability. Graphic driver returns TRUE or FALSE as return-value. If FALSE returned, DirectFB thinks hardware acceleration does not built-in, and use whole software drawing. Not all drawing routine has this acceleration detection mechanism, it is sure to define in CheckState routine. You can write your own driver as you like except command parameters and return value.

[hdmediabox 发表于 2006-8-29 13:16:00]

[阅读全文 | 回复(2) | 引用通告 | 编辑]


  • 标签:DirectFB 
  • Re:DirectFB porting to uCLinux
    关于directfb porting to uclinux/em8620l platform这篇文章
    是应用在机顶盒产品的gui 的设计上吗
    只讲了移植directfb库,没有讲gtk+库的移植 啊
    还需要移植哪些库啊
    移植zlib库有什么用啊

    请速指教,多谢
    [hiccsun发表评论于2007-4-12 20:14:00]

    [个人主页 | 引用 | 返回 | 删除 | 回复]


    Re:DirectFB porting to uCLinux
    directfb-0.9.22
    freetype-2.1.3
    这些包 存放在主机上还是em8620l上啊
    应该是在主机上进行交叉编译吧 ,再把库文件拷到em8620l板上把

    这些库都是采用静态库的形式吗
    [hiccsun发表评论于2007-4-12 20:13:00]

    [个人主页 | 引用 | 返回 | 删除 | 回复]


    发表评论:

      大名:
      密码: (游客无须输入密码)
      主页:
      标题:


    Powered by Oblog.