运行显示器没反应,于是修改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 中。