diff options
author | Solomon Peachy <pizza@shaftnet.org> | 2022-10-13 11:03:53 -0400 |
---|---|---|
committer | Solomon Peachy <pizza@shaftnet.org> | 2022-10-13 11:08:06 -0400 |
commit | 418169aff8faf2cf90124cd95dba0af821cea73d (patch) | |
tree | 4fc206af57c9a07fba6cbcb3517fa946a7b84668 /firmware/target/arm/s5l8702/ipod6g/lcd-6g.c | |
parent | f9ea1fc79d6aaff9949a5b11ae011b4e04e0e9d9 (diff) | |
download | rockbox-418169aff8faf2cf90124cd95dba0af821cea73d.tar.gz rockbox-418169aff8faf2cf90124cd95dba0af821cea73d.zip |
Revert "Remove YUV blitting functions and LCD modes"
This reverts commit fe6aa21e9eb88f49005863efd2003d0982920048.
Change-Id: I8bb1e5d6c52ed1478002d2140ef494ec5d62b8e3
Diffstat (limited to 'firmware/target/arm/s5l8702/ipod6g/lcd-6g.c')
-rw-r--r-- | firmware/target/arm/s5l8702/ipod6g/lcd-6g.c | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/firmware/target/arm/s5l8702/ipod6g/lcd-6g.c b/firmware/target/arm/s5l8702/ipod6g/lcd-6g.c index e1406549f4..14647a5697 100644 --- a/firmware/target/arm/s5l8702/ipod6g/lcd-6g.c +++ b/firmware/target/arm/s5l8702/ipod6g/lcd-6g.c | |||
@@ -530,3 +530,49 @@ void lcd_update_rect(int x, int y, int width, int height) | |||
530 | 530 | ||
531 | displaylcd_dma(pixels); | 531 | displaylcd_dma(pixels); |
532 | } | 532 | } |
533 | |||
534 | /* Line write helper function for lcd_yuv_blit. Writes two lines of yuv420. */ | ||
535 | extern void lcd_write_yuv420_lines(unsigned char const * const src[3], | ||
536 | uint16_t* outbuf, | ||
537 | int width, | ||
538 | int stride); | ||
539 | |||
540 | /* Blit a YUV bitmap directly to the LCD */ | ||
541 | void lcd_blit_yuv(unsigned char * const src[3], | ||
542 | int src_x, int src_y, int stride, | ||
543 | int x, int y, int width, int height) ICODE_ATTR; | ||
544 | void lcd_blit_yuv(unsigned char * const src[3], | ||
545 | int src_x, int src_y, int stride, | ||
546 | int x, int y, int width, int height) | ||
547 | { | ||
548 | unsigned int z; | ||
549 | unsigned char const * yuv_src[3]; | ||
550 | |||
551 | #ifdef HAVE_LCD_SLEEP | ||
552 | if (!lcd_active()) return; | ||
553 | #endif | ||
554 | |||
555 | width = (width + 1) & ~1; /* ensure width is even */ | ||
556 | |||
557 | int pixels = width * height; | ||
558 | uint16_t* out = lcd_dblbuf[0]; | ||
559 | |||
560 | z = stride * src_y; | ||
561 | yuv_src[0] = src[0] + z + src_x; | ||
562 | yuv_src[1] = src[1] + (z >> 2) + (src_x >> 1); | ||
563 | yuv_src[2] = src[2] + (yuv_src[1] - src[1]); | ||
564 | |||
565 | displaylcd_setup(x, y, width, height); | ||
566 | |||
567 | height >>= 1; | ||
568 | |||
569 | do { | ||
570 | lcd_write_yuv420_lines(yuv_src, out, width, stride); | ||
571 | yuv_src[0] += stride << 1; | ||
572 | yuv_src[1] += stride >> 1; /* Skip down one chroma line */ | ||
573 | yuv_src[2] += stride >> 1; | ||
574 | out += width << 1; | ||
575 | } while (--height); | ||
576 | |||
577 | displaylcd_dma(pixels); | ||
578 | } | ||