FS#8041 - small speed-up for iPod Video's lcd_update ()

Attached to Project: Rockbox
Opened by Andree Buschmann (Buschel) - Sunday, 28 October 2007, 17:44 GMT
Last edited by Jens Arnold (amiconn) - Friday, 02 November 2007, 17:57 GMT
Task Type Patches
Category LCD
Status Closed
Assigned To No-one
Operating System iPod 5G
Severity Low
Priority Normal
Reported Version Daily build (which?)
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No


Small speed-up (+1%) for iPod Video's lcd_update()-function, based upon #15344.

- let x be even
- include the outer loop over y until heigth is reached into the asm-routine
This task depends upon

Closed by  Jens Arnold (amiconn)
Friday, 02 November 2007, 17:57 GMT
Reason for closing:  Out of Date
Additional comments about closing:  The update rectangle setup does indeed need just the rectangle parameters, the other 4 are unnecessary. Same goes for reading 0x1FC. Both ideas are implemented in svn now, as well as an update scheme that make the update functions never wait for the BCM (in main rockbox).
Comment by Andree Buschmann (Buschel) - Monday, 29 October 2007, 18:26 GMT
Further work in cleaning up the code (not that much relevant and more like a personal smell) as well as removing unneeded calls (interesting).
1. Writing to E0004, E0014, E0018, E001C in lcd_bcm_setup_rect() seems to be not needed and there is no measurable impact when changing the written values or even removing these writes.
2. lcd_bcm_read32(0x1FC) right after lcd_bcm_setup_rect() and right before leaving lcd_update_rect() seems to be not needed
3. variable and check for finishup_needed can be removed as the check for register content 0x1F8 works for the first call of lcd_update_rect() as well

Another result of dumb testing:
1. The call of lcd_bcm_write32(0x1F8, 0xFFFA0005) can be moved to the end of lcd_bcm_setup_rect() without any measurable impact.
2. When placing the call of lcd_bcm_write32(0x1F8, 0xFFFA0005) at the very end of lcd_update_rect() the iPod will perform some screen updates after booting and then hang up. It displays the startup logom the menu and if you are very fast you might even scroll a few items. Seems like the iPod hangs up after a small amount of time.

Maybe we get closer to the 14ms phenomenon?
Comment by Andree Buschmann (Buschel) - Friday, 02 November 2007, 14:25 GMT
Sync'ed and adapted to amiconns big rework of 5G LCD driver. Will leave the performance of full screen updates untouched (still 101fps @80MHz), but will slightly increase the fps for non full screen updates (1/4 screen 391.5 -> 399fps).

- moved the outer loop (--height) into the asm-routine
- taking into account the special case "width==LCD_WIDTH"

Imho this makes the function lcd_update() better readable. But make up your mind for yourself ;o)

Btw, we could do similar things to the yuv_blit-helper function. For this function we still search for each percent of speed-up, don't we? ;o)