在使用G2D,的填充接口,发现比其计算完的时间比SW还慢。
同样BLEND 掐出的时间也是比 软算法的要慢好多。
屏幕分辨率是1280*800 的ARGB格式 ,掐的是ioctl(lv_port_data.h_rotate, G2D_CMD_FILLRECT_H, (unsigned long)&info) 这接接口。需要4.9ms。
LVGL 的Fill 软件算法只要1ms 。
难道硬件G2D 就是要这么长时间么?
FILL代码如下:
g2d_fillrect_h info;
memset(&info, 0, sizeof(g2d_fillrect_h));
if (opa > LV_OPA_MAX) {
info.dst_image_h.alpha = 255;
} else {
info.dst_image_h.alpha = opa;
color.ch.alpha = opa;
}
info.dst_image_h.mode = G2D_PIXEL_ALPHA;
info.dst_image_h.color = color.full;
info.dst_image_h.format = G2D_FORMAT_ARGB8888;
info.dst_image_h.clip_rect.x = draw_area->x1;
info.dst_image_h.clip_rect.y = draw_area->y1;
info.dst_image_h.clip_rect.w = draw_area_w;
info.dst_image_h.clip_rect.h = draw_area_h;
info.dst_image_h.width = disp_w;
info.dst_image_h.height = disp_h;
info.dst_image_h.align[0] = 0;
info.dst_image_h.align[1] = info.dst_image_h.align[0];
info.dst_image_h.align[2] = info.dst_image_h.align[0];
info.dst_image_h.laddr[0] = (unsigned int)esMEMS_VA2PA(dest_buf);
info.dst_image_h.laddr[1] = 0;
info.dst_image_h.laddr[2] = 0;
info.dst_image_h.use_phy_addr = 1;
int ret;
if(lv_port_data.h_rotate < 0) {
lv_port_data.h_rotate = open("/dev/g2d", O_WRONLY);
}
ret = ioctl(lv_port_data.h_rotate, G2D_CMD_FILLRECT_H, (unsigned long)&info);
if(ret < 0) {
__err("ERROR: sunxifb_g2d_fill G2D_CMD_FILLRECT_H failed");
}
close(lv_port_data.h_rotate);