summaryrefslogtreecommitdiff
path: root/firmware/target/arm/ipod/lcd-color_nano.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target/arm/ipod/lcd-color_nano.c')
-rw-r--r--firmware/target/arm/ipod/lcd-color_nano.c56
1 files changed, 0 insertions, 56 deletions
diff --git a/firmware/target/arm/ipod/lcd-color_nano.c b/firmware/target/arm/ipod/lcd-color_nano.c
index 67d26aa862..71ae22cb23 100644
--- a/firmware/target/arm/ipod/lcd-color_nano.c
+++ b/firmware/target/arm/ipod/lcd-color_nano.c
@@ -202,62 +202,6 @@ static void lcd_setup_drawing_region(int x, int y, int width, int height)
202 } 202 }
203} 203}
204 204
205/* Line write helper function for lcd_yuv_blit. Writes two lines of yuv420. */
206extern void lcd_write_yuv420_lines(unsigned char const * const src[3],
207 const unsigned int lcd_baseadress,
208 int width,
209 int stride);
210
211/* Performance function to blit a YUV bitmap directly to the LCD */
212void lcd_blit_yuv(unsigned char * const src[3],
213 int src_x, int src_y, int stride,
214 int x, int y, int width, int height)
215{
216 int z;
217 unsigned char const * yuv_src[3];
218
219 width = (width + 1) & ~1; /* ensure width is even */
220 height = (height + 1) & ~1; /* ensure height is even */
221
222 lcd_setup_drawing_region(x, y, width, height);
223
224 z = stride * src_y;
225 yuv_src[0] = src[0] + z + src_x;
226 yuv_src[1] = src[1] + (z >> 2) + (src_x >> 1);
227 yuv_src[2] = src[2] + (yuv_src[1] - src[1]);
228
229 while (height > 0) {
230 int r, h, pixels_to_write;
231
232 pixels_to_write = (width * height) * 2;
233 h = height;
234
235 /* calculate how much we can do in one go */
236 if (pixels_to_write > 0x10000) {
237 h = ((0x10000/2) / width) & ~1; /* ensure h is even */
238 pixels_to_write = (width * h) * 2;
239 }
240
241 LCD2_BLOCK_CTRL = 0x10000080;
242 LCD2_BLOCK_CONFIG = 0xc0010000 | (pixels_to_write - 1);
243 LCD2_BLOCK_CTRL = 0x34000000;
244
245 r = h>>1; /* lcd_write_yuv420_lines writes two lines at once */
246 do {
247 lcd_write_yuv420_lines(yuv_src, LCD2_BASE, width, stride);
248 yuv_src[0] += stride << 1;
249 yuv_src[1] += stride >> 1;
250 yuv_src[2] += stride >> 1;
251 } while (--r > 0);
252
253 /* transfer of pixels_to_write bytes finished */
254 while (!(LCD2_BLOCK_CTRL & LCD2_BLOCK_READY));
255 LCD2_BLOCK_CONFIG = 0;
256
257 height -= h;
258 }
259}
260
261/* Helper function writes 'count' consecutive pixels from src to LCD IF */ 205/* Helper function writes 'count' consecutive pixels from src to LCD IF */
262static void lcd_write_line(int count, unsigned long *src) 206static void lcd_write_line(int count, unsigned long *src)
263{ 207{