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/ipod/video/lcd-video.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/ipod/video/lcd-video.c')
-rw-r--r-- | firmware/target/arm/ipod/video/lcd-video.c | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/firmware/target/arm/ipod/video/lcd-video.c b/firmware/target/arm/ipod/video/lcd-video.c index 494bec8429..27d889aafa 100644 --- a/firmware/target/arm/ipod/video/lcd-video.c +++ b/firmware/target/arm/ipod/video/lcd-video.c | |||
@@ -439,6 +439,53 @@ void lcd_update(void) | |||
439 | lcd_update_rect(0, 0, LCD_WIDTH, LCD_HEIGHT); | 439 | lcd_update_rect(0, 0, LCD_WIDTH, LCD_HEIGHT); |
440 | } | 440 | } |
441 | 441 | ||
442 | /* Line write helper function for lcd_yuv_blit. Writes two lines of yuv420. */ | ||
443 | extern void lcd_write_yuv420_lines(unsigned char const * const src[3], | ||
444 | unsigned bcmaddr, | ||
445 | int width, | ||
446 | int stride); | ||
447 | |||
448 | /* Performance function to blit a YUV bitmap directly to the LCD */ | ||
449 | void lcd_blit_yuv(unsigned char * const src[3], | ||
450 | int src_x, int src_y, int stride, | ||
451 | int x, int y, int width, int height) | ||
452 | { | ||
453 | unsigned bcmaddr; | ||
454 | off_t z; | ||
455 | unsigned char const * yuv_src[3]; | ||
456 | |||
457 | #ifdef HAVE_LCD_SLEEP | ||
458 | if (!lcd_state.display_on) | ||
459 | return; | ||
460 | #endif | ||
461 | |||
462 | /* Sorry, but width and height must be >= 2 or else */ | ||
463 | width &= ~1; | ||
464 | |||
465 | z = stride * src_y; | ||
466 | yuv_src[0] = src[0] + z + src_x; | ||
467 | yuv_src[1] = src[1] + (z >> 2) + (src_x >> 1); | ||
468 | yuv_src[2] = src[2] + (yuv_src[1] - src[1]); | ||
469 | |||
470 | /* Prevent the tick from triggering BCM updates while we're writing. */ | ||
471 | lcd_block_tick(); | ||
472 | |||
473 | bcmaddr = BCMA_CMDPARAM + (LCD_WIDTH*2) * y + (x << 1); | ||
474 | height >>= 1; | ||
475 | |||
476 | do | ||
477 | { | ||
478 | lcd_write_yuv420_lines(yuv_src, bcmaddr, width, stride); | ||
479 | bcmaddr += (LCD_WIDTH*4); /* Skip up two lines */ | ||
480 | yuv_src[0] += stride << 1; | ||
481 | yuv_src[1] += stride >> 1; /* Skip down one chroma line */ | ||
482 | yuv_src[2] += stride >> 1; | ||
483 | } | ||
484 | while (--height > 0); | ||
485 | |||
486 | lcd_unblock_and_update(); | ||
487 | } | ||
488 | |||
442 | #ifdef HAVE_LCD_SLEEP | 489 | #ifdef HAVE_LCD_SLEEP |
443 | /* Executes a BCM command immediately and waits for it to complete. | 490 | /* Executes a BCM command immediately and waits for it to complete. |
444 | Other BCM commands (eg. LCD updates or lcd_tick) must not interfere. | 491 | Other BCM commands (eg. LCD updates or lcd_tick) must not interfere. |