FTK在海思芯片HI3515上移植的问题。

59 views
Skip to first unread message

Evan

unread,
Nov 4, 2010, 6:05:35 AM11/4/10
to funnytoolkit, funnyt...@googlegroups.com
大家好:
最近看到FTK 的效果不错,于是在空闲之时把ftk-0.5 移植到海思HI3515的开发板运运行。
按照\ftk-0.5\tools\cross-build\README 的方法在 REDHAT5.4上交叉编译,把程序用NFS 挂载到开发板
上。
运行 ./desktop

运行显示器没反应,于是修改src/backend/native/ftk_display_fb.c 的接口:
static struct fb_bitfield g_a16 = {24, 8, 0};
static struct fb_bitfield g_r16 = {16, 8, 0};
static struct fb_bitfield g_g16 = {8, 8, 0};
static struct fb_bitfield g_b16 = {0, 8, 0};
HIFB_ALPHA_S stAlpha;
HIFB_POINT_S stPoint = {0, 0};

fb->fd = open(fbfilename, O_RDWR);
if (fb->fd < 0)
{
return -1;
}

/* 2. set the screen original position */
if (ioctl(fb->fd, FBIOPUT_SCREEN_ORIGIN_HIFB, &stPoint) < 0)
{
goto fail;
}

/* 3.set alpha */
stAlpha.bAlphaEnable = HI_FALSE;
stAlpha.bAlphaChannel = HI_FALSE;
stAlpha.u8Alpha0 = 0xff;
stAlpha.u8Alpha1 = 0x8f;
stAlpha.u8GlobalAlpha = 0x80;
if (ioctl(fb->fd, FBIOPUT_ALPHA_HIFB, &stAlpha) < 0)
{
goto fail;
}

/* 4. get the variable screen info */
if (ioctl(fb->fd, FBIOGET_VSCREENINFO, &fb->var) < 0)
{
goto fail;
}

/* 5. modify the variable screen info
the screen size: IMAGE_WIDTH*IMAGE_HEIGHT
the virtual screen size: VIR_SCREEN_WIDTH*VIR_SCREEN_HEIGHT
(which equals to VIR_SCREEN_WIDTH*(IMAGE_HEIGHT*2))
the pixel format: ARGB1555
*/
fb->var.xres_virtual = 800;
fb->var.yres_virtual = 600;
fb->var.xres = 800;
fb->var.yres = 600;

fb->var.transp= g_a16;
fb->var.red = g_r16;
fb->var.green = g_g16;
fb->var.blue = g_b16;
fb->var.bits_per_pixel = 32;
fb->var.activate = FB_ACTIVATE_FORCE;
/* 6. set the variable screeninfo */
if (ioctl(fb->fd, FBIOPUT_VSCREENINFO, &fb->var) < 0)
{
goto fail;
}


再将static void fb_sync(void* ctx, FtkRect* rect)
中的ret = fb_pan(info, 0, 0, 1);打开。

重新拷贝程序到NFS,运行:

./desktop

发现FTK 可以在HI3515上显示啦!而且颜色也正常。


现在的问题是 鼠标和键盘不能响应,我的编译选项是:
export FTK_CONF_OPTION="--disable-cairo --disable-tslib --disable-
profile --with-fontengine=freetype –-enable-cursor"

因为海思的event0 event1 event2 mice mouse0 是在/dev目录的;
于是我做了一个软链接:

mkdir /dev/input

ln -s /dev/event0 event1 event2 mice mouse0 /dev/input

从新编译程序,挂载到NFS 中,
在开发板上运行

./desktop

发现鼠标还是没有响应。
现在有两个问题:

1.打开cursor是否还有其他的编译选项?
2.因为海思有自带的2D画图硬件加速引擎(TDE),能否把这个引擎融合到FTK 中。

廖耿耿

unread,
Nov 4, 2010, 9:43:50 PM11/4/10
to funnyt...@googlegroups.com
支持一下,

李先静

unread,
Nov 5, 2010, 10:20:27 PM11/5/10
to funnyt...@googlegroups.com
1.打开cursor是否还有其他的编译选项?
没有编译选项,只有运行参数。

2.因为海思有自带的2D画图硬件加速引擎(TDE),
能否把这个引擎融合到FTK 中。
下面几个函数是FTK最费时的,如果能用它优化这些函数,效果会比较明显。

762      36.0625  libftk.so.0.0.0          ftk_bitmap_copy_to_data_xxxx
499      23.6157  libftk.so.0.0.0          ftk_canvas_fast_fill_rect
368      17.4160  libftk.so.0.0.0          ftk_canvas_draw_bg_image
194       9.1813  libftk.so.0.0.0          ftk_canvas_draw_bitmap
Reply all
Reply to author
Forward
0 new messages