Rockbox

Tasklist

FS#11843 - LCD speed up for iPod nano 1G, iPod color

Attached to Project: Rockbox
Opened by Andree Buschmann (Buschel) - Wednesday, 29 December 2010, 08:26 GMT
Last edited by Andree Buschmann (Buschel) - Sunday, 09 January 2011, 19:03 GMT
Task Type Patches
Category Drivers
Status Closed
Assigned To Andree Buschmann (Buschel)
Operating System iPod Nano
Severity Low
Priority Normal
Reported Version Release 3.7.1
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

This task provides changes to the iPod color/nano1G LCD driver that affect both RGB and YUV screen updates. For the YUV optimization the asm from the HDD6330 is used, for RGB a special case handling for (width==LCD_WIDTH) is introduced.

v01 = only affects YUV
v02 = YUV and RGB changes
This task depends upon

Closed by  Andree Buschmann (Buschel)
Sunday, 09 January 2011, 19:03 GMT
Reason for closing:  Accepted
Additional comments about closing:  All relevant changes were submitted. If new changes come up I will open a new task.
Comment by David Hall (Soap) - Wednesday, 29 December 2010, 14:45 GMT
Using v02 of the patch:

@ 30Mhz:
LCD = 80.5 / 318.0 (Identical to stock SVN)
YUV = 30.1 / 120.5 (vs 23.0 / 92.0 with stock SVN)

@ 80 Mhz:
LCD = 214.5 / 850.0 (Identical to stock SVN)
YUV = 81.0 / 322.0 (vs 61.5 / 246.0 with stock SVN)
Comment by David Hall (Soap) - Wednesday, 29 December 2010, 14:57 GMT
Using v02 of the patch AND:
<Buschel> soap: could you try the following and retest RGB full screen? -> r+=4 in line 338 and copying line 342 to call this twice?
<soap> of lcd-color_nano.c?
<Buschel> yes

results in an apparent failure to boot, the boot logo is garbled and I can see no screen response to key presses.

Comment by Andree Buschmann (Buschel) - Wednesday, 29 December 2010, 15:08 GMT
This v03 patch does not use explicit waits before wrtitng to the LCD IF. Worth a test as the RGB-to-YUV conversion needs a reasonable amount of time for each pixel pair.
Only needs to bested with the critical 80 MHz clock.
Comment by David Hall (Soap) - Wednesday, 29 December 2010, 16:52 GMT
building v03 on a reverted -R . tree:
/home/soap/rockbox/firmware/target/arm/ipod/lcd-as-color-nano.S:201: Error: symbol `lcd_yuv_write_inner_loop' is already defined
make: *** [/home/soap/rockbox/buildnano/firmware/target/arm/ipod/lcd-as-color-nano.o] Error 1

Comment by David Hall (Soap) - Wednesday, 29 December 2010, 22:04 GMT
Yes, buschel, still the same error after veryifying SVN status, redownloading the patch, and ensuring proper insertion. This on Normal build, make && make zip

svn up, make bin =
/home/soap/rockbox/firmware/target/arm/ipod/lcd-as-color-nano.S: Assembler messages:
/home/soap/rockbox/firmware/target/arm/ipod/lcd-as-color-nano.S:201: Error: symbol `lcd_yuv_write_inner_loop' is already defined
/home/soap/rockbox/firmware/target/arm/ipod/lcd-as-color-nano.S:353: Error: symbol `lcd_yuv_write_inner_loop' is already defined
/home/soap/rockbox/firmware/target/arm/ipod/lcd-as-color-nano.S:505: Error: symbol `lcd_yuv_write_inner_loop' is already defined
make: *** [/home/soap/rockbox/buildnano/firmware/target/arm/ipod/lcd-as-color-nano.o] Error 1
Comment by Andree Buschmann (Buschel) - Wednesday, 29 December 2010, 22:51 GMT
v02 on iPod color (tested by Hayden Pearce):
LCD RGB 1/1: 51.7, 1/4: 202.5 LCD YUV 1/1: 45.5, 1/4: 180.0 @ 80MHz
LCD RGB 1/1: 19.4, 1/4: 76.0 LCD YUV 1/1: 17.0, 1/4: 67.1 @ 30MHz

v03 on iPod color (tested by Hayden Pearce):
LCD RGB 1/1: 51.7, 1/4: 202.5 ; LCD YUV 1/1: 51.0, 1/4: 202.0 @ 80MHZ
LCD RGB 1/1: 19.4, 1/4: 76.0 ; LCD YUV 1/1: 19.1, 1/4: 75.5 @ 30MHZ

YUV is nearly identical to RGB. This means the bottleneck should be the LCD IF itself.
Comment by David Hall (Soap) - Wednesday, 29 December 2010, 22:52 GMT
Ok, me stupid, fixed now. ;)

@ 80 Mhz:
LCD = 214.5 / 850.0 (Identical to stock SVN)
YUV = 90.5 / 360.0 (vs 81.0 / 322.0 with v01 vs 61.5 / 246.0 with stock SVN)

Elephant's Dream /appears/ to play properly. What sort of artifacts should one expect? Subtle ones or gross ones? No gross ones to report.
Comment by David Hall (Soap) - Wednesday, 29 December 2010, 22:53 GMT
The above comment is with v03 of the patch.
Comment by Andree Buschmann (Buschel) - Wednesday, 29 December 2010, 23:31 GMT
Submitted v02. The attached v04 patch avoids waiting for FIFO (as v03 did), but is synched against current svn.
Comment by Andree Buschmann (Buschel) - Friday, 31 December 2010, 01:11 GMT
v09 patch changes the YUV asm code which is derived from iPod Video/nano2G now. The new asm code converts and writes two lines at once and avoids recalculation of chroma values. Speed up on iPod nano 1G was measured to be about +4% against latest svn (83.5 fps boosted full screen).

v10 patch disables FIFO_WAIT. Speedup on nano 1G is about +17% against svn (94.0 fps boosted full screen).
Comment by Andree Buschmann (Buschel) - Friday, 31 December 2010, 14:10 GMT
v11 does contain some more changes. Introduced a swap-macro and an inlined lcd_write_line()-function for better readability. This is patch is submit-ready and needs verification on nano1G and color models.
Comment by Andree Buschmann (Buschel) - Saturday, 01 January 2011, 14:15 GMT
After some debugging with soap this v13 fixes a bug with 1/4 screen updates.
Comment by Andree Buschmann (Buschel) - Saturday, 01 January 2011, 15:38 GMT
New v15 simplifies the YUV loop a bit and unifies the RGB and YUV loops.
Comment by Andree Buschmann (Buschel) - Saturday, 01 January 2011, 19:51 GMT
New v16 saves some binsize in the LCD driver.
Comment by Andree Buschmann (Buschel) - Sunday, 02 January 2011, 15:10 GMT
1) Should fix issues with RGB screen updates on iPod color. On the iPod color two loops are needed to fully update the display. The pointer to the framebuffer must be updated after the first loop. This was not done in older patches. For the iPod nano this is not relevant.
2) Ensure that "h" (derived from "height") is always even for the internal loops. This ensures that the first loop also uses even "h" in the YUV blitting which writes two lines at once. This is also relevant for the iPod color only.
Comment by Andree Buschmann (Buschel) - Sunday, 02 January 2011, 21:51 GMT
v17 measurements on iPod color (by Hayden Pearce):
LCD 1/1: 19.4, 1/4: 77.1 LCD YUV 1/1: 17.4, 1/4: 70.0 @30MHz ;
LCD 1/1: 51.7, 1/4: 206.0 LCD YUV 1/1: 46.7, 1/4: 187.0 @80MHz

v17 submitted with r28944.
Comment by Andree Buschmann (Buschel) - Sunday, 02 January 2011, 22:55 GMT
Minor code simplification. Checking for the need of swapping is not needed for nano 1G (always false). Checking on iPod color is always false for y0/y1 and always true for x0/x1. Therefore remove the checking and directly swap x0/x1 for the iPod Color.

Submitted with r28956, no speed change.

Loading...