From 83aded979f074b6d48cd05db8f7f991e51372e38 Mon Sep 17 00:00:00 2001 From: Jens Arnold Date: Thu, 2 Nov 2006 20:50:50 +0000 Subject: H300: (1) Use DMA for LCD updates, with auto-aligned line reads. Speeds up LCD updates by ~ 75% at 11MHz and 45MHz. Only ~ 11% speedup at 124MHz due to (2). (2) Less aggressive LCD transfer timing at 124MHz. With the previous timing, slightly corrupted display contents was reported, and with DMA transfers at least 4 waitstates are needed to make updates work at all. * A table in system-iriver.c shows settings for all integer multiples of the base clock frequency (info for developers, not yet complete). git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11418 a1c6a512-1295-4272-9138-f99709370657 --- firmware/target/coldfire/iriver/h300/lcd-as-h300.S | 96 ---------------------- 1 file changed, 96 deletions(-) (limited to 'firmware/target/coldfire/iriver/h300/lcd-as-h300.S') diff --git a/firmware/target/coldfire/iriver/h300/lcd-as-h300.S b/firmware/target/coldfire/iriver/h300/lcd-as-h300.S index c6c1c76136..ae55dfb224 100755 --- a/firmware/target/coldfire/iriver/h300/lcd-as-h300.S +++ b/firmware/target/coldfire/iriver/h300/lcd-as-h300.S @@ -22,102 +22,6 @@ .section .icode, "ax", @progbits - .align 2 - .global lcd_write_data - .type lcd_write_data, @function - -lcd_write_data: - move.l (4, %sp), %a0 /* data pointer */ - move.l (8, %sp), %d0 /* length in words */ - add.l %d0, %d0 /* words -> bytes */ - add.l %a0, %d0 /* -> end address */ - lea.l 0xf0000002, %a1 /* LCD data port */ - - move.l %a0, %d1 - btst.l #1, %d1 /* already longword aligned? */ - beq.s .word1_end /* yes: skip initial word copy */ - - move.w (%a0)+, (%a1) /* transfer initial word */ - -.word1_end: /* now longword aligned */ - moveq.l #28, %d1 - add.l %a0, %d1 - and.l #0xFFFFFFF0,%d1 /* %d1 = first line bound + 16 */ - cmp.l %d1, %d0 /* at least one full line to send? */ - blo.s .long2_start /* no: skip to trailing longword handling */ - - lea.l (-16, %sp), %sp /* free up some registers */ - movem.l %d2-%d4/%a2, (%sp) - - subq.l #8, %d1 - subq.l #8, %d1 /* %d1 = first line bound */ - - cmp.l %a0, %d1 /* any leading longwords? */ - bls.s .long1_end /* no: skip leading long loop */ - -.long1_loop: - move.l (%a0)+, %d2 /* read longword */ - swap %d2 /* send data to LCD in correct order...*/ - move.w %d2, (%a1) - swap %d2 - move.w %d2, (%a1) - cmp.l %a0, %d1 /* run %a0 up to first line bound */ - bhi.s .long1_loop - -.long1_end: - move.l %d0, %a2 - lea.l (-14, %a2), %a2 /* %a2 = end address - 14 (one line/pass) */ - - /* burst-optimised line transfers */ -.line_loop: - movem.l (%a0), %d1-%d4 /* burst-read line */ - lea.l (16, %a0), %a0 /* increment address */ - swap %d1 /* send data to LCD in correct order... */ - move.w %d1, (%a1) - swap %d1 - move.w %d1, (%a1) - swap %d2 - move.w %d2, (%a1) - swap %d2 - move.w %d2, (%a1) - swap %d3 - move.w %d3, (%a1) - swap %d3 - move.w %d3, (%a1) - swap %d4 - move.w %d4, (%a1) - swap %d4 - move.w %d4, (%a1) - cmp.l %a0, %a2 /* run %a0 up to last line bound */ - bhi.s .line_loop - - movem.l (%sp), %d2-%d4/%a2 - lea.l (16, %sp), %sp /* restore registers */ - -.long2_start: - subq.l #2, %d0 /* account for handling 2 words per loop */ - cmp.l %a0, %d0 /* any (trailing longwords? */ - bls.s .long2_end /* no: skip trailing longword loop */ - -.long2_loop: - move.l (%a0)+, %d1 /* read longword */ - swap %d1 /* send data to LCD in correct order */ - move.w %d1, (%a1) - swap %d1 - move.w %d1, (%a1) - cmp.l %a0, %d0 /* run %a0 up to last long bound */ - bhi.s .long2_loop - -.long2_end: - blo.s .word2_end /* no final word: skip */ - move.w (%a0)+, (%a1) /* transfer final word */ - -.word2_end: - rts -.lcd_write_data_end: - .size lcd_write_data, .lcd_write_data_end - lcd_write_data - - /* lcd_write_yuv420_lines(), based on lcd-as-x5.S * * See http://en.wikipedia.org/wiki/YCbCr -- cgit v1.2.3