diff options
author | Jens Arnold <amiconn@rockbox.org> | 2010-07-16 07:08:39 +0000 |
---|---|---|
committer | Jens Arnold <amiconn@rockbox.org> | 2010-07-16 07:08:39 +0000 |
commit | 701dafdf30a1a01e2110a8aa3d59ee45550a9489 (patch) | |
tree | 0d3f68929ed4cc0652dd659776236aa091f3380d /firmware/target | |
parent | bb236ce89c82478a589d68d2cc83c5b145758d12 (diff) | |
download | rockbox-701dafdf30a1a01e2110a8aa3d59ee45550a9489.tar.gz rockbox-701dafdf30a1a01e2110a8aa3d59ee45550a9489.zip |
MPIO HD200 grey blitting: Use line reads for the pixel values as well. Almost doubles the ISR speed (47% -> 24% load), giving 42% faster greylib framebuffer updates.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27444 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target')
-rw-r--r-- | firmware/target/coldfire/mpio/hd200/lcd-as-hd200.S | 80 |
1 files changed, 56 insertions, 24 deletions
diff --git a/firmware/target/coldfire/mpio/hd200/lcd-as-hd200.S b/firmware/target/coldfire/mpio/hd200/lcd-as-hd200.S index a284896af7..29e52a0f1e 100644 --- a/firmware/target/coldfire/mpio/hd200/lcd-as-hd200.S +++ b/firmware/target/coldfire/mpio/hd200/lcd-as-hd200.S | |||
@@ -125,16 +125,16 @@ lcd_mono_data: | |||
125 | .type lcd_grey_data,@function | 125 | .type lcd_grey_data,@function |
126 | 126 | ||
127 | lcd_grey_data: | 127 | lcd_grey_data: |
128 | lea.l (-8*4, %sp), %sp | 128 | lea.l (-11*4, %sp), %sp |
129 | movem.l %d2-%d7/%a2-%a3, (%sp) /* save some registers */ | 129 | movem.l %d2-%d7/%a2-%a6, (%sp) /* save some registers */ |
130 | movem.l (8*4+4, %sp), %a0-%a2 /* values, phases, length */ | 130 | movem.l (11*4+4, %sp), %a0-%a2 /* values, phases, length */ |
131 | add.l %a2, %a2 | 131 | add.l %a2, %a2 |
132 | lea.l (%a1, %a2.l*4), %a2 /* end address */ | 132 | lea.l (%a1, %a2.l*4), %a2 /* end address */ |
133 | lea.l LCD_BASE_ADDRESS+2, %a3 /* LCD data port address */ | 133 | lea.l LCD_BASE_ADDRESS+2, %a3 /* LCD data port address */ |
134 | moveq.l #24, %d4 /* shift count */ | 134 | moveq.l #24, %d4 /* shift count */ |
135 | move.l #0x204081, %d5 /* bit shuffle factor */ | 135 | move.l #0x204081, %d5 /* bit shuffle factor */ |
136 | 136 | ||
137 | moveq.l #12, %d2 | 137 | moveq.l #8, %d2 |
138 | add.l %a1, %d2 | 138 | add.l %a1, %d2 |
139 | and.l #0xfffffff0, %d2 /* first line bound */ | 139 | and.l #0xfffffff0, %d2 /* first line bound */ |
140 | cmp.l %d2, %a2 /* end address lower than first line bound? */ | 140 | cmp.l %d2, %a2 /* end address lower than first line bound? */ |
@@ -142,14 +142,14 @@ lcd_grey_data: | |||
142 | move.l %a2, %d2 /* -> adjust end address of head loop */ | 142 | move.l %a2, %d2 /* -> adjust end address of head loop */ |
143 | 1: | 143 | 1: |
144 | cmp.l %a1, %d2 | 144 | cmp.l %a1, %d2 |
145 | bls.s .g_head_tail_end | 145 | bls.s .g_hend |
146 | 146 | ||
147 | .g_head_tail: | 147 | /* process head pixels */ |
148 | movem.l (%a1), %d0-%d1 /* fetch 8 pixel phases */ | 148 | movem.l (%a1), %d0-%d1 /* fetch 8 pixel phases */ |
149 | 149 | ||
150 | move.l %d0, %d2 | 150 | move.l %d0, %d2 |
151 | and.l #0x80808080, %d2 /* %d2 = 0.......1.......2.......3....... */ | 151 | and.l #0x80808080, %d2 /* %d2 = 0.......1.......2.......3....... */ |
152 | eor.l %d2, %d0 | 152 | eor.l %d2, %d0 |
153 | add.l (%a0)+, %d0 /* add values to first 4 phases */ | 153 | add.l (%a0)+, %d0 /* add values to first 4 phases */ |
154 | 154 | ||
155 | move.l %d1, %d3 | 155 | move.l %d1, %d3 |
@@ -170,26 +170,24 @@ lcd_grey_data: | |||
170 | 170 | ||
171 | move.w %d2, (%a3) /* transfer second LCD byte */ | 171 | move.w %d2, (%a3) /* transfer second LCD byte */ |
172 | 172 | ||
173 | .g_head_tail_end: | 173 | .g_hend: |
174 | cmp.l %a1, %a2 | 174 | cmp.l %a1, %a2 |
175 | bls.w .g_end | 175 | bls.w .g_tend |
176 | lea.l (-8, %a2), %a2 | 176 | subq.l #8, %a2 |
177 | cmp.l %a1, %a2 | 177 | cmp.l %a1, %a2 |
178 | bls.s .g_line_end | 178 | bls.s .g_lend |
179 | 179 | ||
180 | .g_line_loop: | 180 | .g_line_loop: |
181 | /* loop that utilize line transfers */ | 181 | /* loop that utilizes line transfers */ |
182 | movem.l (%a1), %d0-%d3 /* fetch 2 * 8 pixels phases */ | 182 | movem.l (%a1), %d0-%d3 /* fetch 2 * 8 pixels phases */ |
183 | 183 | ||
184 | move.l %d0, %d6 | 184 | move.l %d0, %d6 |
185 | and.l #0x80808080, %d6 /* %d6 = 0.......1.......2.......3....... */ | 185 | and.l #0x80808080, %d6 /* %d6 = 0.......1.......2.......3....... */ |
186 | eor.l %d6, %d0 | 186 | eor.l %d6, %d0 |
187 | add.l (%a0)+, %d0 /* add values to first 4 phases */ | ||
188 | 187 | ||
189 | move.l %d1, %d7 | 188 | move.l %d1, %d7 |
190 | and.l #0x80808080, %d7 /* %d7 = 4.......5.......6.......7....... */ | 189 | and.l #0x80808080, %d7 /* %d7 = 4.......5.......6.......7....... */ |
191 | eor.l %d7, %d1 | 190 | eor.l %d7, %d1 |
192 | add.l (%a0)+, %d1 /* add values to second 4 phases */ | ||
193 | 191 | ||
194 | lsr.l #4, %d7 /* %d7 = ....4.......5.......6.......7... */ | 192 | lsr.l #4, %d7 /* %d7 = ....4.......5.......6.......7... */ |
195 | or.l %d7, %d6 /* %d6 = 0...4...1...5...2...6...3...7... */ | 193 | or.l %d7, %d6 /* %d6 = 0...4...1...5...2...6...3...7... */ |
@@ -198,17 +196,22 @@ lcd_grey_data: | |||
198 | lsr.l %d4, %d6 /* %d6 = ........................01234567 */ | 196 | lsr.l %d4, %d6 /* %d6 = ........................01234567 */ |
199 | 197 | ||
200 | move.w %d6, (%a3) /* transfer first LCD byte */ | 198 | move.w %d6, (%a3) /* transfer first LCD byte */ |
199 | |||
200 | movem.l (%a0), %d7/%a4-%a6 /* fetch 2 * 8 pixel values */ | ||
201 | lea.l (16, %a0), %a0 | ||
202 | |||
201 | move.w %d6, (%a3) /* transfer second LCD byte */ | 203 | move.w %d6, (%a3) /* transfer second LCD byte */ |
202 | 204 | ||
205 | add.l %d7, %d0 | ||
206 | add.l %a4, %d1 | ||
207 | |||
203 | move.l %d2, %d6 | 208 | move.l %d2, %d6 |
204 | and.l #0x80808080, %d6 /* %d6 = 0.......1.......2.......3....... */ | 209 | and.l #0x80808080, %d6 /* %d6 = 0.......1.......2.......3....... */ |
205 | eor.l %d6, %d2 | 210 | eor.l %d6, %d2 |
206 | add.l (%a0)+, %d2 /* add values to first 4 phases */ | ||
207 | 211 | ||
208 | move.l %d3, %d7 | 212 | move.l %d3, %d7 |
209 | and.l #0x80808080, %d7 /* %d7 = 4.......5.......6.......7....... */ | 213 | and.l #0x80808080, %d7 /* %d7 = 4.......5.......6.......7....... */ |
210 | eor.l %d7, %d3 | 214 | eor.l %d7, %d3 |
211 | add.l (%a0)+, %d3 /* add values to second 4 phases */ | ||
212 | 215 | ||
213 | lsr.l #4, %d7 /* %d7 = ....4.......5.......6.......7... */ | 216 | lsr.l #4, %d7 /* %d7 = ....4.......5.......6.......7... */ |
214 | or.l %d7, %d6 /* %d6 = 0...4...1...5...2...6...3...7... */ | 217 | or.l %d7, %d6 /* %d6 = 0...4...1...5...2...6...3...7... */ |
@@ -216,24 +219,53 @@ lcd_grey_data: | |||
216 | not.l %d6 /* negate bits */ | 219 | not.l %d6 /* negate bits */ |
217 | lsr.l %d4, %d6 /* %d6 = ........................01234567 */ | 220 | lsr.l %d4, %d6 /* %d6 = ........................01234567 */ |
218 | 221 | ||
222 | add.l %a5, %d2 | ||
223 | add.l %a6, %d3 | ||
224 | |||
219 | move.w %d6, (%a3) /* transfer first LCD byte */ | 225 | move.w %d6, (%a3) /* transfer first LCD byte */ |
220 | move.w %d6, (%a3) /* transfer second LCD byte */ | ||
221 | 226 | ||
222 | movem.l %d0-%d3, (%a1) /* store 2 * 8 new pixel phases */ | 227 | movem.l %d0-%d3, (%a1) /* store 2 * 8 new pixel phases */ |
223 | lea.l (16, %a1), %a1 /* advance pointer */ | 228 | lea.l (16, %a1), %a1 /* advance pointer */ |
224 | 229 | ||
230 | move.w %d6, (%a3) /* transfer second LCD byte */ | ||
231 | |||
225 | cmp.l %a2, %a1 | 232 | cmp.l %a2, %a1 |
226 | bls.s .g_line_loop | 233 | bls.s .g_line_loop |
227 | 234 | ||
228 | .g_line_end: | 235 | .g_lend: |
229 | lea.l (8, %a2), %a2 | 236 | addq.l #8, %a2 |
230 | cmp.l %a1, %a2 | 237 | cmp.l %a1, %a2 |
231 | bls.s .g_end | 238 | bls.s .g_tend |
232 | bra.w .g_head_tail | 239 | |
240 | /* process tail pixels */ | ||
241 | movem.l (%a1), %d0-%d1 /* fetch 8 pixel phases */ | ||
242 | |||
243 | move.l %d0, %d2 | ||
244 | and.l #0x80808080, %d2 /* %d2 = 0.......1.......2.......3....... */ | ||
245 | eor.l %d2, %d0 | ||
246 | add.l (%a0)+, %d0 /* add values to first 4 phases */ | ||
247 | |||
248 | move.l %d1, %d3 | ||
249 | and.l #0x80808080, %d3 /* %d3 = 4.......5.......6.......7....... */ | ||
250 | eor.l %d3, %d1 | ||
251 | add.l (%a0)+, %d1 /* add values to second 4 phases */ | ||
252 | |||
253 | lsr.l #4, %d3 /* %d3 = ....4.......5.......6.......7... */ | ||
254 | or.l %d3, %d2 /* %d2 = 0...4...1...5...2...6...3...7... */ | ||
255 | mulu.l %d5, %d2 /* %d2 = 01234567123.567.23..67..3...7... */ | ||
256 | not.l %d2 /* negate bits */ | ||
257 | lsr.l %d4, %d2 /* %d2 = ........................01234567 */ | ||
258 | |||
259 | move.w %d2, (%a3) /* transfer first LCD byte */ | ||
260 | |||
261 | movem.l %d0-%d1, (%a1) /* store 8 new pixel phases */ | ||
262 | /* addq.l #8, %a1 not needed anymore */ | ||
263 | |||
264 | move.w %d2, (%a3) /* transfer second LCD byte */ | ||
233 | 265 | ||
234 | .g_end: | 266 | .g_tend: |
235 | movem.l (%sp), %d2-%d7/%a2-%a3 | 267 | movem.l (%sp), %d2-%d7/%a2-%a6 |
236 | lea.l (8*4, %sp), %sp | 268 | lea.l (11*4, %sp), %sp |
237 | rts | 269 | rts |
238 | .grey_end: | 270 | .grey_end: |
239 | .size lcd_grey_data,.grey_end-lcd_grey_data | 271 | .size lcd_grey_data,.grey_end-lcd_grey_data |