diff options
Diffstat (limited to 'firmware/target/arm/tms320dm320/mrobe-500/lcd-mr500.c')
-rw-r--r-- | firmware/target/arm/tms320dm320/mrobe-500/lcd-mr500.c | 86 |
1 files changed, 1 insertions, 85 deletions
diff --git a/firmware/target/arm/tms320dm320/mrobe-500/lcd-mr500.c b/firmware/target/arm/tms320dm320/mrobe-500/lcd-mr500.c index 8620c672e1..e851c421a6 100644 --- a/firmware/target/arm/tms320dm320/mrobe-500/lcd-mr500.c +++ b/firmware/target/arm/tms320dm320/mrobe-500/lcd-mr500.c | |||
@@ -273,15 +273,7 @@ void lcd_init_device(void) | |||
273 | #if defined(HAVE_LCD_MODES) | 273 | #if defined(HAVE_LCD_MODES) |
274 | void lcd_set_mode(int mode) | 274 | void lcd_set_mode(int mode) |
275 | { | 275 | { |
276 | if(mode==LCD_MODE_YUV) { | 276 | if(mode==LCD_MODE_RGB565) { |
277 | /* Turn off the RGB buffer and enable the YUV buffer with zoom */ | ||
278 | IO_OSD_OSDWINMD0 |= 0x04; | ||
279 | IO_OSD_VIDWINMD |= 0x01; | ||
280 | #if LCD_NATIVE_WIDTH > 240 | ||
281 | IO_OSD_VIDWINMD |= (0x05<<2); /* This does a 2x zoom */ | ||
282 | #endif | ||
283 | memset16(FRAME2, 0x0080, LCD_NATIVE_HEIGHT*(LCD_NATIVE_WIDTH+LCD_FUDGE)); | ||
284 | } else if(mode==LCD_MODE_RGB565) { | ||
285 | /* Turn on the RGB window, set it to 16 bit and turn YUV window off */ | 277 | /* Turn on the RGB window, set it to 16 bit and turn YUV window off */ |
286 | IO_OSD_VIDWINMD &= ~(0x01); | 278 | IO_OSD_VIDWINMD &= ~(0x01); |
287 | IO_OSD_OSDWIN0OFST = LCD_NATIVE_WIDTH / 16; | 279 | IO_OSD_OSDWIN0OFST = LCD_NATIVE_WIDTH / 16; |
@@ -644,82 +636,6 @@ void lcd_pal256_update_pal(fb_data *palette) | |||
644 | } | 636 | } |
645 | #endif | 637 | #endif |
646 | 638 | ||
647 | /* Performance function to blit a YUV bitmap directly to the LCD */ | ||
648 | /* Show it rotated so the LCD_WIDTH is now the height */ | ||
649 | void lcd_blit_yuv(unsigned char * const src[3], | ||
650 | int src_x, int src_y, int stride, | ||
651 | int x, int y, int width, int height) | ||
652 | { | ||
653 | unsigned char const * yuv_src[3]; | ||
654 | |||
655 | if (!lcd_on) | ||
656 | return; | ||
657 | |||
658 | /* y has to be on a 16 pixel boundary */ | ||
659 | y &= ~0xF; | ||
660 | |||
661 | if( ((y | x | height | width ) < 0) | ||
662 | || y>LCD_NATIVE_HEIGHT || x>LCD_NATIVE_WIDTH ) | ||
663 | return; | ||
664 | |||
665 | if(y+height>LCD_NATIVE_WIDTH) | ||
666 | { | ||
667 | height=LCD_NATIVE_WIDTH-y; | ||
668 | } | ||
669 | if(x+width>LCD_NATIVE_HEIGHT) | ||
670 | { | ||
671 | width=LCD_NATIVE_HEIGHT-x; | ||
672 | } | ||
673 | |||
674 | /* Sorry, but width and height must be >= 2 or else */ | ||
675 | width &= ~1; | ||
676 | height>>=1; | ||
677 | |||
678 | fb_data * dst = FRAME2 | ||
679 | + ((LCD_NATIVE_WIDTH+LCD_FUDGE)*(LCD_NATIVE_HEIGHT-1)) | ||
680 | - (LCD_NATIVE_WIDTH+LCD_FUDGE)*x + y ; | ||
681 | |||
682 | /* Scope z */ | ||
683 | { | ||
684 | off_t z; | ||
685 | z = stride*src_y; | ||
686 | yuv_src[0] = src[0] + z + src_x; | ||
687 | yuv_src[1] = src[1] + (z >> 2) + (src_x >> 1); | ||
688 | yuv_src[2] = src[2] + (yuv_src[1] - src[1]); | ||
689 | } | ||
690 | |||
691 | int cbcr_remain=(stride>>1)-(width>>1); | ||
692 | int y_remain=(stride<<1)-width; | ||
693 | do | ||
694 | { | ||
695 | register int c_width=width; | ||
696 | register unsigned int *c_dst=(unsigned int*)dst; | ||
697 | do | ||
698 | { | ||
699 | register unsigned short Y=*((unsigned short*)yuv_src[0]); | ||
700 | register unsigned short Yst=*((unsigned short*)(yuv_src[0]+stride)); | ||
701 | yuv_src[0]+=2; | ||
702 | |||
703 | register unsigned char Cb=*yuv_src[1]++; | ||
704 | register unsigned char Cr=*yuv_src[2]++; | ||
705 | |||
706 | *c_dst = (Yst<<24) | (Cr << 16) | ((Y&0xFF)<<8) | Cb; | ||
707 | *(c_dst - (LCD_NATIVE_WIDTH+LCD_FUDGE)/2) = | ||
708 | ( (Yst&0xFF00)<<16) | (Cr << 16) | (Y&0xFF00) | Cb; | ||
709 | |||
710 | c_dst -= (LCD_NATIVE_WIDTH+LCD_FUDGE); | ||
711 | |||
712 | c_width -= 2; | ||
713 | } while (c_width); | ||
714 | |||
715 | yuv_src[0] += y_remain; /* Skip down two luma lines-width */ | ||
716 | yuv_src[1] += cbcr_remain; /* Skip down one chroma line-width/2 */ | ||
717 | yuv_src[2] += cbcr_remain; | ||
718 | |||
719 | dst+=2; | ||
720 | } while (--height); | ||
721 | } | ||
722 | |||
723 | void lcd_set_contrast(int val) { | 639 | void lcd_set_contrast(int val) { |
724 | (void) val; | 640 | (void) val; |
725 | // TODO: | 641 | // TODO: |