summaryrefslogtreecommitdiff
path: root/firmware/target/arm
diff options
context:
space:
mode:
authorJens Arnold <amiconn@rockbox.org>2009-07-11 23:43:44 +0000
committerJens Arnold <amiconn@rockbox.org>2009-07-11 23:43:44 +0000
commit47d4c4739bafcb9864dc8d1c2b44903ad4f75b68 (patch)
tree7a9f510c72a0df2ddacb0f6ec393658cf676b8d4 /firmware/target/arm
parentfa59ed6ae724b3f75c8ba35efcf7ce18f21e3ed2 (diff)
downloadrockbox-47d4c4739bafcb9864dc8d1c2b44903ad4f75b68.tar.gz
rockbox-47d4c4739bafcb9864dc8d1c2b44903ad4f75b68.zip
ARM asm LCD and ATA driver functions: Don't save r12 as it is a scratch reg. Saves a bit of stack and execution time.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21795 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/arm')
-rw-r--r--firmware/target/arm/as3525/lcd-as-e200v2-fuze.S62
-rw-r--r--firmware/target/arm/as3525/sansa-clip/lcd-as-clip.S16
-rw-r--r--firmware/target/arm/ata-as-arm.S64
-rw-r--r--firmware/target/arm/ipod/lcd-as-gray.S71
-rw-r--r--firmware/target/arm/ipod/video/lcd-as-video.S26
-rw-r--r--firmware/target/arm/iriver/h10/lcd-as-h10.S8
-rw-r--r--firmware/target/arm/lcd-as-memframe.S67
-rw-r--r--firmware/target/arm/olympus/mrobe-100/lcd-as-mr100.S29
-rw-r--r--firmware/target/arm/philips/hdd1630/lcd-as-hdd1630.S8
-rw-r--r--firmware/target/arm/samsung/yh820/lcd-as-yh820.S79
-rw-r--r--firmware/target/arm/samsung/yh925/lcd-as-yh925.S8
-rw-r--r--firmware/target/arm/sandisk/sansa-c200/lcd-as-c200.S79
12 files changed, 256 insertions, 261 deletions
diff --git a/firmware/target/arm/as3525/lcd-as-e200v2-fuze.S b/firmware/target/arm/as3525/lcd-as-e200v2-fuze.S
index 254816cd0e..71d997d044 100644
--- a/firmware/target/arm/as3525/lcd-as-e200v2-fuze.S
+++ b/firmware/target/arm/as3525/lcd-as-e200v2-fuze.S
@@ -51,7 +51,7 @@ lcd_write_yuv420_lines:
51 @ r0 = yuv_src 51 @ r0 = yuv_src
52 @ r1 = width 52 @ r1 = width
53 @ r2 = stride 53 @ r2 = stride
54 stmfd sp!, { r4-r12 } @ save non-scratch 54 stmfd sp!, { r4-r10, lr } @ save non-scratch
55 ldmia r0, { r4, r5, r6 } @ r4 = yuv_src[0] = Y'_p 55 ldmia r0, { r4, r5, r6 } @ r4 = yuv_src[0] = Y'_p
56 @ r5 = yuv_src[1] = Cb_p 56 @ r5 = yuv_src[1] = Cb_p
57 @ r6 = yuv_src[2] = Cr_p 57 @ r6 = yuv_src[2] = Cr_p
@@ -76,9 +76,9 @@ lcd_write_yuv420_lines:
76 add r10, r10, r8, asl #3 @ 76 add r10, r10, r8, asl #3 @
77 add r10, r10, r8, asl #4 @ 77 add r10, r10, r8, asl #4 @
78 @ 78 @
79 add r11, r9, r9, asl #2 @ r9 = Cr*101 79 add lr, r9, r9, asl #2 @ r9 = Cr*101
80 add r11, r11, r9, asl #5 @ 80 add lr, lr, r9, asl #5 @
81 add r9, r11, r9, asl #6 @ 81 add r9, lr, r9, asl #6 @
82 @ 82 @
83 add r8, r8, #2 @ r8 = bu = (Cb*128 + 128) >> 8 83 add r8, r8, #2 @ r8 = bu = (Cb*128 + 128) >> 8
84 mov r8, r8, asr #2 @ 84 mov r8, r8, asr #2 @
@@ -88,19 +88,19 @@ lcd_write_yuv420_lines:
88 mov r10, r10, asr #8 @ 88 mov r10, r10, asr #8 @
89 @ compute R, G, and B 89 @ compute R, G, and B
90 add r0, r8, r7, asr #8 @ r0 = b = (Y >> 9) + bu 90 add r0, r8, r7, asr #8 @ r0 = b = (Y >> 9) + bu
91 add r11, r9, r7, asr #8 @ r11 = r = (Y >> 9) + rv 91 add lr, r9, r7, asr #8 @ lr = r = (Y >> 9) + rv
92 add r7, r10, r7, asr #7 @ r7 = g = (Y >> 8) + guv 92 add r7, r10, r7, asr #7 @ r7 = g = (Y >> 8) + guv
93 @ 93 @
94 orr r12, r0, r11 @ check if clamping is needed... 94 orr r12, r0, lr @ check if clamping is needed...
95 orr r12, r12, r7, asr #1 @ ...at all 95 orr r12, r12, r7, asr #1 @ ...at all
96 cmp r12, #31 @ 96 cmp r12, #31 @
97 bls 15f @ no clamp @ 97 bls 15f @ no clamp @
98 cmp r0, #31 @ clamp b 98 cmp r0, #31 @ clamp b
99 mvnhi r0, r0, asr #31 @ 99 mvnhi r0, r0, asr #31 @
100 andhi r0, r0, #31 @ 100 andhi r0, r0, #31 @
101 cmp r11, #31 @ clamp r 101 cmp lr, #31 @ clamp r
102 mvnhi r11, r11, asr #31 @ 102 mvnhi lr, lr, asr #31 @
103 andhi r11, r11, #31 @ 103 andhi lr, lr, #31 @
104 cmp r7, #63 @ clamp g 104 cmp r7, #63 @ clamp g
105 mvnhi r7, r7, asr #31 @ 105 mvnhi r7, r7, asr #31 @
106 andhi r7, r7, #63 @ 106 andhi r7, r7, #63 @
@@ -108,7 +108,7 @@ lcd_write_yuv420_lines:
108 @ 108 @
109 ldrb r12, [r4, r2] @ r12 = Y' = *(Y'_p + stride) 109 ldrb r12, [r4, r2] @ r12 = Y' = *(Y'_p + stride)
110 @ 110 @
111 orr r0, r0, r11, lsl #11 @ r0 = (r << 11) | b 111 orr r0, r0, lr, lsl #11 @ r0 = (r << 11) | b
112 orr r0, r0, r7, lsl #5 @ r0 = (r << 11) | (g << 5) | b 112 orr r0, r0, r7, lsl #5 @ r0 = (r << 11) | (g << 5) | b
113 strh r0, [r3, #0x10] @ write pixel 113 strh r0, [r3, #0x10] @ write pixel
1141: @ busy @ 1141: @ busy @
@@ -121,19 +121,19 @@ lcd_write_yuv420_lines:
121 add r7, r12, r7, asl #5 @ 121 add r7, r12, r7, asl #5 @
122 @ compute R, G, and B 122 @ compute R, G, and B
123 add r0, r8, r7, asr #8 @ r0 = b = (Y >> 9) + bu 123 add r0, r8, r7, asr #8 @ r0 = b = (Y >> 9) + bu
124 add r11, r9, r7, asr #8 @ r11 = r = (Y >> 9) + rv 124 add lr, r9, r7, asr #8 @ lr = r = (Y >> 9) + rv
125 add r7, r10, r7, asr #7 @ r7 = g = (Y >> 8) + guv 125 add r7, r10, r7, asr #7 @ r7 = g = (Y >> 8) + guv
126 @ 126 @
127 orr r12, r0, r11 @ check if clamping is needed... 127 orr r12, r0, lr @ check if clamping is needed...
128 orr r12, r12, r7, asr #1 @ ...at all 128 orr r12, r12, r7, asr #1 @ ...at all
129 cmp r12, #31 @ 129 cmp r12, #31 @
130 bls 15f @ no clamp @ 130 bls 15f @ no clamp @
131 cmp r0, #31 @ clamp b 131 cmp r0, #31 @ clamp b
132 mvnhi r0, r0, asr #31 @ 132 mvnhi r0, r0, asr #31 @
133 andhi r0, r0, #31 @ 133 andhi r0, r0, #31 @
134 cmp r11, #31 @ clamp r 134 cmp lr, #31 @ clamp r
135 mvnhi r11, r11, asr #31 @ 135 mvnhi lr, lr, asr #31 @
136 andhi r11, r11, #31 @ 136 andhi lr, lr, #31 @
137 cmp r7, #63 @ clamp g 137 cmp r7, #63 @ clamp g
138 mvnhi r7, r7, asr #31 @ 138 mvnhi r7, r7, asr #31 @
139 andhi r7, r7, #63 @ 139 andhi r7, r7, #63 @
@@ -141,7 +141,7 @@ lcd_write_yuv420_lines:
141 @ 141 @
142 ldrb r12, [r4], #1 @ r12 = Y' = *(Y'_p++) 142 ldrb r12, [r4], #1 @ r12 = Y' = *(Y'_p++)
143 @ 143 @
144 orr r0, r0, r11, lsl #11 @ r0 = (r << 11) | b 144 orr r0, r0, lr, lsl #11 @ r0 = (r << 11) | b
145 orr r0, r0, r7, lsl #5 @ r0 = (r << 11) | (g << 5) | b 145 orr r0, r0, r7, lsl #5 @ r0 = (r << 11) | (g << 5) | b
146 strh r0, [r3, #0x10] @ write pixel 146 strh r0, [r3, #0x10] @ write pixel
1471: @ busy @ 1471: @ busy @
@@ -154,19 +154,19 @@ lcd_write_yuv420_lines:
154 add r7, r12, r7, asl #5 @ 154 add r7, r12, r7, asl #5 @
155 @ compute R, G, and B 155 @ compute R, G, and B
156 add r0, r8, r7, asr #8 @ r0 = b = (Y >> 9) + bu 156 add r0, r8, r7, asr #8 @ r0 = b = (Y >> 9) + bu
157 add r11, r9, r7, asr #8 @ r11 = r = (Y >> 9) + rv 157 add lr, r9, r7, asr #8 @ lr = r = (Y >> 9) + rv
158 add r7, r10, r7, asr #7 @ r7 = g = (Y >> 8) + guv 158 add r7, r10, r7, asr #7 @ r7 = g = (Y >> 8) + guv
159 @ 159 @
160 orr r12, r0, r11 @ check if clamping is needed... 160 orr r12, r0, lr @ check if clamping is needed...
161 orr r12, r12, r7, asr #1 @ ...at all 161 orr r12, r12, r7, asr #1 @ ...at all
162 cmp r12, #31 @ 162 cmp r12, #31 @
163 bls 15f @ no clamp @ 163 bls 15f @ no clamp @
164 cmp r0, #31 @ clamp b 164 cmp r0, #31 @ clamp b
165 mvnhi r0, r0, asr #31 @ 165 mvnhi r0, r0, asr #31 @
166 andhi r0, r0, #31 @ 166 andhi r0, r0, #31 @
167 cmp r11, #31 @ clamp r 167 cmp lr, #31 @ clamp r
168 mvnhi r11, r11, asr #31 @ 168 mvnhi lr, lr, asr #31 @
169 andhi r11, r11, #31 @ 169 andhi lr, lr, #31 @
170 cmp r7, #63 @ clamp g 170 cmp r7, #63 @ clamp g
171 mvnhi r7, r7, asr #31 @ 171 mvnhi r7, r7, asr #31 @
172 andhi r7, r7, #63 @ 172 andhi r7, r7, #63 @
@@ -175,7 +175,7 @@ lcd_write_yuv420_lines:
175 ldrb r12, [r4, r2] @ r12 = Y' = *(Y'_p + stride) 175 ldrb r12, [r4, r2] @ r12 = Y' = *(Y'_p + stride)
176 @ 176 @
177 @ 177 @
178 orr r0, r0, r11, lsl #11 @ r0 = (r << 11) | b 178 orr r0, r0, lr, lsl #11 @ r0 = (r << 11) | b
179 orr r0, r0, r7, lsl #5 @ r0 = (r << 11) | (g << 5) | b 179 orr r0, r0, r7, lsl #5 @ r0 = (r << 11) | (g << 5) | b
180 strh r0, [r3, #0x10] @ write pixel 180 strh r0, [r3, #0x10] @ write pixel
1811: @ busy @ 1811: @ busy @
@@ -188,25 +188,25 @@ lcd_write_yuv420_lines:
188 add r7, r12, r7, asl #5 @ 188 add r7, r12, r7, asl #5 @
189 @ compute R, G, and B 189 @ compute R, G, and B
190 add r0, r8, r7, asr #8 @ r0 = b = (Y >> 9) + bu 190 add r0, r8, r7, asr #8 @ r0 = b = (Y >> 9) + bu
191 add r11, r9, r7, asr #8 @ r11 = r = (Y >> 9) + rv 191 add lr, r9, r7, asr #8 @ lr = r = (Y >> 9) + rv
192 add r7, r10, r7, asr #7 @ r7 = g = (Y >> 8) + guv 192 add r7, r10, r7, asr #7 @ r7 = g = (Y >> 8) + guv
193 @ 193 @
194 orr r12, r0, r11 @ check if clamping is needed... 194 orr r12, r0, lr @ check if clamping is needed...
195 orr r12, r12, r7, asr #1 @ ...at all 195 orr r12, r12, r7, asr #1 @ ...at all
196 cmp r12, #31 @ 196 cmp r12, #31 @
197 bls 15f @ no clamp @ 197 bls 15f @ no clamp @
198 cmp r0, #31 @ clamp b 198 cmp r0, #31 @ clamp b
199 mvnhi r0, r0, asr #31 @ 199 mvnhi r0, r0, asr #31 @
200 andhi r0, r0, #31 @ 200 andhi r0, r0, #31 @
201 cmp r11, #31 @ clamp r 201 cmp lr, #31 @ clamp r
202 mvnhi r11, r11, asr #31 @ 202 mvnhi lr, lr, asr #31 @
203 andhi r11, r11, #31 @ 203 andhi lr, lr, #31 @
204 cmp r7, #63 @ clamp g 204 cmp r7, #63 @ clamp g
205 mvnhi r7, r7, asr #31 @ 205 mvnhi r7, r7, asr #31 @
206 andhi r7, r7, #63 @ 206 andhi r7, r7, #63 @
20715: @ no clamp @ 20715: @ no clamp @
208 @ 208 @
209 orr r0, r0, r11, lsl #11 @ r0 = (r << 11) | b 209 orr r0, r0, lr, lsl #11 @ r0 = (r << 11) | b
210 orr r0, r0, r7, lsl #5 @ r0 = (r << 11) | (g << 5) | b 210 orr r0, r0, r7, lsl #5 @ r0 = (r << 11) | (g << 5) | b
211 strh r0, [r3, #0x10] @ write pixel 211 strh r0, [r3, #0x10] @ write pixel
2121: @ busy @ 2121: @ busy @
@@ -217,7 +217,7 @@ lcd_write_yuv420_lines:
217 subs r1, r1, #2 @ subtract block from width 217 subs r1, r1, #2 @ subtract block from width
218 bgt 10b @ loop line @ 218 bgt 10b @ loop line @
219 @ 219 @
220 ldmfd sp!, { r4-r12 } @ restore registers and return 220 ldmfd sp!, { r4-r10, pc } @ restore registers and return
221 bx lr @ 221 bx lr @
222 .ltorg @ dump constant pool 222 .ltorg @ dump constant pool
223 .size lcd_write_yuv420_lines, .-lcd_write_yuv420_lines 223 .size lcd_write_yuv420_lines, .-lcd_write_yuv420_lines
@@ -258,7 +258,7 @@ lcd_write_yuv420_lines_odither:
258 @ r2 = stride 258 @ r2 = stride
259 @ r3 = x_screen 259 @ r3 = x_screen
260 @ [sp] = y_screen 260 @ [sp] = y_screen
261 stmfd sp!, { r4-r12, lr } @ save non-scratch 261 stmfd sp!, { r4-r11, lr } @ save non-scratch
262 ldmia r0, { r4, r5, r6 } @ r4 = yuv_src[0] = Y'_p 262 ldmia r0, { r4, r5, r6 } @ r4 = yuv_src[0] = Y'_p
263 @ r5 = yuv_src[1] = Cb_p 263 @ r5 = yuv_src[1] = Cb_p
264 @ r6 = yuv_src[2] = Cr_p 264 @ r6 = yuv_src[2] = Cr_p
@@ -496,6 +496,6 @@ lcd_write_yuv420_lines_odither:
496 subs r1, r1, #2 @ subtract block from width 496 subs r1, r1, #2 @ subtract block from width
497 bgt 10b @ loop line @ 497 bgt 10b @ loop line @
498 @ 498 @
499 ldmfd sp!, { r4-r12, pc } @ restore registers and return 499 ldmfd sp!, { r4-r11, pc } @ restore registers and return
500 .ltorg @ dump constant pool 500 .ltorg @ dump constant pool
501 .size lcd_write_yuv420_lines_odither, .-lcd_write_yuv420_lines_odither 501 .size lcd_write_yuv420_lines_odither, .-lcd_write_yuv420_lines_odither
diff --git a/firmware/target/arm/as3525/sansa-clip/lcd-as-clip.S b/firmware/target/arm/as3525/sansa-clip/lcd-as-clip.S
index ed430178b9..5a52eb032c 100644
--- a/firmware/target/arm/as3525/sansa-clip/lcd-as-clip.S
+++ b/firmware/target/arm/as3525/sansa-clip/lcd-as-clip.S
@@ -39,15 +39,15 @@
39 * r3/r4 - current block of phases 39 * r3/r4 - current block of phases
40 * r5/r6 - current block of values 40 * r5/r6 - current block of values
41 * r7 - lcd data accumulator 41 * r7 - lcd data accumulator
42 * r8 - phase signs mask 42 * r12 - phase signs mask
43 * lr - lcd bridge address 43 * lr - lcd bridge address
44 */ 44 */
45 45
46lcd_grey_data: 46lcd_grey_data:
47 stmfd sp!, {r4-r8, lr} 47 stmfd sp!, {r4-r7, lr}
48 mov r8, #0x80 48 mov r12, #0x80
49 orr r8, r8, r8, lsl #8 49 orr r12, r12, r12, lsl #8
50 orr r8, r8, r8, lsl #16 50 orr r12, r12, r12, lsl #16
51 51
52 ldr lr, =GPIOA_BASE 52 ldr lr, =GPIOA_BASE
53 mov r3, #(1<<5) 53 mov r3, #(1<<5)
@@ -70,7 +70,7 @@ lcd_grey_data:
70 orrne r7, r7, #0x2000 70 orrne r7, r7, #0x2000
71 tst r3, #0x80000000 71 tst r3, #0x80000000
72 orrne r7, r7, #0x1000 72 orrne r7, r7, #0x1000
73 bic r3, r3, r8 73 bic r3, r3, r12
74 add r3, r3, r5 74 add r3, r3, r5
75 75
76 /* set bits 3..0 */ 76 /* set bits 3..0 */
@@ -82,7 +82,7 @@ lcd_grey_data:
82 orrne r7, r7, #0x02 82 orrne r7, r7, #0x02
83 tst r4, #0x80000000 83 tst r4, #0x80000000
84 orrne r7, r7, #0x01 84 orrne r7, r7, #0x01
85 bic r4, r4, r8 85 bic r4, r4, r12
86 add r4, r4, r6 86 add r4, r4, r6
87 87
88 stmia r1!, {r3-r4} 88 stmia r1!, {r3-r4}
@@ -102,5 +102,5 @@ lcd_grey_data:
102 ands r5, r5, #(1<<10) @ wait until push fifo empties 102 ands r5, r5, #(1<<10) @ wait until push fifo empties
103 beq 1b 103 beq 1b
104 104
105 ldmfd sp!, {r4-r8, pc} 105 ldmfd sp!, {r4-r7, pc}
106 .size lcd_grey_data,.-lcd_grey_data 106 .size lcd_grey_data,.-lcd_grey_data
diff --git a/firmware/target/arm/ata-as-arm.S b/firmware/target/arm/ata-as-arm.S
index 31b753c421..c1475c0a5a 100644
--- a/firmware/target/arm/ata-as-arm.S
+++ b/firmware/target/arm/ata-as-arm.S
@@ -56,11 +56,11 @@
56 * r0 - current address 56 * r0 - current address
57 * r1 - word count 57 * r1 - word count
58 * r2 - ata port 58 * r2 - ata port
59 * r3..r6, lr - read buffers 59 * r3..r5, r12, lr - read buffers
60 */ 60 */
61 61
62copy_read_sectors: 62copy_read_sectors:
63 stmfd sp!, {r4, r5, r6, lr} 63 stmfd sp!, {r4, r5, lr}
64 ldr r2, =.ata_port 64 ldr r2, =.ata_port
65 tst r0, #1 /* 16 bit aligned? */ 65 tst r0, #1 /* 16 bit aligned? */
66 beq .r_aligned 66 beq .r_aligned
@@ -92,16 +92,16 @@ copy_read_sectors:
92 ldrh r5, [r2] 92 ldrh r5, [r2]
93 orr r4, r4, r5, lsl #24 93 orr r4, r4, r5, lsl #24
94 mov r5, r5, lsr #8 94 mov r5, r5, lsr #8
95 ldrh r6, [r2] 95 ldrh r12, [r2]
96 orr r5, r5, r6, lsl #8 96 orr r5, r5, r12, lsl #8
97 ldrh r6, [r2] 97 ldrh r12, [r2]
98 orr r5, r5, r6, lsl #24 98 orr r5, r5, r12, lsl #24
99 mov r6, r6, lsr #8 99 mov r12, r12, lsr #8
100 ldrh lr, [r2] 100 ldrh lr, [r2]
101 orr r6, r6, lr, lsl #8 101 orr r12, r12, lr, lsl #8
102 ldrh lr, [r2] 102 ldrh lr, [r2]
103 orr r6, r6, lr, lsl #24 103 orr r12, r12, lr, lsl #24
104 stmia r0!, {r3, r4, r5, r6} 104 stmia r0!, {r3, r4, r5, r12}
105 mov r3, lr, lsr #8 105 mov r3, lr, lsr #8
106 subs r1, r1, #8 /* 8 or more halfwords left? */ 106 subs r1, r1, #8 /* 8 or more halfwords left? */
107 bge .r_loop_u 107 bge .r_loop_u
@@ -140,7 +140,7 @@ copy_read_sectors:
140 140
141 strb r3, [r0], #1 /* store final byte */ 141 strb r3, [r0], #1 /* store final byte */
142 142
143 ldmfd sp!, {r4, r5, r6, pc} 143 ldmfd sp!, {r4, r5, pc}
144 144
145 /* 16-bit aligned */ 145 /* 16-bit aligned */
146.r_aligned: 146.r_aligned:
@@ -158,12 +158,12 @@ copy_read_sectors:
158 ldrh r5, [r2] 158 ldrh r5, [r2]
159 orr r4, r4, r5, lsl #16 159 orr r4, r4, r5, lsl #16
160 ldrh r5, [r2] 160 ldrh r5, [r2]
161 ldrh r6, [r2] 161 ldrh r12, [r2]
162 orr r5, r5, r6, lsl #16 162 orr r5, r5, r12, lsl #16
163 ldrh r6, [r2] 163 ldrh r12, [r2]
164 ldrh lr, [r2] 164 ldrh lr, [r2]
165 orr r6, r6, lr, lsl #16 165 orr r12, r12, lr, lsl #16
166 stmia r0!, {r3, r4, r5, r6} 166 stmia r0!, {r3, r4, r5, r12}
167 subs r1, r1, #8 /* 8 or more halfwords left? */ 167 subs r1, r1, #8 /* 8 or more halfwords left? */
168 bge .r_loop_a 168 bge .r_loop_a
169 169
@@ -189,7 +189,7 @@ copy_read_sectors:
189 ldrneh r3, [r2] 189 ldrneh r3, [r2]
190 strneh r3, [r0], #2 190 strneh r3, [r0], #2
191 191
192 ldmfd sp!, {r4, r5, r6, pc} 192 ldmfd sp!, {r4, r5, pc}
193 193
194.r_end: 194.r_end:
195 .size copy_read_sectors,.r_end-copy_read_sectors 195 .size copy_read_sectors,.r_end-copy_read_sectors
@@ -210,11 +210,11 @@ copy_read_sectors:
210 * r0 - current address 210 * r0 - current address
211 * r1 - word count 211 * r1 - word count
212 * r2 - ata port 212 * r2 - ata port
213 * r3..r6, lr - read buffers 213 * r3..r5, r12, lr - read buffers
214 */ 214 */
215 215
216copy_write_sectors: 216copy_write_sectors:
217 stmfd sp!, {r4, r5, r6, lr} 217 stmfd sp!, {r4, r5, lr}
218 ldr r2, =.ata_port 218 ldr r2, =.ata_port
219 tst r0, #1 /* 16 bit aligned? */ 219 tst r0, #1 /* 16 bit aligned? */
220 beq .w_aligned 220 beq .w_aligned
@@ -234,7 +234,7 @@ copy_write_sectors:
234 234
235 sub r1, r1, #8 /* adjust for zero-check and doing 8 halfwords/loop */ 235 sub r1, r1, #8 /* adjust for zero-check and doing 8 halfwords/loop */
236.w_loop_u: 236.w_loop_u:
237 ldmia r0!, {r4, r5, r6, lr} 237 ldmia r0!, {r4, r5, r12, lr}
238 orr r3, r3, r4, lsl #8 /* Load 4 words at once and decompose them */ 238 orr r3, r3, r4, lsl #8 /* Load 4 words at once and decompose them */
239 strh r3, [r2] /* into 8 halfwords in a way that the words */ 239 strh r3, [r2] /* into 8 halfwords in a way that the words */
240 mov r3, r3, lsr #16 /* are shifted by 8 bits, putting the high */ 240 mov r3, r3, lsr #16 /* are shifted by 8 bits, putting the high */
@@ -245,15 +245,15 @@ copy_write_sectors:
245 mov r4, r4, lsr #16 245 mov r4, r4, lsr #16
246 strh r4, [r2] 246 strh r4, [r2]
247 mov r5, r5, lsr #24 247 mov r5, r5, lsr #24
248 orr r5, r5, r6, lsl #8 248 orr r5, r5, r12, lsl #8
249 strh r5, [r2] 249 strh r5, [r2]
250 mov r5, r5, lsr #16 250 mov r5, r5, lsr #16
251 strh r5, [r2] 251 strh r5, [r2]
252 mov r6, r6, lsr #24 252 mov r12, r12, lsr #24
253 orr r6, r6, lr, lsl #8 253 orr r12, r12, lr, lsl #8
254 strh r6, [r2] 254 strh r12, [r2]
255 mov r6, r6, lsr #16 255 mov r12, r12, lsr #16
256 strh r6, [r2] 256 strh r12, [r2]
257 mov r3, lr, lsr #24 257 mov r3, lr, lsr #24
258 subs r1, r1, #8 /* 8 or more halfwords left? */ 258 subs r1, r1, #8 /* 8 or more halfwords left? */
259 bge .w_loop_u 259 bge .w_loop_u
@@ -294,7 +294,7 @@ copy_write_sectors:
294 orr r3, r3, r4, lsl #8 294 orr r3, r3, r4, lsl #8
295 strh r3, [r2] /* write final halfword */ 295 strh r3, [r2] /* write final halfword */
296 296
297 ldmfd sp!, {r4, r5, r6, pc} 297 ldmfd sp!, {r4, r5, pc}
298 298
299 /* 16-bit aligned */ 299 /* 16-bit aligned */
300.w_aligned: 300.w_aligned:
@@ -305,7 +305,7 @@ copy_write_sectors:
305 305
306 sub r1, r1, #8 /* adjust for zero-check and doing 8 halfwords/loop */ 306 sub r1, r1, #8 /* adjust for zero-check and doing 8 halfwords/loop */
307.w_loop_a: 307.w_loop_a:
308 ldmia r0!, {r3, r4, r5, r6} 308 ldmia r0!, {r3, r4, r5, r12}
309 strh r3, [r2] /* Load 4 words and decompose them into */ 309 strh r3, [r2] /* Load 4 words and decompose them into */
310 mov r3, r3, lsr #16 /* 2 halfwords each, and write those. */ 310 mov r3, r3, lsr #16 /* 2 halfwords each, and write those. */
311 strh r3, [r2] 311 strh r3, [r2]
@@ -315,9 +315,9 @@ copy_write_sectors:
315 strh r5, [r2] 315 strh r5, [r2]
316 mov r5, r5, lsr #16 316 mov r5, r5, lsr #16
317 strh r5, [r2] 317 strh r5, [r2]
318 strh r6, [r2] 318 strh r12, [r2]
319 mov r6, r6, lsr #16 319 mov r12, r12, lsr #16
320 strh r6, [r2] 320 strh r12, [r2]
321 subs r1, r1, #8 /* 8 or more halfwords left? */ 321 subs r1, r1, #8 /* 8 or more halfwords left? */
322 bge .w_loop_a 322 bge .w_loop_a
323 323
@@ -343,7 +343,7 @@ copy_write_sectors:
343 ldrneh r3, [r0], #2 343 ldrneh r3, [r0], #2
344 strneh r3, [r2] 344 strneh r3, [r2]
345 345
346 ldmfd sp!, {r4, r5, r6, pc} 346 ldmfd sp!, {r4, r5, pc}
347 347
348.w_end: 348.w_end:
349 .size copy_write_sectors,.w_end-copy_write_sectors 349 .size copy_write_sectors,.w_end-copy_write_sectors
diff --git a/firmware/target/arm/ipod/lcd-as-gray.S b/firmware/target/arm/ipod/lcd-as-gray.S
index a066e55a05..b6878a1a78 100644
--- a/firmware/target/arm/ipod/lcd-as-gray.S
+++ b/firmware/target/arm/ipod/lcd-as-gray.S
@@ -34,8 +34,7 @@
34 .type lcd_write_data,%function 34 .type lcd_write_data,%function
35 35
36lcd_write_data: 36lcd_write_data:
37 str lr, [sp, #-4]! 37 ldr r12, =LCD1_BASE
38 ldr lr, =LCD1_BASE
39 38
40.loop: 39.loop:
41 ldrb r2, [r0], #1 40 ldrb r2, [r0], #1
@@ -45,29 +44,29 @@ lcd_write_data:
45 orr r2, r3, r2, lsl #8 44 orr r2, r3, r2, lsl #8
46 orr r2, r2, #0x760000 45 orr r2, r2, #0x760000
471: 461:
48 ldr r3, [lr] 47 ldr r3, [r12]
49 tst r3, #LCD1_BUSY_MASK 48 tst r3, #LCD1_BUSY_MASK
50 bne 1b 49 bne 1b
51 str r2, [lr, #0x08] 50 str r2, [r12, #0x08]
52#else 51#else
531: 521:
54 ldr r3, [lr] 53 ldr r3, [r12]
55 tst r3, #LCD1_BUSY_MASK 54 tst r3, #LCD1_BUSY_MASK
56 bne 1b 55 bne 1b
57 str r2, [lr, #0x10] 56 str r2, [r12, #0x10]
58 57
59 ldrb r2, [r0], #1 58 ldrb r2, [r0], #1
601: 591:
61 ldr r3, [lr] 60 ldr r3, [r12]
62 tst r3, #LCD1_BUSY_MASK 61 tst r3, #LCD1_BUSY_MASK
63 bne 1b 62 bne 1b
64 str r2, [lr, #0x10] 63 str r2, [r12, #0x10]
65#endif 64#endif
66 65
67 subs r1, r1, #1 66 subs r1, r1, #1
68 bne .loop 67 bne .loop
69 68
70 ldr pc, [sp], #4 69 bx lr
71 .size lcd_write_data,.-lcd_write_data 70 .size lcd_write_data,.-lcd_write_data
72 71
73 72
@@ -77,9 +76,9 @@ lcd_write_data:
77 .type lcd_write_data_shifted,%function 76 .type lcd_write_data_shifted,%function
78 77
79lcd_write_data_shifted: 78lcd_write_data_shifted:
80 stmfd sp!, {r4, r5, lr} 79 stmfd sp!, {r4, lr}
81 ldr lr, =LCD1_BASE 80 ldr lr, =LCD1_BASE
82 mov r5, #0x760000 81 mov r12, #0x760000
83 ldrb r2, [r0], #1 82 ldrb r2, [r0], #1
84 83
85.sloop: 84.sloop:
@@ -88,7 +87,7 @@ lcd_write_data_shifted:
88 ldrb r3, [r0], #1 87 ldrb r3, [r0], #1
89 orr r2, r3, r2, lsl #8 88 orr r2, r3, r2, lsl #8
90 mov r4, r2, lsl #12 89 mov r4, r2, lsl #12
91 orr r4, r5, r4, lsr #16 90 orr r4, r12, r4, lsr #16
921: 911:
93 ldr r3, [lr] 92 ldr r3, [lr]
94 tst r3, #LCD1_BUSY_MASK 93 tst r3, #LCD1_BUSY_MASK
@@ -98,7 +97,7 @@ lcd_write_data_shifted:
98 subs r1, r1, #1 97 subs r1, r1, #1
99 bne .sloop 98 bne .sloop
100 99
101 ldmfd sp!, {r4, r5, pc} 100 ldmfd sp!, {r4, pc}
102 .size lcd_write_data_shifted,.-lcd_write_data_shifted 101 .size lcd_write_data_shifted,.-lcd_write_data_shifted
103 102
104#elif defined IPOD_MINI 103#elif defined IPOD_MINI
@@ -107,33 +106,33 @@ lcd_write_data_shifted:
107 .type lcd_write_data_shifted,%function 106 .type lcd_write_data_shifted,%function
108 107
109lcd_write_data_shifted: 108lcd_write_data_shifted:
110 stmfd sp!, {r4, lr} 109 str lr, [sp, #-4]!
111 ldr lr, =LCD1_BASE 110 ldr lr, =LCD1_BASE
112 ldrb r2, [r0], #1 111 ldrb r2, [r0], #1
113 112
114.sloop: 113.sloop:
115 ldrb r3, [r0], #1 114 ldrb r3, [r0], #1
116 orr r2, r3, r2, lsl #8 115 orr r2, r3, r2, lsl #8
117 mov r4, r2, lsr #4 116 mov r12, r2, lsr #4
1181: 1171:
119 ldr r3, [lr] 118 ldr r3, [lr]
120 tst r3, #LCD1_BUSY_MASK 119 tst r3, #LCD1_BUSY_MASK
121 bne 1b 120 bne 1b
122 str r4, [lr, #0x10] 121 str r12, [lr, #0x10]
123 122
124 ldrb r3, [r0], #1 123 ldrb r3, [r0], #1
125 orr r2, r3, r2, lsl #8 124 orr r2, r3, r2, lsl #8
126 mov r4, r2, lsr #4 125 mov r12, r2, lsr #4
1271: 1261:
128 ldr r3, [lr] 127 ldr r3, [lr]
129 tst r3, #LCD1_BUSY_MASK 128 tst r3, #LCD1_BUSY_MASK
130 bne 1b 129 bne 1b
131 str r4, [lr, #0x10] 130 str r12, [lr, #0x10]
132 131
133 subs r1, r1, #1 132 subs r1, r1, #1
134 bne .sloop 133 bne .sloop
135 134
136 ldmfd sp!, {r4, pc} 135 ldr pc, [sp], #4
137 .size lcd_write_data_shifted,.-lcd_write_data_shifted 136 .size lcd_write_data_shifted,.-lcd_write_data_shifted
138 137
139#endif 138#endif
@@ -142,18 +141,18 @@ lcd_write_data_shifted:
142 .type lcd_mono_data,%function 141 .type lcd_mono_data,%function
143 142
144lcd_mono_data: 143lcd_mono_data:
145 stmfd sp!, {r4, r5, lr} 144 stmfd sp!, {r4, lr}
146 ldr lr, =LCD1_BASE 145 ldr lr, =LCD1_BASE
147 adr r5, .dibits 146 adr r12, .dibits
148 147
149.mloop: 148.mloop:
150 ldrb r2, [r0], #1 149 ldrb r2, [r0], #1
151 mov r3, r2, lsr #4 150 mov r3, r2, lsr #4
152 ldrb r4, [r5, r3] 151 ldrb r4, [r12, r3]
153 152
154#ifdef IPOD_MINI2G 153#ifdef IPOD_MINI2G
155 and r3, r2, #0x0f 154 and r3, r2, #0x0f
156 ldrb r3, [r5, r3] 155 ldrb r3, [r12, r3]
157 orr r4, r3, r4, lsl #8 156 orr r4, r3, r4, lsl #8
158 orr r4, r4, #0x760000 157 orr r4, r4, #0x760000
1591: 1581:
@@ -169,7 +168,7 @@ lcd_mono_data:
169 str r4, [lr, #0x10] 168 str r4, [lr, #0x10]
170 169
171 and r3, r2, #0x0f 170 and r3, r2, #0x0f
172 ldrb r4, [r5, r3] 171 ldrb r4, [r12, r3]
1731: 1721:
174 ldr r3, [lr] 173 ldr r3, [lr]
175 tst r3, #LCD1_BUSY_MASK 174 tst r3, #LCD1_BUSY_MASK
@@ -180,7 +179,7 @@ lcd_mono_data:
180 subs r1, r1, #1 179 subs r1, r1, #1
181 bne .mloop 180 bne .mloop
182 181
183 ldmfd sp!, {r4, r5, pc} 182 ldmfd sp!, {r4, pc}
184 183
185.dibits: 184.dibits:
186 .byte 0x00, 0x03, 0x0C, 0x0F, 0x30, 0x33, 0x3C, 0x3F 185 .byte 0x00, 0x03, 0x0C, 0x0F, 0x30, 0x33, 0x3C, 0x3F
@@ -203,16 +202,16 @@ lcd_mono_data:
203 * Register usage: 202 * Register usage:
204 * r3/r4 - current block of phases 203 * r3/r4 - current block of phases
205 * r5/r6 - current block of values 204 * r5/r6 - current block of values
206 * r7 - lcd data accumulator 205 * r7 - lcd data accumulator
207 * r8 - phase signs mask 206 * r12 - phase signs mask
208 * lr - lcd bridge address 207 * lr - lcd bridge address
209 */ 208 */
210 209
211lcd_grey_data: 210lcd_grey_data:
212 stmfd sp!, {r4-r8, lr} 211 stmfd sp!, {r4-r7, lr}
213 mov r8, #0x80 212 mov r12, #0x80
214 orr r8, r8, r8, lsl #8 213 orr r12, r12, r12, lsl #8
215 orr r8, r8, r8, lsl #16 214 orr r12, r12, r12, lsl #16
216 ldr lr, =LCD1_BASE 215 ldr lr, =LCD1_BASE
217 216
218.greyloop: 217.greyloop:
@@ -229,7 +228,7 @@ lcd_grey_data:
229 orreq r7, r7, #0x0c00 228 orreq r7, r7, #0x0c00
230 tst r3, #0x80000000 229 tst r3, #0x80000000
231 orreq r7, r7, #0x0300 230 orreq r7, r7, #0x0300
232 bic r3, r3, r8 231 bic r3, r3, r12
233 add r3, r3, r5 232 add r3, r3, r5
234#else /* Parallel bridge mode */ 233#else /* Parallel bridge mode */
235 mov r7, #0 234 mov r7, #0
@@ -241,7 +240,7 @@ lcd_grey_data:
241 orreq r7, r7, #0x0c 240 orreq r7, r7, #0x0c
242 tst r3, #0x80000000 241 tst r3, #0x80000000
243 orreq r7, r7, #0x03 242 orreq r7, r7, #0x03
244 bic r3, r3, r8 243 bic r3, r3, r12
245 add r3, r3, r5 244 add r3, r3, r5
246 245
2471: 2461:
@@ -261,7 +260,7 @@ lcd_grey_data:
261 orreq r7, r7, #0x0c 260 orreq r7, r7, #0x0c
262 tst r4, #0x80000000 261 tst r4, #0x80000000
263 orreq r7, r7, #0x03 262 orreq r7, r7, #0x03
264 bic r4, r4, r8 263 bic r4, r4, r12
265 add r4, r4, r6 264 add r4, r4, r6
266 265
267 stmia r1!, {r3-r4} 266 stmia r1!, {r3-r4}
@@ -279,6 +278,6 @@ lcd_grey_data:
279 subs r2, r2, #1 278 subs r2, r2, #1
280 bne .greyloop 279 bne .greyloop
281 280
282 ldmfd sp!, {r4-r8, pc} 281 ldmfd sp!, {r4-r7, pc}
283 .size lcd_grey_data,.-lcd_grey_data 282 .size lcd_grey_data,.-lcd_grey_data
284 283
diff --git a/firmware/target/arm/ipod/video/lcd-as-video.S b/firmware/target/arm/ipod/video/lcd-as-video.S
index e14b9dafb8..4b0cabcec2 100644
--- a/firmware/target/arm/ipod/video/lcd-as-video.S
+++ b/firmware/target/arm/ipod/video/lcd-as-video.S
@@ -32,22 +32,22 @@
32 .type lcd_write_data, %function 32 .type lcd_write_data, %function
33 /* r0 = addr, must be aligned */ 33 /* r0 = addr, must be aligned */
34lcd_write_data: /* r1 = pixel count, must be even */ 34lcd_write_data: /* r1 = pixel count, must be even */
35 stmfd sp!, {r4-r5, lr} 35 stmfd sp!, {r4, lr}
36 mov lr, #0x30000000 /* LCD data port */ 36 mov lr, #0x30000000 /* LCD data port */
37 37
38 subs r1, r1, #16 38 subs r1, r1, #16
39.loop16: 39.loop16:
40 ldmgeia r0!, {r2-r5} 40 ldmgeia r0!, {r2-r4, r12}
41 stmgeia lr, {r2-r5} 41 stmgeia lr, {r2-r4, r12}
42 ldmgeia r0!, {r2-r5} 42 ldmgeia r0!, {r2-r4, r12}
43 stmgeia lr, {r2-r5} 43 stmgeia lr, {r2-r4, r12}
44 subges r1, r1, #16 44 subges r1, r1, #16
45 bge .loop16 45 bge .loop16
46 46
47 /* no need to correct the count, we're just checking bits from now */ 47 /* no need to correct the count, we're just checking bits from now */
48 tst r1, #8 48 tst r1, #8
49 ldmneia r0!, {r2-r5} 49 ldmneia r0!, {r2-r4, r12}
50 stmneia lr, {r2-r5} 50 stmneia lr, {r2-r4, r12}
51 tst r1, #4 51 tst r1, #4
52 ldmneia r0!, {r2-r3} 52 ldmneia r0!, {r2-r3}
53 stmneia lr, {r2-r3} 53 stmneia lr, {r2-r3}
@@ -55,7 +55,7 @@ lcd_write_data: /* r1 = pixel count, must be even */
55 ldrne r3, [r0], #4 55 ldrne r3, [r0], #4
56 strne r3, [lr] 56 strne r3, [lr]
57 57
58 ldmfd sp!, {r4-r5, pc} 58 ldmfd sp!, {r4, pc}
59 59
60/**************************************************************************** 60/****************************************************************************
61 * extern void lcd_write_yuv420_lines(unsigned char const * const src[3], 61 * extern void lcd_write_yuv420_lines(unsigned char const * const src[3],
@@ -87,10 +87,10 @@ lcd_write_yuv420_lines:
87 /* r1 = dst = bcmaddr */ 87 /* r1 = dst = bcmaddr */
88 /* r2 = width */ 88 /* r2 = width */
89 /* r3 = stride */ 89 /* r3 = stride */
90 stmfd sp!, { r4-r11, lr } /* save non-scratch */ 90 stmfd sp!, { r4-r10, lr } /* save non-scratch */
91 ldmia r0, { r9-r11 } /* r9 = yuv_src[0] = Y'_p */ 91 ldmia r0, { r9, r10, r12 } /* r9 = yuv_src[0] = Y'_p */
92 /* r10 = yuv_src[1] = Cb_p */ 92 /* r10 = yuv_src[1] = Cb_p */
93 /* r11 = yuv_src[2] = Cr_p */ 93 /* r12 = yuv_src[2] = Cr_p */
94 add r3, r9, r3 /* r3 = &ysrc[stride] */ 94 add r3, r9, r3 /* r3 = &ysrc[stride] */
95 add r4, r2, r2, asr #1 /* chroma buffer lenght = width/2 *3 */ 95 add r4, r2, r2, asr #1 /* chroma buffer lenght = width/2 *3 */
96 mov r4, r4, asl #2 /* use words for str/ldm possibility */ 96 mov r4, r4, asl #2 /* use words for str/ldm possibility */
@@ -116,7 +116,7 @@ lcd_write_yuv420_lines:
11610: /* loop start */ 11610: /* loop start */
117 117
118 ldrb r0, [r10], #1 /* r0 = *usrc++ = *Cb_p++ */ 118 ldrb r0, [r10], #1 /* r0 = *usrc++ = *Cb_p++ */
119 ldrb r1, [r11], #1 /* r1 = *vsrc++ = *Cr_p++ */ 119 ldrb r1, [r12], #1 /* r1 = *vsrc++ = *Cr_p++ */
120 120
121 sub r0, r0, #128 /* r0 = Cb-128 */ 121 sub r0, r0, #128 /* r0 = Cb-128 */
122 sub r1, r1, #128 /* r1 = Cr-128 */ 122 sub r1, r1, #128 /* r1 = Cr-128 */
@@ -289,7 +289,7 @@ lcd_write_yuv420_lines:
289 289
290 ldr r3, [sp, #12] 290 ldr r3, [sp, #12]
291 add sp, sp, r3 /* deallocate buffer */ 291 add sp, sp, r3 /* deallocate buffer */
292 ldmfd sp!, { r4-r11, pc } /* restore registers */ 292 ldmfd sp!, { r4-r10, pc } /* restore registers */
293 293
294 .ltorg 294 .ltorg
295 .size lcd_write_yuv420_lines, .-lcd_write_yuv420_lines 295 .size lcd_write_yuv420_lines, .-lcd_write_yuv420_lines
diff --git a/firmware/target/arm/iriver/h10/lcd-as-h10.S b/firmware/target/arm/iriver/h10/lcd-as-h10.S
index ba6c876d44..e99eee50c9 100644
--- a/firmware/target/arm/iriver/h10/lcd-as-h10.S
+++ b/firmware/target/arm/iriver/h10/lcd-as-h10.S
@@ -49,7 +49,7 @@ lcd_write_yuv420_lines:
49 @ r0 = yuv_src 49 @ r0 = yuv_src
50 @ r1 = width 50 @ r1 = width
51 @ r2 = stride 51 @ r2 = stride
52 stmfd sp!, { r4-r12, lr } @ save non-scratch 52 stmfd sp!, { r4-r11, lr } @ save non-scratch
53 ldmia r0, { r4, r5, r6 } @ r4 = yuv_src[0] = Y'_p 53 ldmia r0, { r4, r5, r6 } @ r4 = yuv_src[0] = Y'_p
54 @ r5 = yuv_src[1] = Cb_p 54 @ r5 = yuv_src[1] = Cb_p
55 @ r6 = yuv_src[2] = Cr_p 55 @ r6 = yuv_src[2] = Cr_p
@@ -232,7 +232,7 @@ lcd_write_yuv420_lines:
232 subs r1, r1, #2 @ subtract block from width 232 subs r1, r1, #2 @ subtract block from width
233 bgt 10b @ loop line @ 233 bgt 10b @ loop line @
234 @ 234 @
235 ldmfd sp!, { r4-r12, pc } @ restore registers and return 235 ldmfd sp!, { r4-r11, pc } @ restore registers and return
236 .ltorg @ dump constant pool 236 .ltorg @ dump constant pool
237 .size lcd_write_yuv420_lines, .-lcd_write_yuv420_lines 237 .size lcd_write_yuv420_lines, .-lcd_write_yuv420_lines
238 238
@@ -273,7 +273,7 @@ lcd_write_yuv420_lines_odither:
273 @ r2 = stride 273 @ r2 = stride
274 @ r3 = x_screen 274 @ r3 = x_screen
275 @ [sp] = y_screen 275 @ [sp] = y_screen
276 stmfd sp!, { r4-r12, lr } @ save non-scratch 276 stmfd sp!, { r4-r11, lr } @ save non-scratch
277 ldmia r0, { r4, r5, r6 } @ r4 = yuv_src[0] = Y'_p 277 ldmia r0, { r4, r5, r6 } @ r4 = yuv_src[0] = Y'_p
278 @ r5 = yuv_src[1] = Cb_p 278 @ r5 = yuv_src[1] = Cb_p
279 @ r6 = yuv_src[2] = Cr_p 279 @ r6 = yuv_src[2] = Cr_p
@@ -533,6 +533,6 @@ lcd_write_yuv420_lines_odither:
533 subs r1, r1, #2 @ subtract block from width 533 subs r1, r1, #2 @ subtract block from width
534 bgt 10b @ loop line @ 534 bgt 10b @ loop line @
535 @ 535 @
536 ldmfd sp!, { r4-r12, pc } @ restore registers and return 536 ldmfd sp!, { r4-r11, pc } @ restore registers and return
537 .ltorg @ dump constant pool 537 .ltorg @ dump constant pool
538 .size lcd_write_yuv420_lines_odither, .-lcd_write_yuv420_lines_odither 538 .size lcd_write_yuv420_lines_odither, .-lcd_write_yuv420_lines_odither
diff --git a/firmware/target/arm/lcd-as-memframe.S b/firmware/target/arm/lcd-as-memframe.S
index 84f549036f..2d0aff937f 100644
--- a/firmware/target/arm/lcd-as-memframe.S
+++ b/firmware/target/arm/lcd-as-memframe.S
@@ -37,7 +37,7 @@
37 @ r2 = width 37 @ r2 = width
38 @ r3 = height 38 @ r3 = height
39lcd_copy_buffer_rect: @ 39lcd_copy_buffer_rect: @
40 stmfd sp!, { r4-r12, lr } @ save non-scratch regs 40 stmfd sp!, { r4-r11, lr } @ save non-scratch regs
41 mov r5, r2 @ r5 = cached width 41 mov r5, r2 @ r5 = cached width
42 rsb r4, r2, #LCD_WIDTH @ r4 = LCD_WIDTH - width 42 rsb r4, r2, #LCD_WIDTH @ r4 = LCD_WIDTH - width
4310: @ copy line @ 4310: @ copy line @
@@ -101,7 +101,7 @@ lcd_copy_buffer_rect: @
101 add r0, r0, r4, lsl #1 @ 101 add r0, r0, r4, lsl #1 @
102 subs r3, r3, #1 @ next line 102 subs r3, r3, #1 @ next line
103 bgt 10b @ copy line @ 103 bgt 10b @ copy line @
104 ldmfd sp!, { r4-r12, pc } @ restore regs and return 104 ldmfd sp!, { r4-r11, pc } @ restore regs and return
105 .ltorg @ dump constant pool 105 .ltorg @ dump constant pool
106 .size lcd_copy_buffer_rect, .-lcd_copy_buffer_rect 106 .size lcd_copy_buffer_rect, .-lcd_copy_buffer_rect
107 107
@@ -132,7 +132,7 @@ lcd_write_yuv420_lines:
132 @ r1 = yuv_src 132 @ r1 = yuv_src
133 @ r2 = width 133 @ r2 = width
134 @ r3 = stride 134 @ r3 = stride
135 stmfd sp!, { r4-r12 } @ save non-scratch 135 stmfd sp!, { r4-r10, lr } @ save non-scratch
136 ldmia r1, { r4, r5, r6 } @ r4 = yuv_src[0] = Y'_p 136 ldmia r1, { r4, r5, r6 } @ r4 = yuv_src[0] = Y'_p
137 @ r5 = yuv_src[1] = Cb_p 137 @ r5 = yuv_src[1] = Cb_p
138 @ r6 = yuv_src[2] = Cr_p 138 @ r6 = yuv_src[2] = Cr_p
@@ -155,9 +155,9 @@ lcd_write_yuv420_lines:
155 add r10, r10, r8, asl #3 @ 155 add r10, r10, r8, asl #3 @
156 add r10, r10, r8, asl #4 @ 156 add r10, r10, r8, asl #4 @
157 @ 157 @
158 add r11, r9, r9, asl #2 @ r9 = Cr*101 158 add lr, r9, r9, asl #2 @ r9 = Cr*101
159 add r11, r11, r9, asl #5 @ 159 add lr, lr, r9, asl #5 @
160 add r9, r11, r9, asl #6 @ 160 add r9, lr, r9, asl #6 @
161 @ 161 @
162 add r8, r8, #2 @ r8 = bu = (Cb*128 + 128) >> 8 162 add r8, r8, #2 @ r8 = bu = (Cb*128 + 128) >> 8
163 mov r8, r8, asr #2 @ 163 mov r8, r8, asr #2 @
@@ -167,19 +167,19 @@ lcd_write_yuv420_lines:
167 mov r10, r10, asr #8 @ 167 mov r10, r10, asr #8 @
168 @ compute R, G, and B 168 @ compute R, G, and B
169 add r1, r8, r7, asr #8 @ r1 = b = (Y >> 9) + bu 169 add r1, r8, r7, asr #8 @ r1 = b = (Y >> 9) + bu
170 add r11, r9, r7, asr #8 @ r11 = r = (Y >> 9) + rv 170 add lr, r9, r7, asr #8 @ lr = r = (Y >> 9) + rv
171 add r7, r10, r7, asr #7 @ r7 = g = (Y >> 8) + guv 171 add r7, r10, r7, asr #7 @ r7 = g = (Y >> 8) + guv
172 @ 172 @
173 orr r12, r1, r11 @ check if clamping is needed... 173 orr r12, r1, lr @ check if clamping is needed...
174 orr r12, r12, r7, asr #1 @ ...at all 174 orr r12, r12, r7, asr #1 @ ...at all
175 cmp r12, #31 @ 175 cmp r12, #31 @
176 bls 15f @ no clamp @ 176 bls 15f @ no clamp @
177 cmp r1, #31 @ clamp b 177 cmp r1, #31 @ clamp b
178 mvnhi r1, r1, asr #31 @ 178 mvnhi r1, r1, asr #31 @
179 andhi r1, r1, #31 @ 179 andhi r1, r1, #31 @
180 cmp r11, #31 @ clamp r 180 cmp lr, #31 @ clamp r
181 mvnhi r11, r11, asr #31 @ 181 mvnhi lr, lr, asr #31 @
182 andhi r11, r11, #31 @ 182 andhi lr, lr, #31 @
183 cmp r7, #63 @ clamp g 183 cmp r7, #63 @ clamp g
184 mvnhi r7, r7, asr #31 @ 184 mvnhi r7, r7, asr #31 @
185 andhi r7, r7, #63 @ 185 andhi r7, r7, #63 @
@@ -188,7 +188,7 @@ lcd_write_yuv420_lines:
188 ldrb r12, [r4, r3] @ r12 = Y' = *(Y'_p + stride) 188 ldrb r12, [r4, r3] @ r12 = Y' = *(Y'_p + stride)
189 @ 189 @
190 orr r1, r1, r7, lsl #5 @ r4 |= (g << 5) 190 orr r1, r1, r7, lsl #5 @ r4 |= (g << 5)
191 orr r1, r1, r11, lsl #11 @ r4 = b | (r << 11) 191 orr r1, r1, lr, lsl #11 @ r4 = b | (r << 11)
192 192
193#if LCD_WIDTH >= LCD_HEIGHT 193#if LCD_WIDTH >= LCD_HEIGHT
194 strh r1, [r0] @ 194 strh r1, [r0] @
@@ -203,19 +203,19 @@ lcd_write_yuv420_lines:
203 add r7, r12, r7, asl #5 @ 203 add r7, r12, r7, asl #5 @
204 @ compute R, G, and B 204 @ compute R, G, and B
205 add r1, r8, r7, asr #8 @ r1 = b = (Y >> 9) + bu 205 add r1, r8, r7, asr #8 @ r1 = b = (Y >> 9) + bu
206 add r11, r9, r7, asr #8 @ r11 = r = (Y >> 9) + rv 206 add lr, r9, r7, asr #8 @ lr = r = (Y >> 9) + rv
207 add r7, r10, r7, asr #7 @ r7 = g = (Y >> 8) + guv 207 add r7, r10, r7, asr #7 @ r7 = g = (Y >> 8) + guv
208 @ 208 @
209 orr r12, r1, r11 @ check if clamping is needed... 209 orr r12, r1, lr @ check if clamping is needed...
210 orr r12, r12, r7, asr #1 @ ...at all 210 orr r12, r12, r7, asr #1 @ ...at all
211 cmp r12, #31 @ 211 cmp r12, #31 @
212 bls 15f @ no clamp @ 212 bls 15f @ no clamp @
213 cmp r1, #31 @ clamp b 213 cmp r1, #31 @ clamp b
214 mvnhi r1, r1, asr #31 @ 214 mvnhi r1, r1, asr #31 @
215 andhi r1, r1, #31 @ 215 andhi r1, r1, #31 @
216 cmp r11, #31 @ clamp r 216 cmp lr, #31 @ clamp r
217 mvnhi r11, r11, asr #31 @ 217 mvnhi lr, lr, asr #31 @
218 andhi r11, r11, #31 @ 218 andhi lr, lr, #31 @
219 cmp r7, #63 @ clamp g 219 cmp r7, #63 @ clamp g
220 mvnhi r7, r7, asr #31 @ 220 mvnhi r7, r7, asr #31 @
221 andhi r7, r7, #63 @ 221 andhi r7, r7, #63 @
@@ -223,7 +223,7 @@ lcd_write_yuv420_lines:
223 @ 223 @
224 ldrb r12, [r4], #1 @ r12 = Y' = *(Y'_p++) 224 ldrb r12, [r4], #1 @ r12 = Y' = *(Y'_p++)
225 @ 225 @
226 orr r1, r1, r11, lsl #11 @ r1 = b | (r << 11) 226 orr r1, r1, lr, lsl #11 @ r1 = b | (r << 11)
227 orr r1, r1, r7, lsl #5 @ r1 |= (g << 5) 227 orr r1, r1, r7, lsl #5 @ r1 |= (g << 5)
228 228
229#if LCD_WIDTH >= LCD_HEIGHT 229#if LCD_WIDTH >= LCD_HEIGHT
@@ -242,19 +242,19 @@ lcd_write_yuv420_lines:
242 add r7, r12, r7, asl #5 @ 242 add r7, r12, r7, asl #5 @
243 @ compute R, G, and B 243 @ compute R, G, and B
244 add r1, r8, r7, asr #8 @ r1 = b = (Y >> 9) + bu 244 add r1, r8, r7, asr #8 @ r1 = b = (Y >> 9) + bu
245 add r11, r9, r7, asr #8 @ r11 = r = (Y >> 9) + rv 245 add lr, r9, r7, asr #8 @ lr = r = (Y >> 9) + rv
246 add r7, r10, r7, asr #7 @ r7 = g = (Y >> 8) + guv 246 add r7, r10, r7, asr #7 @ r7 = g = (Y >> 8) + guv
247 @ 247 @
248 orr r12, r1, r11 @ check if clamping is needed... 248 orr r12, r1, lr @ check if clamping is needed...
249 orr r12, r12, r7, asr #1 @ ...at all 249 orr r12, r12, r7, asr #1 @ ...at all
250 cmp r12, #31 @ 250 cmp r12, #31 @
251 bls 15f @ no clamp @ 251 bls 15f @ no clamp @
252 cmp r1, #31 @ clamp b 252 cmp r1, #31 @ clamp b
253 mvnhi r1, r1, asr #31 @ 253 mvnhi r1, r1, asr #31 @
254 andhi r1, r1, #31 @ 254 andhi r1, r1, #31 @
255 cmp r11, #31 @ clamp r 255 cmp lr, #31 @ clamp r
256 mvnhi r11, r11, asr #31 @ 256 mvnhi lr, lr, asr #31 @
257 andhi r11, r11, #31 @ 257 andhi lr, lr, #31 @
258 cmp r7, #63 @ clamp g 258 cmp r7, #63 @ clamp g
259 mvnhi r7, r7, asr #31 @ 259 mvnhi r7, r7, asr #31 @
260 andhi r7, r7, #63 @ 260 andhi r7, r7, #63 @
@@ -263,7 +263,7 @@ lcd_write_yuv420_lines:
263 ldrb r12, [r4, r3] @ r12 = Y' = *(Y'_p + stride) 263 ldrb r12, [r4, r3] @ r12 = Y' = *(Y'_p + stride)
264 @ 264 @
265 orr r1, r1, r7, lsl #5 @ r1 = b | (g << 5) 265 orr r1, r1, r7, lsl #5 @ r1 = b | (g << 5)
266 orr r1, r1, r11, lsl #11 @ r1 |= (r << 11) 266 orr r1, r1, lr, lsl #11 @ r1 |= (r << 11)
267 267
268#if LCD_WIDTH >= LCD_HEIGHT 268#if LCD_WIDTH >= LCD_HEIGHT
269 strh r1, [r0, #2] 269 strh r1, [r0, #2]
@@ -278,25 +278,25 @@ lcd_write_yuv420_lines:
278 add r7, r12, r7, asl #5 @ 278 add r7, r12, r7, asl #5 @
279 @ compute R, G, and B 279 @ compute R, G, and B
280 add r1, r8, r7, asr #8 @ r1 = b = (Y >> 9) + bu 280 add r1, r8, r7, asr #8 @ r1 = b = (Y >> 9) + bu
281 add r11, r9, r7, asr #8 @ r11 = r = (Y >> 9) + rv 281 add lr, r9, r7, asr #8 @ lr = r = (Y >> 9) + rv
282 add r7, r10, r7, asr #7 @ r7 = g = (Y >> 8) + guv 282 add r7, r10, r7, asr #7 @ r7 = g = (Y >> 8) + guv
283 @ 283 @
284 orr r12, r1, r11 @ check if clamping is needed... 284 orr r12, r1, lr @ check if clamping is needed...
285 orr r12, r12, r7, asr #1 @ ...at all 285 orr r12, r12, r7, asr #1 @ ...at all
286 cmp r12, #31 @ 286 cmp r12, #31 @
287 bls 15f @ no clamp @ 287 bls 15f @ no clamp @
288 cmp r1, #31 @ clamp b 288 cmp r1, #31 @ clamp b
289 mvnhi r1, r1, asr #31 @ 289 mvnhi r1, r1, asr #31 @
290 andhi r1, r1, #31 @ 290 andhi r1, r1, #31 @
291 cmp r11, #31 @ clamp r 291 cmp lr, #31 @ clamp r
292 mvnhi r11, r11, asr #31 @ 292 mvnhi lr, lr, asr #31 @
293 andhi r11, r11, #31 @ 293 andhi lr, lr, #31 @
294 cmp r7, #63 @ clamp g 294 cmp r7, #63 @ clamp g
295 mvnhi r7, r7, asr #31 @ 295 mvnhi r7, r7, asr #31 @
296 andhi r7, r7, #63 @ 296 andhi r7, r7, #63 @
29715: @ no clamp @ 29715: @ no clamp @
298 @ 298 @
299 orr r12, r1, r11, lsl #11 @ r12 = b | (r << 11) 299 orr r12, r1, lr, lsl #11 @ r12 = b | (r << 11)
300 orr r12, r12, r7, lsl #5 @ r12 |= (g << 5) 300 orr r12, r12, r7, lsl #5 @ r12 |= (g << 5)
301 301
302#if LCD_WIDTH >= LCD_HEIGHT 302#if LCD_WIDTH >= LCD_HEIGHT
@@ -320,8 +320,7 @@ lcd_write_yuv420_lines:
320 subs r2, r2, #2 @ subtract block from width 320 subs r2, r2, #2 @ subtract block from width
321 bgt 10b @ loop line @ 321 bgt 10b @ loop line @
322 @ 322 @
323 ldmfd sp!, { r4-r12 } @ restore registers and return 323 ldmfd sp!, { r4-r10, pc } @ restore registers and return
324 bx lr @
325 .ltorg @ dump constant pool 324 .ltorg @ dump constant pool
326 .size lcd_write_yuv420_lines, .-lcd_write_yuv420_lines 325 .size lcd_write_yuv420_lines, .-lcd_write_yuv420_lines
327 326
@@ -364,7 +363,7 @@ lcd_write_yuv420_lines_odither:
364 @ r3 = stride 363 @ r3 = stride
365 @ [sp] = x_screen 364 @ [sp] = x_screen
366 @ [sp+4] = y_screen 365 @ [sp+4] = y_screen
367 stmfd sp!, { r4-r12, lr } @ save non-scratch 366 stmfd sp!, { r4-r11, lr } @ save non-scratch
368 ldmia r1, { r4, r5, r6 } @ r4 = yuv_src[0] = Y'_p 367 ldmia r1, { r4, r5, r6 } @ r4 = yuv_src[0] = Y'_p
369 @ r5 = yuv_src[1] = Cb_p 368 @ r5 = yuv_src[1] = Cb_p
370 @ r6 = yuv_src[2] = Cr_p 369 @ r6 = yuv_src[2] = Cr_p
@@ -626,6 +625,6 @@ lcd_write_yuv420_lines_odither:
626 subs r2, r2, #2 @ subtract block from width 625 subs r2, r2, #2 @ subtract block from width
627 bgt 10b @ loop line @ 626 bgt 10b @ loop line @
628 @ 627 @
629 ldmfd sp!, { r4-r12, pc } @ restore registers and return 628 ldmfd sp!, { r4-r11, pc } @ restore registers and return
630 .ltorg @ dump constant pool 629 .ltorg @ dump constant pool
631 .size lcd_write_yuv420_lines_odither, .-lcd_write_yuv420_lines_odither 630 .size lcd_write_yuv420_lines_odither, .-lcd_write_yuv420_lines_odither
diff --git a/firmware/target/arm/olympus/mrobe-100/lcd-as-mr100.S b/firmware/target/arm/olympus/mrobe-100/lcd-as-mr100.S
index 84f47addd8..2aede6d5e7 100644
--- a/firmware/target/arm/olympus/mrobe-100/lcd-as-mr100.S
+++ b/firmware/target/arm/olympus/mrobe-100/lcd-as-mr100.S
@@ -30,21 +30,20 @@
30 .type lcd_write_data,%function 30 .type lcd_write_data,%function
31 31
32lcd_write_data: 32lcd_write_data:
33 str lr, [sp, #-4]! 33 ldr r12, =LCD1_BASE
34 ldr lr, =LCD1_BASE
35 34
36.loop: 35.loop:
37 ldrb r2, [r0], #1 36 ldrb r2, [r0], #1
381: 371:
39 ldr r3, [lr] 38 ldr r3, [r12]
40 tst r3, #LCD1_BUSY_MASK 39 tst r3, #LCD1_BUSY_MASK
41 bne 1b 40 bne 1b
42 str r2, [lr, #0x10] 41 str r2, [r12, #0x10]
43 42
44 subs r1, r1, #1 43 subs r1, r1, #1
45 bne .loop 44 bne .loop
46 45
47 ldr pc, [sp], #4 46 bx lr
48 .size lcd_write_data,.-lcd_write_data 47 .size lcd_write_data,.-lcd_write_data
49 48
50 49
@@ -62,16 +61,16 @@ lcd_write_data:
62 * Register usage: 61 * Register usage:
63 * r3/r4 - current block of phases 62 * r3/r4 - current block of phases
64 * r5/r6 - current block of values 63 * r5/r6 - current block of values
65 * r7 - lcd data accumulator 64 * r7 - lcd data accumulator
66 * r8 - phase signs mask 65 * r12 - phase signs mask
67 * lr - lcd bridge address 66 * lr - lcd bridge address
68 */ 67 */
69 68
70lcd_grey_data: 69lcd_grey_data:
71 stmfd sp!, {r4-r8, lr} 70 stmfd sp!, {r4-r7, lr}
72 mov r8, #0x80 71 mov r12, #0x80
73 orr r8, r8, r8, lsl #8 72 orr r12, r12, r12, lsl #8
74 orr r8, r8, r8, lsl #16 73 orr r12, r12, r12, lsl #16
75 ldr lr, =LCD1_BASE 74 ldr lr, =LCD1_BASE
76 75
77.greyloop: 76.greyloop:
@@ -87,7 +86,7 @@ lcd_grey_data:
87 biceq r7, r7, #0x20 86 biceq r7, r7, #0x20
88 tst r3, #0x80000000 87 tst r3, #0x80000000
89 biceq r7, r7, #0x10 88 biceq r7, r7, #0x10
90 bic r3, r3, r8 89 bic r3, r3, r12
91 add r3, r3, r5 90 add r3, r3, r5
92 91
93 tst r4, #0x80 92 tst r4, #0x80
@@ -98,7 +97,7 @@ lcd_grey_data:
98 biceq r7, r7, #0x02 97 biceq r7, r7, #0x02
99 tst r4, #0x80000000 98 tst r4, #0x80000000
100 biceq r7, r7, #0x01 99 biceq r7, r7, #0x01
101 bic r4, r4, r8 100 bic r4, r4, r12
102 add r4, r4, r6 101 add r4, r4, r6
103 102
104 stmia r1!, {r3-r4} 103 stmia r1!, {r3-r4}
@@ -112,6 +111,6 @@ lcd_grey_data:
112 subs r2, r2, #1 111 subs r2, r2, #1
113 bne .greyloop 112 bne .greyloop
114 113
115 ldmfd sp!, {r4-r8, pc} 114 ldmfd sp!, {r4-r7, pc}
116 .size lcd_grey_data,.-lcd_grey_data 115 .size lcd_grey_data,.-lcd_grey_data
117 116
diff --git a/firmware/target/arm/philips/hdd1630/lcd-as-hdd1630.S b/firmware/target/arm/philips/hdd1630/lcd-as-hdd1630.S
index 8f3d12e727..74327dddaf 100644
--- a/firmware/target/arm/philips/hdd1630/lcd-as-hdd1630.S
+++ b/firmware/target/arm/philips/hdd1630/lcd-as-hdd1630.S
@@ -49,7 +49,7 @@ lcd_write_yuv420_lines:
49 @ r0 = yuv_src 49 @ r0 = yuv_src
50 @ r1 = width 50 @ r1 = width
51 @ r2 = stride 51 @ r2 = stride
52 stmfd sp!, { r4-r12, lr } @ save non-scratch 52 stmfd sp!, { r4-r11, lr } @ save non-scratch
53 ldmia r0, { r4, r5, r6 } @ r4 = yuv_src[0] = Y'_p 53 ldmia r0, { r4, r5, r6 } @ r4 = yuv_src[0] = Y'_p
54 @ r5 = yuv_src[1] = Cb_p 54 @ r5 = yuv_src[1] = Cb_p
55 @ r6 = yuv_src[2] = Cr_p 55 @ r6 = yuv_src[2] = Cr_p
@@ -248,7 +248,7 @@ lcd_write_yuv420_lines:
248 subs r1, r1, #2 @ subtract block from width 248 subs r1, r1, #2 @ subtract block from width
249 bgt 10b @ loop line @ 249 bgt 10b @ loop line @
250 @ 250 @
251 ldmfd sp!, { r4-r12, pc } @ restore registers and return 251 ldmfd sp!, { r4-r11, pc } @ restore registers and return
252 .ltorg @ dump constant pool 252 .ltorg @ dump constant pool
253 .size lcd_write_yuv420_lines, .-lcd_write_yuv420_lines 253 .size lcd_write_yuv420_lines, .-lcd_write_yuv420_lines
254 254
@@ -289,7 +289,7 @@ lcd_write_yuv420_lines_odither:
289 @ r2 = stride 289 @ r2 = stride
290 @ r3 = x_screen 290 @ r3 = x_screen
291 @ [sp] = y_screen 291 @ [sp] = y_screen
292 stmfd sp!, { r4-r12, lr } @ save non-scratch 292 stmfd sp!, { r4-r11, lr } @ save non-scratch
293 ldmia r0, { r4, r5, r6 } @ r4 = yuv_src[0] = Y'_p 293 ldmia r0, { r4, r5, r6 } @ r4 = yuv_src[0] = Y'_p
294 @ r5 = yuv_src[1] = Cb_p 294 @ r5 = yuv_src[1] = Cb_p
295 @ r6 = yuv_src[2] = Cr_p 295 @ r6 = yuv_src[2] = Cr_p
@@ -565,6 +565,6 @@ lcd_write_yuv420_lines_odither:
565 subs r1, r1, #2 @ subtract block from width 565 subs r1, r1, #2 @ subtract block from width
566 bgt 10b @ loop line @ 566 bgt 10b @ loop line @
567 @ 567 @
568 ldmfd sp!, { r4-r12, pc } @ restore registers and return 568 ldmfd sp!, { r4-r11, pc } @ restore registers and return
569 .ltorg @ dump constant pool 569 .ltorg @ dump constant pool
570 .size lcd_write_yuv420_lines_odither, .-lcd_write_yuv420_lines_odither 570 .size lcd_write_yuv420_lines_odither, .-lcd_write_yuv420_lines_odither
diff --git a/firmware/target/arm/samsung/yh820/lcd-as-yh820.S b/firmware/target/arm/samsung/yh820/lcd-as-yh820.S
index e466624d04..7187b83661 100644
--- a/firmware/target/arm/samsung/yh820/lcd-as-yh820.S
+++ b/firmware/target/arm/samsung/yh820/lcd-as-yh820.S
@@ -48,7 +48,7 @@ lcd_write_yuv420_lines:
48 @ r0 = yuv_src 48 @ r0 = yuv_src
49 @ r1 = width 49 @ r1 = width
50 @ r2 = stride 50 @ r2 = stride
51 stmfd sp!, { r4-r12 } @ save non-scratch 51 stmfd sp!, { r4-r10, lr } @ save non-scratch
52 ldmia r0, { r4, r5, r6 } @ r4 = yuv_src[0] = Y'_p 52 ldmia r0, { r4, r5, r6 } @ r4 = yuv_src[0] = Y'_p
53 @ r5 = yuv_src[1] = Cb_p 53 @ r5 = yuv_src[1] = Cb_p
54 @ r6 = yuv_src[2] = Cr_p 54 @ r6 = yuv_src[2] = Cr_p
@@ -73,9 +73,9 @@ lcd_write_yuv420_lines:
73 add r10, r10, r8, asl #3 @ 73 add r10, r10, r8, asl #3 @
74 add r10, r10, r8, asl #4 @ 74 add r10, r10, r8, asl #4 @
75 @ 75 @
76 add r11, r9, r9, asl #2 @ r9 = Cr*101 76 add lr, r9, r9, asl #2 @ r9 = Cr*101
77 add r11, r11, r9, asl #5 @ 77 add lr, lr, r9, asl #5 @
78 add r9, r11, r9, asl #6 @ 78 add r9, lr, r9, asl #6 @
79 @ 79 @
80 add r8, r8, #2 @ r8 = bu = (Cb*128 + 128) >> 8 80 add r8, r8, #2 @ r8 = bu = (Cb*128 + 128) >> 8
81 mov r8, r8, asr #2 @ 81 mov r8, r8, asr #2 @
@@ -85,19 +85,19 @@ lcd_write_yuv420_lines:
85 mov r10, r10, asr #8 @ 85 mov r10, r10, asr #8 @
86 @ compute R, G, and B 86 @ compute R, G, and B
87 add r0, r8, r7, asr #8 @ r0 = b = (Y >> 9) + bu 87 add r0, r8, r7, asr #8 @ r0 = b = (Y >> 9) + bu
88 add r11, r9, r7, asr #8 @ r11 = r = (Y >> 9) + rv 88 add lr, r9, r7, asr #8 @ lr = r = (Y >> 9) + rv
89 add r7, r10, r7, asr #7 @ r7 = g = (Y >> 8) + guv 89 add r7, r10, r7, asr #7 @ r7 = g = (Y >> 8) + guv
90 @ 90 @
91 orr r12, r0, r11 @ check if clamping is needed... 91 orr r12, r0, lr @ check if clamping is needed...
92 orr r12, r12, r7, asr #1 @ ...at all 92 orr r12, r12, r7, asr #1 @ ...at all
93 cmp r12, #31 @ 93 cmp r12, #31 @
94 bls 15f @ no clamp @ 94 bls 15f @ no clamp @
95 cmp r0, #31 @ clamp b 95 cmp r0, #31 @ clamp b
96 mvnhi r0, r0, asr #31 @ 96 mvnhi r0, r0, asr #31 @
97 andhi r0, r0, #31 @ 97 andhi r0, r0, #31 @
98 cmp r11, #31 @ clamp r 98 cmp lr, #31 @ clamp r
99 mvnhi r11, r11, asr #31 @ 99 mvnhi lr, lr, asr #31 @
100 andhi r11, r11, #31 @ 100 andhi lr, lr, #31 @
101 cmp r7, #63 @ clamp g 101 cmp r7, #63 @ clamp g
102 mvnhi r7, r7, asr #31 @ 102 mvnhi r7, r7, asr #31 @
103 andhi r7, r7, #63 @ 103 andhi r7, r7, #63 @
@@ -105,14 +105,14 @@ lcd_write_yuv420_lines:
105 @ 105 @
106 ldrb r12, [r4, r2] @ r12 = Y' = *(Y'_p + stride) 106 ldrb r12, [r4, r2] @ r12 = Y' = *(Y'_p + stride)
107 @ 107 @
108 mov r11, r11, lsl #3 @ 108 mov lr, lr, lsl #3 @
109 orr r11, r11, r7, lsr #3 @ r11 = (r << 3) | (g >> 3) 109 orr lr, lr, r7, lsr #3 @ lr = (r << 3) | (g >> 3)
110 orr r0, r0, r7, lsl #5 @ r0 = (g << 5) | b 110 orr r0, r0, r7, lsl #5 @ r0 = (g << 5) | b
1111: @ busy @ 1111: @ busy @
112 ldr r7, [r3] @ r7 = LCD1_BASE 112 ldr r7, [r3] @ r7 = LCD1_BASE
113 tst r7, #LCD1_BUSY_MASK @ bridge busy? 113 tst r7, #LCD1_BUSY_MASK @ bridge busy?
114 bne 1b @ 114 bne 1b @
115 str r11, [r3, #0x10] @ send MSB 115 str lr, [r3, #0x10] @ send MSB
1161: @busy @ 1161: @busy @
117 ldr r7, [r3] @ r7 = LCD1_BASE 117 ldr r7, [r3] @ r7 = LCD1_BASE
118 tst r7, #LCD1_BUSY_MASK @ bridge busy? 118 tst r7, #LCD1_BUSY_MASK @ bridge busy?
@@ -124,19 +124,19 @@ lcd_write_yuv420_lines:
124 add r7, r12, r7, asl #5 @ 124 add r7, r12, r7, asl #5 @
125 @ compute R, G, and B 125 @ compute R, G, and B
126 add r0, r8, r7, asr #8 @ r0 = b = (Y >> 9) + bu 126 add r0, r8, r7, asr #8 @ r0 = b = (Y >> 9) + bu
127 add r11, r9, r7, asr #8 @ r11 = r = (Y >> 9) + rv 127 add lr, r9, r7, asr #8 @ lr = r = (Y >> 9) + rv
128 add r7, r10, r7, asr #7 @ r7 = g = (Y >> 8) + guv 128 add r7, r10, r7, asr #7 @ r7 = g = (Y >> 8) + guv
129 @ 129 @
130 orr r12, r0, r11 @ check if clamping is needed... 130 orr r12, r0, lr @ check if clamping is needed...
131 orr r12, r12, r7, asr #1 @ ...at all 131 orr r12, r12, r7, asr #1 @ ...at all
132 cmp r12, #31 @ 132 cmp r12, #31 @
133 bls 15f @ no clamp @ 133 bls 15f @ no clamp @
134 cmp r0, #31 @ clamp b 134 cmp r0, #31 @ clamp b
135 mvnhi r0, r0, asr #31 @ 135 mvnhi r0, r0, asr #31 @
136 andhi r0, r0, #31 @ 136 andhi r0, r0, #31 @
137 cmp r11, #31 @ clamp r 137 cmp lr, #31 @ clamp r
138 mvnhi r11, r11, asr #31 @ 138 mvnhi lr, lr, asr #31 @
139 andhi r11, r11, #31 @ 139 andhi lr, lr, #31 @
140 cmp r7, #63 @ clamp g 140 cmp r7, #63 @ clamp g
141 mvnhi r7, r7, asr #31 @ 141 mvnhi r7, r7, asr #31 @
142 andhi r7, r7, #63 @ 142 andhi r7, r7, #63 @
@@ -144,14 +144,14 @@ lcd_write_yuv420_lines:
144 @ 144 @
145 ldrb r12, [r4], #1 @ r12 = Y' = *(Y'_p++) 145 ldrb r12, [r4], #1 @ r12 = Y' = *(Y'_p++)
146 @ 146 @
147 mov r11, r11, lsl #3 @ 147 mov lr, lr, lsl #3 @
148 orr r11, r11, r7, lsr #3 @ r11 = (r << 3) | (g >> 3) 148 orr lr, lr, r7, lsr #3 @ lr = (r << 3) | (g >> 3)
149 orr r0, r0, r7, lsl #5 @ r0 = (g << 5) | b 149 orr r0, r0, r7, lsl #5 @ r0 = (g << 5) | b
1501: @ busy @ 1501: @ busy @
151 ldr r7, [r3] @ r7 = LCD1_BASE 151 ldr r7, [r3] @ r7 = LCD1_BASE
152 tst r7, #LCD1_BUSY_MASK @ bridge busy? 152 tst r7, #LCD1_BUSY_MASK @ bridge busy?
153 bne 1b @ 153 bne 1b @
154 str r11, [r3, #0x10] @ send MSB 154 str lr, [r3, #0x10] @ send MSB
1551: @ busy @ 1551: @ busy @
156 ldr r7, [r3] @ r7 = LCD1_BASE 156 ldr r7, [r3] @ r7 = LCD1_BASE
157 tst r7, #LCD1_BUSY_MASK @ bridge busy? 157 tst r7, #LCD1_BUSY_MASK @ bridge busy?
@@ -163,19 +163,19 @@ lcd_write_yuv420_lines:
163 add r7, r12, r7, asl #5 @ 163 add r7, r12, r7, asl #5 @
164 @ compute R, G, and B 164 @ compute R, G, and B
165 add r0, r8, r7, asr #8 @ r0 = b = (Y >> 9) + bu 165 add r0, r8, r7, asr #8 @ r0 = b = (Y >> 9) + bu
166 add r11, r9, r7, asr #8 @ r11 = r = (Y >> 9) + rv 166 add lr, r9, r7, asr #8 @ lr = r = (Y >> 9) + rv
167 add r7, r10, r7, asr #7 @ r7 = g = (Y >> 8) + guv 167 add r7, r10, r7, asr #7 @ r7 = g = (Y >> 8) + guv
168 @ 168 @
169 orr r12, r0, r11 @ check if clamping is needed... 169 orr r12, r0, lr @ check if clamping is needed...
170 orr r12, r12, r7, asr #1 @ ...at all 170 orr r12, r12, r7, asr #1 @ ...at all
171 cmp r12, #31 @ 171 cmp r12, #31 @
172 bls 15f @ no clamp @ 172 bls 15f @ no clamp @
173 cmp r0, #31 @ clamp b 173 cmp r0, #31 @ clamp b
174 mvnhi r0, r0, asr #31 @ 174 mvnhi r0, r0, asr #31 @
175 andhi r0, r0, #31 @ 175 andhi r0, r0, #31 @
176 cmp r11, #31 @ clamp r 176 cmp lr, #31 @ clamp r
177 mvnhi r11, r11, asr #31 @ 177 mvnhi lr, lr, asr #31 @
178 andhi r11, r11, #31 @ 178 andhi lr, lr, #31 @
179 cmp r7, #63 @ clamp g 179 cmp r7, #63 @ clamp g
180 mvnhi r7, r7, asr #31 @ 180 mvnhi r7, r7, asr #31 @
181 andhi r7, r7, #63 @ 181 andhi r7, r7, #63 @
@@ -184,14 +184,14 @@ lcd_write_yuv420_lines:
184 ldrb r12, [r4, r2] @ r12 = Y' = *(Y'_p + stride) 184 ldrb r12, [r4, r2] @ r12 = Y' = *(Y'_p + stride)
185 @ 185 @
186 @ 186 @
187 mov r11, r11, lsl #3 @ 187 mov lr, lr, lsl #3 @
188 orr r11, r11, r7, lsr #3 @ r11 = (r << 3) | (g >> 3) 188 orr lr, lr, r7, lsr #3 @ lr = (r << 3) | (g >> 3)
189 orr r0, r0, r7, lsl #5 @ r0 = (g << 5) | b 189 orr r0, r0, r7, lsl #5 @ r0 = (g << 5) | b
1901: @ busy @ 1901: @ busy @
191 ldr r7, [r3] @ r7 = LCD1_BASE 191 ldr r7, [r3] @ r7 = LCD1_BASE
192 tst r7, #LCD1_BUSY_MASK @ bridge busy? 192 tst r7, #LCD1_BUSY_MASK @ bridge busy?
193 bne 1b @ 193 bne 1b @
194 str r11, [r3, #0x10] @ send MSB 194 str lr, [r3, #0x10] @ send MSB
1951: @ busy @ 1951: @ busy @
196 ldr r7, [r3] @ r7 = LCD1_BASE 196 ldr r7, [r3] @ r7 = LCD1_BASE
197 tst r7, #LCD1_BUSY_MASK @ bridge busy? 197 tst r7, #LCD1_BUSY_MASK @ bridge busy?
@@ -203,32 +203,32 @@ lcd_write_yuv420_lines:
203 add r7, r12, r7, asl #5 @ 203 add r7, r12, r7, asl #5 @
204 @ compute R, G, and B 204 @ compute R, G, and B
205 add r0, r8, r7, asr #8 @ r0 = b = (Y >> 9) + bu 205 add r0, r8, r7, asr #8 @ r0 = b = (Y >> 9) + bu
206 add r11, r9, r7, asr #8 @ r11 = r = (Y >> 9) + rv 206 add lr, r9, r7, asr #8 @ lr = r = (Y >> 9) + rv
207 add r7, r10, r7, asr #7 @ r7 = g = (Y >> 8) + guv 207 add r7, r10, r7, asr #7 @ r7 = g = (Y >> 8) + guv
208 @ 208 @
209 orr r12, r0, r11 @ check if clamping is needed... 209 orr r12, r0, lr @ check if clamping is needed...
210 orr r12, r12, r7, asr #1 @ ...at all 210 orr r12, r12, r7, asr #1 @ ...at all
211 cmp r12, #31 @ 211 cmp r12, #31 @
212 bls 15f @ no clamp @ 212 bls 15f @ no clamp @
213 cmp r0, #31 @ clamp b 213 cmp r0, #31 @ clamp b
214 mvnhi r0, r0, asr #31 @ 214 mvnhi r0, r0, asr #31 @
215 andhi r0, r0, #31 @ 215 andhi r0, r0, #31 @
216 cmp r11, #31 @ clamp r 216 cmp lr, #31 @ clamp r
217 mvnhi r11, r11, asr #31 @ 217 mvnhi lr, lr, asr #31 @
218 andhi r11, r11, #31 @ 218 andhi lr, lr, #31 @
219 cmp r7, #63 @ clamp g 219 cmp r7, #63 @ clamp g
220 mvnhi r7, r7, asr #31 @ 220 mvnhi r7, r7, asr #31 @
221 andhi r7, r7, #63 @ 221 andhi r7, r7, #63 @
22215: @ no clamp @ 22215: @ no clamp @
223 @ 223 @
224 mov r11, r11, lsl #3 @ 224 mov lr, lr, lsl #3 @
225 orr r11, r11, r7, lsr #3 @ r11 = (r << 3) | (g >> 3) 225 orr lr, lr, r7, lsr #3 @ lr = (r << 3) | (g >> 3)
226 orr r0, r0, r7, lsl #5 @ r0 = (g << 5) | b 226 orr r0, r0, r7, lsl #5 @ r0 = (g << 5) | b
2271: @ busy @ 2271: @ busy @
228 ldr r7, [r3] @ r7 = LCD1_BASE 228 ldr r7, [r3] @ r7 = LCD1_BASE
229 tst r7, #LCD1_BUSY_MASK @ bridge busy? 229 tst r7, #LCD1_BUSY_MASK @ bridge busy?
230 bne 1b @ 230 bne 1b @
231 str r11, [r3, #0x10] @ send MSB 231 str lr, [r3, #0x10] @ send MSB
2321: @ busy @ 2321: @ busy @
233 ldr r7, [r3] @ r7 = LCD1_BASE 233 ldr r7, [r3] @ r7 = LCD1_BASE
234 tst r7, #LCD1_BUSY_MASK @ bridge busy? 234 tst r7, #LCD1_BUSY_MASK @ bridge busy?
@@ -238,8 +238,7 @@ lcd_write_yuv420_lines:
238 subs r1, r1, #2 @ subtract block from width 238 subs r1, r1, #2 @ subtract block from width
239 bgt 10b @ loop line @ 239 bgt 10b @ loop line @
240 @ 240 @
241 ldmfd sp!, { r4-r12 } @ restore registers and return 241 ldmfd sp!, { r4-r10, pc } @ restore registers and return
242 bx lr @
243 .ltorg @ dump constant pool 242 .ltorg @ dump constant pool
244 .size lcd_write_yuv420_lines, .-lcd_write_yuv420_lines 243 .size lcd_write_yuv420_lines, .-lcd_write_yuv420_lines
245 244
@@ -279,7 +278,7 @@ lcd_write_yuv420_lines_odither:
279 @ r2 = stride 278 @ r2 = stride
280 @ r3 = x_screen 279 @ r3 = x_screen
281 @ [sp] = y_screen 280 @ [sp] = y_screen
282 stmfd sp!, { r4-r12, lr } @ save non-scratch 281 stmfd sp!, { r4-r11, lr } @ save non-scratch
283 ldmia r0, { r4, r5, r6 } @ r4 = yuv_src[0] = Y'_p 282 ldmia r0, { r4, r5, r6 } @ r4 = yuv_src[0] = Y'_p
284 @ r5 = yuv_src[1] = Cb_p 283 @ r5 = yuv_src[1] = Cb_p
285 @ r6 = yuv_src[2] = Cr_p 284 @ r6 = yuv_src[2] = Cr_p
@@ -546,6 +545,6 @@ lcd_write_yuv420_lines_odither:
546 subs r1, r1, #2 @ subtract block from width 545 subs r1, r1, #2 @ subtract block from width
547 bgt 10b @ loop line @ 546 bgt 10b @ loop line @
548 @ 547 @
549 ldmfd sp!, { r4-r12, pc } @ restore registers and return 548 ldmfd sp!, { r4-r11, pc } @ restore registers and return
550 .ltorg @ dump constant pool 549 .ltorg @ dump constant pool
551 .size lcd_write_yuv420_lines_odither, .-lcd_write_yuv420_lines_odither 550 .size lcd_write_yuv420_lines_odither, .-lcd_write_yuv420_lines_odither
diff --git a/firmware/target/arm/samsung/yh925/lcd-as-yh925.S b/firmware/target/arm/samsung/yh925/lcd-as-yh925.S
index ba6c876d44..e99eee50c9 100644
--- a/firmware/target/arm/samsung/yh925/lcd-as-yh925.S
+++ b/firmware/target/arm/samsung/yh925/lcd-as-yh925.S
@@ -49,7 +49,7 @@ lcd_write_yuv420_lines:
49 @ r0 = yuv_src 49 @ r0 = yuv_src
50 @ r1 = width 50 @ r1 = width
51 @ r2 = stride 51 @ r2 = stride
52 stmfd sp!, { r4-r12, lr } @ save non-scratch 52 stmfd sp!, { r4-r11, lr } @ save non-scratch
53 ldmia r0, { r4, r5, r6 } @ r4 = yuv_src[0] = Y'_p 53 ldmia r0, { r4, r5, r6 } @ r4 = yuv_src[0] = Y'_p
54 @ r5 = yuv_src[1] = Cb_p 54 @ r5 = yuv_src[1] = Cb_p
55 @ r6 = yuv_src[2] = Cr_p 55 @ r6 = yuv_src[2] = Cr_p
@@ -232,7 +232,7 @@ lcd_write_yuv420_lines:
232 subs r1, r1, #2 @ subtract block from width 232 subs r1, r1, #2 @ subtract block from width
233 bgt 10b @ loop line @ 233 bgt 10b @ loop line @
234 @ 234 @
235 ldmfd sp!, { r4-r12, pc } @ restore registers and return 235 ldmfd sp!, { r4-r11, pc } @ restore registers and return
236 .ltorg @ dump constant pool 236 .ltorg @ dump constant pool
237 .size lcd_write_yuv420_lines, .-lcd_write_yuv420_lines 237 .size lcd_write_yuv420_lines, .-lcd_write_yuv420_lines
238 238
@@ -273,7 +273,7 @@ lcd_write_yuv420_lines_odither:
273 @ r2 = stride 273 @ r2 = stride
274 @ r3 = x_screen 274 @ r3 = x_screen
275 @ [sp] = y_screen 275 @ [sp] = y_screen
276 stmfd sp!, { r4-r12, lr } @ save non-scratch 276 stmfd sp!, { r4-r11, lr } @ save non-scratch
277 ldmia r0, { r4, r5, r6 } @ r4 = yuv_src[0] = Y'_p 277 ldmia r0, { r4, r5, r6 } @ r4 = yuv_src[0] = Y'_p
278 @ r5 = yuv_src[1] = Cb_p 278 @ r5 = yuv_src[1] = Cb_p
279 @ r6 = yuv_src[2] = Cr_p 279 @ r6 = yuv_src[2] = Cr_p
@@ -533,6 +533,6 @@ lcd_write_yuv420_lines_odither:
533 subs r1, r1, #2 @ subtract block from width 533 subs r1, r1, #2 @ subtract block from width
534 bgt 10b @ loop line @ 534 bgt 10b @ loop line @
535 @ 535 @
536 ldmfd sp!, { r4-r12, pc } @ restore registers and return 536 ldmfd sp!, { r4-r11, pc } @ restore registers and return
537 .ltorg @ dump constant pool 537 .ltorg @ dump constant pool
538 .size lcd_write_yuv420_lines_odither, .-lcd_write_yuv420_lines_odither 538 .size lcd_write_yuv420_lines_odither, .-lcd_write_yuv420_lines_odither
diff --git a/firmware/target/arm/sandisk/sansa-c200/lcd-as-c200.S b/firmware/target/arm/sandisk/sansa-c200/lcd-as-c200.S
index e466624d04..7187b83661 100644
--- a/firmware/target/arm/sandisk/sansa-c200/lcd-as-c200.S
+++ b/firmware/target/arm/sandisk/sansa-c200/lcd-as-c200.S
@@ -48,7 +48,7 @@ lcd_write_yuv420_lines:
48 @ r0 = yuv_src 48 @ r0 = yuv_src
49 @ r1 = width 49 @ r1 = width
50 @ r2 = stride 50 @ r2 = stride
51 stmfd sp!, { r4-r12 } @ save non-scratch 51 stmfd sp!, { r4-r10, lr } @ save non-scratch
52 ldmia r0, { r4, r5, r6 } @ r4 = yuv_src[0] = Y'_p 52 ldmia r0, { r4, r5, r6 } @ r4 = yuv_src[0] = Y'_p
53 @ r5 = yuv_src[1] = Cb_p 53 @ r5 = yuv_src[1] = Cb_p
54 @ r6 = yuv_src[2] = Cr_p 54 @ r6 = yuv_src[2] = Cr_p
@@ -73,9 +73,9 @@ lcd_write_yuv420_lines:
73 add r10, r10, r8, asl #3 @ 73 add r10, r10, r8, asl #3 @
74 add r10, r10, r8, asl #4 @ 74 add r10, r10, r8, asl #4 @
75 @ 75 @
76 add r11, r9, r9, asl #2 @ r9 = Cr*101 76 add lr, r9, r9, asl #2 @ r9 = Cr*101
77 add r11, r11, r9, asl #5 @ 77 add lr, lr, r9, asl #5 @
78 add r9, r11, r9, asl #6 @ 78 add r9, lr, r9, asl #6 @
79 @ 79 @
80 add r8, r8, #2 @ r8 = bu = (Cb*128 + 128) >> 8 80 add r8, r8, #2 @ r8 = bu = (Cb*128 + 128) >> 8
81 mov r8, r8, asr #2 @ 81 mov r8, r8, asr #2 @
@@ -85,19 +85,19 @@ lcd_write_yuv420_lines:
85 mov r10, r10, asr #8 @ 85 mov r10, r10, asr #8 @
86 @ compute R, G, and B 86 @ compute R, G, and B
87 add r0, r8, r7, asr #8 @ r0 = b = (Y >> 9) + bu 87 add r0, r8, r7, asr #8 @ r0 = b = (Y >> 9) + bu
88 add r11, r9, r7, asr #8 @ r11 = r = (Y >> 9) + rv 88 add lr, r9, r7, asr #8 @ lr = r = (Y >> 9) + rv
89 add r7, r10, r7, asr #7 @ r7 = g = (Y >> 8) + guv 89 add r7, r10, r7, asr #7 @ r7 = g = (Y >> 8) + guv
90 @ 90 @
91 orr r12, r0, r11 @ check if clamping is needed... 91 orr r12, r0, lr @ check if clamping is needed...
92 orr r12, r12, r7, asr #1 @ ...at all 92 orr r12, r12, r7, asr #1 @ ...at all
93 cmp r12, #31 @ 93 cmp r12, #31 @
94 bls 15f @ no clamp @ 94 bls 15f @ no clamp @
95 cmp r0, #31 @ clamp b 95 cmp r0, #31 @ clamp b
96 mvnhi r0, r0, asr #31 @ 96 mvnhi r0, r0, asr #31 @
97 andhi r0, r0, #31 @ 97 andhi r0, r0, #31 @
98 cmp r11, #31 @ clamp r 98 cmp lr, #31 @ clamp r
99 mvnhi r11, r11, asr #31 @ 99 mvnhi lr, lr, asr #31 @
100 andhi r11, r11, #31 @ 100 andhi lr, lr, #31 @
101 cmp r7, #63 @ clamp g 101 cmp r7, #63 @ clamp g
102 mvnhi r7, r7, asr #31 @ 102 mvnhi r7, r7, asr #31 @
103 andhi r7, r7, #63 @ 103 andhi r7, r7, #63 @
@@ -105,14 +105,14 @@ lcd_write_yuv420_lines:
105 @ 105 @
106 ldrb r12, [r4, r2] @ r12 = Y' = *(Y'_p + stride) 106 ldrb r12, [r4, r2] @ r12 = Y' = *(Y'_p + stride)
107 @ 107 @
108 mov r11, r11, lsl #3 @ 108 mov lr, lr, lsl #3 @
109 orr r11, r11, r7, lsr #3 @ r11 = (r << 3) | (g >> 3) 109 orr lr, lr, r7, lsr #3 @ lr = (r << 3) | (g >> 3)
110 orr r0, r0, r7, lsl #5 @ r0 = (g << 5) | b 110 orr r0, r0, r7, lsl #5 @ r0 = (g << 5) | b
1111: @ busy @ 1111: @ busy @
112 ldr r7, [r3] @ r7 = LCD1_BASE 112 ldr r7, [r3] @ r7 = LCD1_BASE
113 tst r7, #LCD1_BUSY_MASK @ bridge busy? 113 tst r7, #LCD1_BUSY_MASK @ bridge busy?
114 bne 1b @ 114 bne 1b @
115 str r11, [r3, #0x10] @ send MSB 115 str lr, [r3, #0x10] @ send MSB
1161: @busy @ 1161: @busy @
117 ldr r7, [r3] @ r7 = LCD1_BASE 117 ldr r7, [r3] @ r7 = LCD1_BASE
118 tst r7, #LCD1_BUSY_MASK @ bridge busy? 118 tst r7, #LCD1_BUSY_MASK @ bridge busy?
@@ -124,19 +124,19 @@ lcd_write_yuv420_lines:
124 add r7, r12, r7, asl #5 @ 124 add r7, r12, r7, asl #5 @
125 @ compute R, G, and B 125 @ compute R, G, and B
126 add r0, r8, r7, asr #8 @ r0 = b = (Y >> 9) + bu 126 add r0, r8, r7, asr #8 @ r0 = b = (Y >> 9) + bu
127 add r11, r9, r7, asr #8 @ r11 = r = (Y >> 9) + rv 127 add lr, r9, r7, asr #8 @ lr = r = (Y >> 9) + rv
128 add r7, r10, r7, asr #7 @ r7 = g = (Y >> 8) + guv 128 add r7, r10, r7, asr #7 @ r7 = g = (Y >> 8) + guv
129 @ 129 @
130 orr r12, r0, r11 @ check if clamping is needed... 130 orr r12, r0, lr @ check if clamping is needed...
131 orr r12, r12, r7, asr #1 @ ...at all 131 orr r12, r12, r7, asr #1 @ ...at all
132 cmp r12, #31 @ 132 cmp r12, #31 @
133 bls 15f @ no clamp @ 133 bls 15f @ no clamp @
134 cmp r0, #31 @ clamp b 134 cmp r0, #31 @ clamp b
135 mvnhi r0, r0, asr #31 @ 135 mvnhi r0, r0, asr #31 @
136 andhi r0, r0, #31 @ 136 andhi r0, r0, #31 @
137 cmp r11, #31 @ clamp r 137 cmp lr, #31 @ clamp r
138 mvnhi r11, r11, asr #31 @ 138 mvnhi lr, lr, asr #31 @
139 andhi r11, r11, #31 @ 139 andhi lr, lr, #31 @
140 cmp r7, #63 @ clamp g 140 cmp r7, #63 @ clamp g
141 mvnhi r7, r7, asr #31 @ 141 mvnhi r7, r7, asr #31 @
142 andhi r7, r7, #63 @ 142 andhi r7, r7, #63 @
@@ -144,14 +144,14 @@ lcd_write_yuv420_lines:
144 @ 144 @
145 ldrb r12, [r4], #1 @ r12 = Y' = *(Y'_p++) 145 ldrb r12, [r4], #1 @ r12 = Y' = *(Y'_p++)
146 @ 146 @
147 mov r11, r11, lsl #3 @ 147 mov lr, lr, lsl #3 @
148 orr r11, r11, r7, lsr #3 @ r11 = (r << 3) | (g >> 3) 148 orr lr, lr, r7, lsr #3 @ lr = (r << 3) | (g >> 3)
149 orr r0, r0, r7, lsl #5 @ r0 = (g << 5) | b 149 orr r0, r0, r7, lsl #5 @ r0 = (g << 5) | b
1501: @ busy @ 1501: @ busy @
151 ldr r7, [r3] @ r7 = LCD1_BASE 151 ldr r7, [r3] @ r7 = LCD1_BASE
152 tst r7, #LCD1_BUSY_MASK @ bridge busy? 152 tst r7, #LCD1_BUSY_MASK @ bridge busy?
153 bne 1b @ 153 bne 1b @
154 str r11, [r3, #0x10] @ send MSB 154 str lr, [r3, #0x10] @ send MSB
1551: @ busy @ 1551: @ busy @
156 ldr r7, [r3] @ r7 = LCD1_BASE 156 ldr r7, [r3] @ r7 = LCD1_BASE
157 tst r7, #LCD1_BUSY_MASK @ bridge busy? 157 tst r7, #LCD1_BUSY_MASK @ bridge busy?
@@ -163,19 +163,19 @@ lcd_write_yuv420_lines:
163 add r7, r12, r7, asl #5 @ 163 add r7, r12, r7, asl #5 @
164 @ compute R, G, and B 164 @ compute R, G, and B
165 add r0, r8, r7, asr #8 @ r0 = b = (Y >> 9) + bu 165 add r0, r8, r7, asr #8 @ r0 = b = (Y >> 9) + bu
166 add r11, r9, r7, asr #8 @ r11 = r = (Y >> 9) + rv 166 add lr, r9, r7, asr #8 @ lr = r = (Y >> 9) + rv
167 add r7, r10, r7, asr #7 @ r7 = g = (Y >> 8) + guv 167 add r7, r10, r7, asr #7 @ r7 = g = (Y >> 8) + guv
168 @ 168 @
169 orr r12, r0, r11 @ check if clamping is needed... 169 orr r12, r0, lr @ check if clamping is needed...
170 orr r12, r12, r7, asr #1 @ ...at all 170 orr r12, r12, r7, asr #1 @ ...at all
171 cmp r12, #31 @ 171 cmp r12, #31 @
172 bls 15f @ no clamp @ 172 bls 15f @ no clamp @
173 cmp r0, #31 @ clamp b 173 cmp r0, #31 @ clamp b
174 mvnhi r0, r0, asr #31 @ 174 mvnhi r0, r0, asr #31 @
175 andhi r0, r0, #31 @ 175 andhi r0, r0, #31 @
176 cmp r11, #31 @ clamp r 176 cmp lr, #31 @ clamp r
177 mvnhi r11, r11, asr #31 @ 177 mvnhi lr, lr, asr #31 @
178 andhi r11, r11, #31 @ 178 andhi lr, lr, #31 @
179 cmp r7, #63 @ clamp g 179 cmp r7, #63 @ clamp g
180 mvnhi r7, r7, asr #31 @ 180 mvnhi r7, r7, asr #31 @
181 andhi r7, r7, #63 @ 181 andhi r7, r7, #63 @
@@ -184,14 +184,14 @@ lcd_write_yuv420_lines:
184 ldrb r12, [r4, r2] @ r12 = Y' = *(Y'_p + stride) 184 ldrb r12, [r4, r2] @ r12 = Y' = *(Y'_p + stride)
185 @ 185 @
186 @ 186 @
187 mov r11, r11, lsl #3 @ 187 mov lr, lr, lsl #3 @
188 orr r11, r11, r7, lsr #3 @ r11 = (r << 3) | (g >> 3) 188 orr lr, lr, r7, lsr #3 @ lr = (r << 3) | (g >> 3)
189 orr r0, r0, r7, lsl #5 @ r0 = (g << 5) | b 189 orr r0, r0, r7, lsl #5 @ r0 = (g << 5) | b
1901: @ busy @ 1901: @ busy @
191 ldr r7, [r3] @ r7 = LCD1_BASE 191 ldr r7, [r3] @ r7 = LCD1_BASE
192 tst r7, #LCD1_BUSY_MASK @ bridge busy? 192 tst r7, #LCD1_BUSY_MASK @ bridge busy?
193 bne 1b @ 193 bne 1b @
194 str r11, [r3, #0x10] @ send MSB 194 str lr, [r3, #0x10] @ send MSB
1951: @ busy @ 1951: @ busy @
196 ldr r7, [r3] @ r7 = LCD1_BASE 196 ldr r7, [r3] @ r7 = LCD1_BASE
197 tst r7, #LCD1_BUSY_MASK @ bridge busy? 197 tst r7, #LCD1_BUSY_MASK @ bridge busy?
@@ -203,32 +203,32 @@ lcd_write_yuv420_lines:
203 add r7, r12, r7, asl #5 @ 203 add r7, r12, r7, asl #5 @
204 @ compute R, G, and B 204 @ compute R, G, and B
205 add r0, r8, r7, asr #8 @ r0 = b = (Y >> 9) + bu 205 add r0, r8, r7, asr #8 @ r0 = b = (Y >> 9) + bu
206 add r11, r9, r7, asr #8 @ r11 = r = (Y >> 9) + rv 206 add lr, r9, r7, asr #8 @ lr = r = (Y >> 9) + rv
207 add r7, r10, r7, asr #7 @ r7 = g = (Y >> 8) + guv 207 add r7, r10, r7, asr #7 @ r7 = g = (Y >> 8) + guv
208 @ 208 @
209 orr r12, r0, r11 @ check if clamping is needed... 209 orr r12, r0, lr @ check if clamping is needed...
210 orr r12, r12, r7, asr #1 @ ...at all 210 orr r12, r12, r7, asr #1 @ ...at all
211 cmp r12, #31 @ 211 cmp r12, #31 @
212 bls 15f @ no clamp @ 212 bls 15f @ no clamp @
213 cmp r0, #31 @ clamp b 213 cmp r0, #31 @ clamp b
214 mvnhi r0, r0, asr #31 @ 214 mvnhi r0, r0, asr #31 @
215 andhi r0, r0, #31 @ 215 andhi r0, r0, #31 @
216 cmp r11, #31 @ clamp r 216 cmp lr, #31 @ clamp r
217 mvnhi r11, r11, asr #31 @ 217 mvnhi lr, lr, asr #31 @
218 andhi r11, r11, #31 @ 218 andhi lr, lr, #31 @
219 cmp r7, #63 @ clamp g 219 cmp r7, #63 @ clamp g
220 mvnhi r7, r7, asr #31 @ 220 mvnhi r7, r7, asr #31 @
221 andhi r7, r7, #63 @ 221 andhi r7, r7, #63 @
22215: @ no clamp @ 22215: @ no clamp @
223 @ 223 @
224 mov r11, r11, lsl #3 @ 224 mov lr, lr, lsl #3 @
225 orr r11, r11, r7, lsr #3 @ r11 = (r << 3) | (g >> 3) 225 orr lr, lr, r7, lsr #3 @ lr = (r << 3) | (g >> 3)
226 orr r0, r0, r7, lsl #5 @ r0 = (g << 5) | b 226 orr r0, r0, r7, lsl #5 @ r0 = (g << 5) | b
2271: @ busy @ 2271: @ busy @
228 ldr r7, [r3] @ r7 = LCD1_BASE 228 ldr r7, [r3] @ r7 = LCD1_BASE
229 tst r7, #LCD1_BUSY_MASK @ bridge busy? 229 tst r7, #LCD1_BUSY_MASK @ bridge busy?
230 bne 1b @ 230 bne 1b @
231 str r11, [r3, #0x10] @ send MSB 231 str lr, [r3, #0x10] @ send MSB
2321: @ busy @ 2321: @ busy @
233 ldr r7, [r3] @ r7 = LCD1_BASE 233 ldr r7, [r3] @ r7 = LCD1_BASE
234 tst r7, #LCD1_BUSY_MASK @ bridge busy? 234 tst r7, #LCD1_BUSY_MASK @ bridge busy?
@@ -238,8 +238,7 @@ lcd_write_yuv420_lines:
238 subs r1, r1, #2 @ subtract block from width 238 subs r1, r1, #2 @ subtract block from width
239 bgt 10b @ loop line @ 239 bgt 10b @ loop line @
240 @ 240 @
241 ldmfd sp!, { r4-r12 } @ restore registers and return 241 ldmfd sp!, { r4-r10, pc } @ restore registers and return
242 bx lr @
243 .ltorg @ dump constant pool 242 .ltorg @ dump constant pool
244 .size lcd_write_yuv420_lines, .-lcd_write_yuv420_lines 243 .size lcd_write_yuv420_lines, .-lcd_write_yuv420_lines
245 244
@@ -279,7 +278,7 @@ lcd_write_yuv420_lines_odither:
279 @ r2 = stride 278 @ r2 = stride
280 @ r3 = x_screen 279 @ r3 = x_screen
281 @ [sp] = y_screen 280 @ [sp] = y_screen
282 stmfd sp!, { r4-r12, lr } @ save non-scratch 281 stmfd sp!, { r4-r11, lr } @ save non-scratch
283 ldmia r0, { r4, r5, r6 } @ r4 = yuv_src[0] = Y'_p 282 ldmia r0, { r4, r5, r6 } @ r4 = yuv_src[0] = Y'_p
284 @ r5 = yuv_src[1] = Cb_p 283 @ r5 = yuv_src[1] = Cb_p
285 @ r6 = yuv_src[2] = Cr_p 284 @ r6 = yuv_src[2] = Cr_p
@@ -546,6 +545,6 @@ lcd_write_yuv420_lines_odither:
546 subs r1, r1, #2 @ subtract block from width 545 subs r1, r1, #2 @ subtract block from width
547 bgt 10b @ loop line @ 546 bgt 10b @ loop line @
548 @ 547 @
549 ldmfd sp!, { r4-r12, pc } @ restore registers and return 548 ldmfd sp!, { r4-r11, pc } @ restore registers and return
550 .ltorg @ dump constant pool 549 .ltorg @ dump constant pool
551 .size lcd_write_yuv420_lines_odither, .-lcd_write_yuv420_lines_odither 550 .size lcd_write_yuv420_lines_odither, .-lcd_write_yuv420_lines_odither