BigW Consortium Gitlab

Commit 2a1cea91 by Shikai Chen

Performance improvements and bug fixs:

1. greatly improve the screen fps via RLE compression algorithm (for FW>=1.04) 2. fixed a dirty rect logic bug 3. fixed a urb transmission bug
parent d79255bb
......@@ -21,6 +21,7 @@
#define RPUSBDISP_DISPCMD_BITBLT 2
#define RPUSBDISP_DISPCMD_RECT 3
#define RPUSBDISP_DISPCMD_COPY_AREA 4
#define RPUSBDISP_DISPCMD_BITBLT_RLE 5
#define RPUSBDISP_OPERATION_COPY 0
......@@ -53,9 +54,6 @@ typedef struct _rpusbdisp_disp_fill_packet_t {
} __attribute__((packed)) rpusbdisp_disp_fill_packet_t;
typedef struct _rpusbdisp_disp_bitblt_packet_t {
rpusbdisp_disp_packet_header_t header;
_u16 x;
......@@ -92,6 +90,9 @@ typedef struct _rpusbdisp_disp_copyarea_packet_t {
#endif
// RLE Packet Define
#define RPUSBDISP_RLE_BLOCKFLAG_COMMON_BIT 0x80
#define RPUSBDISP_RLE_BLOCKFLAG_SIZE_BIT 0x7f
// -- Status Packets
......@@ -118,8 +119,8 @@ typedef struct _rpusbdisp_status_normal_packet_t {
rpusbdisp_status_packet_header_t header;
_u8 display_status;
_u8 touch_status;
int touch_x;
int touch_y;
_s32 touch_x;
_s32 touch_y;
} __attribute__((packed)) rpusbdisp_status_normal_packet_t;
#if defined(_WIN32) || defined(__ICCARM__)
......
......@@ -123,6 +123,7 @@ static void _display_update( struct fb_info *p, int x, int y, int width, int he
clear_dirty = 1;
} else {
if (pa->dirty_rect.top > y) pa->dirty_rect.top = y;
if (pa->dirty_rect.bottom < height+y-1) pa->dirty_rect.bottom = height+y-1;
if (pa->dirty_rect.left > x) pa->dirty_rect.left = x;
......@@ -130,9 +131,9 @@ static void _display_update( struct fb_info *p, int x, int y, int width, int he
}
if (pa->dirty_rect.top > pa->dirty_rect.bottom || pa->dirty_rect.left > pa->dirty_rect.right)
if (pa->dirty_rect.top > pa->dirty_rect.bottom || pa->dirty_rect.left > pa->dirty_rect.right) {
goto final;
}
atomic_set(&pa->dirty_rect.dirty_flag, 1);
// 2. try to send it
......@@ -167,7 +168,6 @@ static void _display_update( struct fb_info *p, int x, int y, int width, int he
}
break;
default:
if (rpusbdisp_usb_try_send_image(pa->binded_usbdev, (const pixel_type_t *)p->fix.smem_start,
pa->dirty_rect.left, pa->dirty_rect.top, pa->dirty_rect.right, pa->dirty_rect.bottom, p->fix.line_length/(RP_DISP_DEFAULT_PIXEL_BITS/8),
clear_dirty)) {
......@@ -193,12 +193,14 @@ static void _display_fillrect ( struct fb_info * p, const struct fb_fillrect *
static void _display_imageblit ( struct fb_info * p, const struct fb_image * image)
{
sys_imageblit (p, image);
_display_update(p, image->dx, image->dy, image->width, image->height, DISPLAY_UPDATE_HINT_BITBLT, image);
}
static void _display_copyarea ( struct fb_info * p, const struct fb_copyarea * area)
{
sys_copyarea (p, area);
_display_update(p, area->dx, area->dy, area->width, area->height, DISPLAY_UPDATE_HINT_COPYAREA, area);
}
......@@ -208,6 +210,7 @@ static ssize_t _display_write ( struct fb_info * p, const char * buf __user,
{
int retval;
retval = fb_sys_write (p, buf, count, ppos);
_display_update(p, 0, 0, p->var.width, p->var.height, DISPLAY_UPDATE_HINT_NONE, NULL);
return retval;
}
......@@ -279,6 +282,7 @@ static void _display_defio_handler(struct fb_info *info,
}
if (bottom >= RP_DISP_DEFAULT_HEIGHT) bottom = RP_DISP_DEFAULT_HEIGHT - 1;
_display_update(info, 0, top, info->var.width, bottom - top + 1, DISPLAY_UPDATE_HINT_NONE, NULL);
}
......@@ -477,8 +481,8 @@ void fbhandler_on_all_transfer_done(struct rpusbdisp_dev * dev)
fb_pri = _get_fb_private(fb);
if (atomic_read(&fb_pri->dirty_rect.dirty_flag) || atomic_read(&fb_pri->unsync_flag)) {
_display_update(fb, RP_DISP_DEFAULT_WIDTH, RP_DISP_DEFAULT_HEIGHT, 0, 0, DISPLAY_UPDATE_HINT_NONE, NULL);
if (atomic_read(&fb_pri->dirty_rect.dirty_flag) || atomic_read(&fb_pri->unsync_flag)==1) {
_display_update(fb, 0, 0, RP_DISP_DEFAULT_WIDTH, RP_DISP_DEFAULT_HEIGHT, DISPLAY_UPDATE_HINT_NONE, NULL);
}
}
......
......@@ -25,4 +25,7 @@
#define RP_DISP_DEFAULT_PIXEL_BITS 16
typedef _u16 pixel_type_t;
#define RP_DISP_FEATURE_RLE_FWVERSION 0x0104
#endif
......@@ -17,7 +17,7 @@
#define DRIVER_LICENSE_INFO "GPL"
#define DRIVER_VERSION "RoboPeak USB Display Driver Version 0.01"
#define DRIVER_VERSION "RoboPeak USB Display Driver Version 1.00"
#define RPUSBDISP_MINOR 300
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment