mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-11-09 13:12:37 -05:00
Revert "Remove YUV blitting functions and LCD modes"
This reverts commit fe6aa21e9e.
Change-Id: I8bb1e5d6c52ed1478002d2140ef494ec5d62b8e3
This commit is contained in:
parent
f9ea1fc79d
commit
418169aff8
54 changed files with 9638 additions and 3 deletions
|
|
@ -158,3 +158,65 @@ void lcd_update(void)
|
|||
|
||||
lcd_update_rect(0, 0, LCD_WIDTH, LCD_HEIGHT);
|
||||
}
|
||||
|
||||
/* (Mis)use LCD framebuffer as a temporary buffer */
|
||||
void lcd_blit_yuv(unsigned char * const src[3],
|
||||
int src_x, int src_y, int stride,
|
||||
int x, int y, int width, int height)
|
||||
{
|
||||
unsigned char const * yuv_src[3];
|
||||
register off_t z;
|
||||
|
||||
if(!lcd_is_on)
|
||||
return;
|
||||
|
||||
z = stride * src_y;
|
||||
yuv_src[0] = src[0] + z + src_x;
|
||||
yuv_src[1] = src[1] + (z >> 2) + (src_x >> 1);
|
||||
yuv_src[2] = src[2] + (yuv_src[1] - src[1]);
|
||||
|
||||
commit_discard_dcache(); // XXX range
|
||||
|
||||
__cpm_start_ipu();
|
||||
|
||||
IPU_STOP_IPU();
|
||||
IPU_RESET_IPU();
|
||||
IPU_CLEAR_END_FLAG();
|
||||
|
||||
IPU_DISABLE_RSIZE();
|
||||
IPU_DISABLE_IRQ();
|
||||
|
||||
IPU_SET_INFMT(INFMT_YUV420);
|
||||
IPU_SET_OUTFMT(OUTFMT_RGB565);
|
||||
|
||||
IPU_SET_IN_FM(width, height);
|
||||
IPU_SET_Y_STRIDE(stride);
|
||||
IPU_SET_UV_STRIDE(stride, stride);
|
||||
|
||||
IPU_SET_Y_ADDR(PHYSADDR((unsigned long)yuv_src[0]));
|
||||
IPU_SET_U_ADDR(PHYSADDR((unsigned long)yuv_src[1]));
|
||||
IPU_SET_V_ADDR(PHYSADDR((unsigned long)yuv_src[2]));
|
||||
IPU_SET_OUT_ADDR(PHYSADDR((unsigned long)FBADDR(y,x)));
|
||||
|
||||
IPU_SET_OUT_FM(height, width);
|
||||
IPU_SET_OUT_STRIDE(height);
|
||||
|
||||
IPU_SET_CSC_C0_COEF(YUV_CSC_C0);
|
||||
IPU_SET_CSC_C1_COEF(YUV_CSC_C1);
|
||||
IPU_SET_CSC_C2_COEF(YUV_CSC_C2);
|
||||
IPU_SET_CSC_C3_COEF(YUV_CSC_C3);
|
||||
IPU_SET_CSC_C4_COEF(YUV_CSC_C4);
|
||||
|
||||
IPU_RUN_IPU();
|
||||
|
||||
while(!(IPU_POLLING_END_FLAG()) && IPU_IS_ENABLED());
|
||||
|
||||
IPU_CLEAR_END_FLAG();
|
||||
IPU_STOP_IPU();
|
||||
IPU_RESET_IPU();
|
||||
|
||||
__cpm_stop_ipu();
|
||||
|
||||
/* YUV speed is limited by LCD speed */
|
||||
lcd_update_rect(y, x, height, width);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue