📄 osd_inf_test.c
字号:
} gfx_osi_run_engine(1); PINFOE(" Time = %ld jiffies\n", jiffies - oldjiff); gfx_osi_bitBLT(&osd_fb_surface, 0,0, TST_WIDTH, TST_HEIGHT, &rgb_bl, 0,0, NULL, 0); osd_inf_debug_fill_fb(&rgb_bl); osd_inf_delay(500); }#endif //biblt#if 0 // blend if(osd_gfx_bpp >= 16) // directcolor { ALPHA_BLEND_SELECT bs; gfx_osi_fillBLT(&osd_fb_surface, 0,0, osd_scr_x, osd_scr_y, 0xff000000); PINFOE("\nTest ARGB32 blend capability\n"); osd_inf_debug_fill_fb(&rgb); PINFOE(" blend argb - argb, given alpha, 250 ops\n"); bs.blendInputSelect = GFX_BLEND_ALPHA_FROM_GIVEN; bs.storedAlphaSelect = GFX_DEST_ALPHA_FROM_DESTINATION; bs.globalAlphaValue = 128; gfx_osi_blend(&rgb, 0, 0, TST_WIDTH, TST_HEIGHT, &rgb_bl, 0, 0, &bs); gfx_osi_bitBLT(&osd_fb_surface, 0,0, TST_WIDTH, TST_HEIGHT, &rgb, 0,0, NULL, 0); osd_inf_debug_fill_fb(&rgb); osd_inf_delay(300); oldjiff = jiffies; for(i=0; i<250; i++) { UINT x = osd_inf_rand()%TST_WIDTH; UINT y = osd_inf_rand()%TST_HEIGHT; UINT h = osd_inf_rand()%TST_HEIGHT; UINT w = osd_inf_rand()%TST_WIDTH; UINT sx = osd_inf_rand()%TST_HEIGHT; UINT sy = osd_inf_rand()%TST_WIDTH; bs.globalAlphaValue = i; if(gfx_osi_blend(&rgb, x, y, w, h, &rgb_bl, sx, sy, &bs)) { PDEBUG("blend failed\n"); break; } } gfx_osi_run_engine(1); PINFOE(" Time = %ld jiffies\n", jiffies - oldjiff); gfx_osi_bitBLT(&osd_fb_surface, 0,0, TST_WIDTH, TST_HEIGHT, &rgb, 0,0, NULL, 0); osd_inf_debug_fill_fb(&rgb); osd_inf_delay(500); gfx_osi_fillBLT(&osd_fb_surface, 0,0, osd_scr_x, osd_scr_y, 0xff000000); PINFOE(" blend argb - argb, source alpha, 250 ops\n"); bs.blendInputSelect = GFX_BLEND_ALPHA_FROM_SOURCE; bs.storedAlphaSelect = GFX_DEST_ALPHA_FROM_DESTINATION; gfx_osi_blend(&rgb, 0, 0, TST_WIDTH, TST_HEIGHT, &rgb_bl, 0, 0, &bs); gfx_osi_bitBLT(&osd_fb_surface, 0,0, TST_WIDTH, TST_HEIGHT, &rgb, 0,0, NULL, 0); osd_inf_debug_fill_fb(&rgb); osd_inf_delay(300); oldjiff = jiffies; for(i=0; i<250; i++) { UINT x = osd_inf_rand()%TST_WIDTH; UINT y = osd_inf_rand()%TST_HEIGHT; UINT h = osd_inf_rand()%TST_HEIGHT; UINT w = osd_inf_rand()%TST_WIDTH; UINT sx = osd_inf_rand()%TST_HEIGHT; UINT sy = osd_inf_rand()%TST_WIDTH; if(gfx_osi_blend(&rgb, x, y, w, h, &rgb_bl, sx, sy, &bs)) { PDEBUG("blend failed\n"); break; } } gfx_osi_run_engine(1); PINFOE(" Time = %ld jiffies\n", jiffies - oldjiff); gfx_osi_bitBLT(&osd_fb_surface, 0,0, TST_WIDTH, TST_HEIGHT, &rgb, 0,0, NULL, 0); osd_inf_debug_fill_fb(&rgb); osd_inf_delay(500); gfx_osi_fillBLT(&osd_fb_surface, 0,0, osd_scr_x, osd_scr_y, 0xff000000); PINFOE(" blend argb - argb, dest alpha, 250 ops\n"); bs.blendInputSelect = GFX_BLEND_ALPHA_FROM_DESTINATION; bs.storedAlphaSelect = GFX_DEST_ALPHA_FROM_DESTINATION; gfx_osi_blend(&rgb, 0, 0, TST_WIDTH, TST_HEIGHT, &rgb_bl, 0, 0, &bs); gfx_osi_bitBLT(&osd_fb_surface, 0,0, TST_WIDTH, TST_HEIGHT, &rgb, 0,0, NULL, 0); osd_inf_debug_fill_fb(&rgb); osd_inf_delay(300); oldjiff = jiffies; for(i=0; i<250; i++) { UINT x = osd_inf_rand()%TST_WIDTH; UINT y = osd_inf_rand()%TST_HEIGHT; UINT h = osd_inf_rand()%TST_HEIGHT; UINT w = osd_inf_rand()%TST_WIDTH; UINT sx = osd_inf_rand()%TST_HEIGHT; UINT sy = osd_inf_rand()%TST_WIDTH; if(gfx_osi_blend(&rgb, x, y, w, h, &rgb_bl, sx, sy, &bs)) { PDEBUG("blend failed\n"); break; } } gfx_osi_run_engine(1); PINFOE(" Time = %ld jiffies\n", jiffies - oldjiff); gfx_osi_bitBLT(&osd_fb_surface, 0,0, TST_WIDTH, TST_HEIGHT, &rgb, 0,0, NULL, 0); osd_inf_debug_fill_fb(&rgb); osd_inf_delay(500); gfx_osi_fillBLT(&osd_fb_surface, 0,0, osd_scr_x, osd_scr_y, 0xff000000); PINFOE(" blend argb - argb, extern alpha, 250 ops\n"); bs.blendInputSelect = GFX_BLEND_ALPHA_FROM_PATTERN; bs.storedAlphaSelect = GFX_DEST_ALPHA_FROM_DESTINATION; osd_inf_fill_8bit_pattern(&rgb_8); gfx_osi_advancedBlend(&rgb, 0, 0, TST_WIDTH, TST_HEIGHT, &rgb_bl, 0, 0, &rgb_8, 0,0, &bs); gfx_osi_bitBLT(&osd_fb_surface, 0,0, TST_WIDTH, TST_HEIGHT, &rgb, 0,0, NULL, 0); osd_inf_debug_fill_fb(&rgb); osd_inf_delay(300); oldjiff = jiffies; for(i=0; i<250; i++) { UINT x = osd_inf_rand()%TST_WIDTH; UINT y = osd_inf_rand()%TST_HEIGHT; UINT h = osd_inf_rand()%TST_HEIGHT; UINT w = osd_inf_rand()%TST_WIDTH; UINT sx = osd_inf_rand()%TST_HEIGHT; UINT sy = osd_inf_rand()%TST_WIDTH; if(gfx_osi_advancedBlend(&rgb, x, y, w, h, &rgb_bl, sx, sy, &rgb_8, 0,0, &bs)) { PDEBUG("blend failed\n"); break; } } gfx_osi_run_engine(1); PINFOE(" Time = %ld jiffies\n", jiffies - oldjiff); gfx_osi_bitBLT(&osd_fb_surface, 0,0, TST_WIDTH, TST_HEIGHT, &rgb, 0,0, NULL, 0); osd_inf_debug_fill_fb(&rgb); osd_inf_delay(500); osd_inf_debug_fill_fb(&osd_fb_surface); }#endif#if 1 // resize PINFOE("\nTest resize capability\n"); osd_inf_debug_fill_fb(&osd_fb_surface); PINFOE(" resize YUV->YUV , 250 ops\n"); oldjiff = jiffies; for(i=0; i<250; i++) { UINT x = osd_inf_rand()%osd_scr_x; UINT y = osd_inf_rand()%osd_scr_y; UINT h = osd_inf_rand()%osd_buf_y; UINT w = osd_inf_rand()%osd_buf_x; if(gfx_osi_resize(&osd_fb_surface, x, y, w, h, &yuv, 0,0, TST_WIDTH, TST_HEIGHT, 128, 0)) { PDEBUG("resize failed\n"); break; } } gfx_osi_run_engine(1); PINFOE(" Time = %ld jiffies\n", jiffies - oldjiff); osd_inf_delay(500); PINFOE(" resize RGB->YUV Batch mode, 250 ops\n"); oldjiff = jiffies; for(i=0; i<250; i++) { UINT x = osd_inf_rand()%osd_scr_x; UINT y = osd_inf_rand()%osd_scr_y; UINT h = osd_inf_rand()%osd_buf_y; UINT w = osd_inf_rand()%osd_buf_x; if(gfx_osi_resize(&osd_fb_surface, x, y, w, h, &rgb, 0,0, TST_WIDTH, TST_HEIGHT, 128, 0)) { PDEBUG("resize failed\n"); break; } } gfx_osi_run_engine(1); PINFOE(" Time = %ld jiffies\n", jiffies - oldjiff); osd_inf_delay(500); if(osd_gfx_bpp >= 16) { PINFOE(" resize YUV->RGB Batch mode, 250 ops\n"); oldjiff = jiffies; for(i=0; i<250; i++) { UINT x = osd_inf_rand()%TST_WIDTH; UINT y = osd_inf_rand()%TST_HEIGHT; UINT h = osd_inf_rand()%TST_HEIGHT; UINT w = osd_inf_rand()%TST_WIDTH; if(gfx_osi_resize(&rgb, x, y, w, h, &yuv, 0,0, TST_WIDTH, TST_HEIGHT, 128, 0)) { PDEBUG("resize failed\n"); break; } } gfx_osi_run_engine(1); PINFOE(" Time = %ld jiffies\n", jiffies - oldjiff); // show it gfx_osi_bitBLT(&osd_fb_surface, 0,0, TST_WIDTH, TST_HEIGHT, &rgb, 0,0, NULL, 0); osd_inf_delay(500); PINFOE(" resize RGB->YUV Batch mode, 250 ops\n"); osd_inf_fill_8bit_pattern(&rgb); oldjiff = jiffies; for(i=0; i<250; i++) { UINT x = osd_inf_rand()%osd_scr_x; UINT y = osd_inf_rand()%osd_scr_y; UINT h = osd_inf_rand()%osd_buf_y; UINT w = osd_inf_rand()%osd_buf_x; if(gfx_osi_resize(&osd_fb_surface, x, y, w, h, &rgb, 0,0, TST_WIDTH, TST_HEIGHT, 128, 0)) { PDEBUG("resize failed\n"); break; } } gfx_osi_run_engine(1); PINFOE(" Time = %ld jiffies\n", jiffies - oldjiff); osd_inf_debug_fill_fb(&osd_fb_surface); PINFOE(" resize YUV palette ->YUV , 250 ops\n"); oldjiff = jiffies; for(i=0; i<250; i++) { UINT x = osd_inf_rand()%osd_scr_x; UINT y = osd_inf_rand()%osd_scr_y; UINT h = osd_inf_rand()%osd_buf_y; UINT w = osd_inf_rand()%osd_buf_x; if(gfx_osi_resize(&osd_fb_surface, x, y, w, h, &yuv_8, 0,0, TST_WIDTH, TST_HEIGHT, 128, 0)) { PDEBUG("resize failed\n"); break; } } gfx_osi_run_engine(1); PINFOE(" Time = %ld jiffies\n", jiffies - oldjiff); osd_inf_delay(500); osd_inf_debug_fill_fb(&osd_fb_surface); PINFOE(" resize RGB palette ->YUV , 250 ops\n"); oldjiff = jiffies; for(i=0; i<250; i++) { UINT x = osd_inf_rand()%osd_scr_x; UINT y = osd_inf_rand()%osd_scr_y; UINT h = osd_inf_rand()%osd_buf_y; UINT w = osd_inf_rand()%osd_buf_x; if(gfx_osi_resize(&osd_fb_surface, x, y, w, h, &rgb_8, 0,0, TST_WIDTH, TST_HEIGHT, 128, 0)) { PDEBUG("resize failed\n"); break; } } gfx_osi_run_engine(1); PINFOE(" Time = %ld jiffies\n", jiffies - oldjiff); osd_inf_delay(500); PINFOE(" resize YUV palette ->RGB Batch mode, 250 ops\n"); oldjiff = jiffies; for(i=0; i<250; i++) { UINT x = osd_inf_rand()%TST_WIDTH; UINT y = osd_inf_rand()%TST_HEIGHT; UINT h = osd_inf_rand()%TST_HEIGHT; UINT w = osd_inf_rand()%TST_WIDTH; if(gfx_osi_resize(&rgb, x, y, w, h, &yuv_8, 0,0, TST_WIDTH, TST_HEIGHT, 128, 0)) { PDEBUG("resize failed\n"); break; } } gfx_osi_run_engine(1); PINFOE(" Time = %ld jiffies\n", jiffies - oldjiff); // show it osd_inf_debug_fill_fb(&osd_fb_surface); gfx_osi_bitBLT(&osd_fb_surface, 0,0, TST_WIDTH, TST_HEIGHT, &rgb, 0,0, NULL, 0); osd_inf_delay(500); PINFOE(" resize RGB palette ->RGB , 250 ops\n"); osd_inf_fill_8bit_pattern(&rgb); oldjiff = jiffies; for(i=0; i<250; i++) { UINT x = osd_inf_rand()%TST_WIDTH; UINT y = osd_inf_rand()%TST_HEIGHT; UINT h = osd_inf_rand()%TST_HEIGHT; UINT w = osd_inf_rand()%TST_WIDTH; if(gfx_osi_resize(&rgb, x, y, w, h, &rgb_8, 0,0, TST_WIDTH, TST_HEIGHT, 128, 0)) { PDEBUG("resize failed\n"); break; } } gfx_osi_run_engine(1); PINFOE(" Time = %ld jiffies\n", jiffies - oldjiff); // show it osd_inf_debug_fill_fb(&osd_fb_surface); gfx_osi_bitBLT(&osd_fb_surface, 0,0, TST_WIDTH, TST_HEIGHT, &rgb, 0,0, NULL, 0); osd_inf_delay(500); } #endif gfx_osi_destroy_surface(&yuv); gfx_osi_destroy_surface(&rgb); if(osd_gfx_bpp >= 16) { gfx_osi_destroy_surface(&yuv_8); gfx_osi_destroy_surface(&rgb_8); gfx_osi_destroy_surface(&yuv_8); gfx_osi_destroy_surface(&rgb_bl); } }#endif } return 0;}static void osd_inf_test_deinit(void){ osd_osi_detach_comp_gfx_surface(osd_fb_device, &osd_fb_surface); gfx_osi_destroy_surface(&osd_fb_surface); osd_osi_set_display_parm(OSD_DISP_CNTL_BACKCOLOR, 0x1088); return ;}/** Modularization*/module_init(osd_inf_test_init);module_exit(osd_inf_test_deinit);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -