diff options
-rw-r--r-- | firmware/drivers/lcd-ipodvideo.c | 37 |
1 files changed, 21 insertions, 16 deletions
diff --git a/firmware/drivers/lcd-ipodvideo.c b/firmware/drivers/lcd-ipodvideo.c index 8c404c80e4..c113652bd0 100644 --- a/firmware/drivers/lcd-ipodvideo.c +++ b/firmware/drivers/lcd-ipodvideo.c | |||
@@ -131,21 +131,7 @@ static unsigned lcd_bcm_read32(unsigned address) { | |||
131 | return inw(0x30000000) | inw(0x30000000) << 16; | 131 | return inw(0x30000000) | inw(0x30000000) << 16; |
132 | } | 132 | } |
133 | 133 | ||
134 | static inline void lcd_bcm_finishup(void) { | 134 | extern void _HD_ARM_Update5G (fb_data *fb, int x, int y, int w, int h); |
135 | unsigned data; | ||
136 | |||
137 | outw(0x31, 0x30030000); | ||
138 | |||
139 | lcd_bcm_read32(0x1FC); | ||
140 | |||
141 | do { | ||
142 | /* This function takes about 14ms to execute - so we yield() */ | ||
143 | yield(); | ||
144 | data = lcd_bcm_read32(0x1F8); | ||
145 | } while (data == 0xFFFA0005 || data == 0xFFFF); | ||
146 | |||
147 | lcd_bcm_read32(0x1FC); | ||
148 | } | ||
149 | 135 | ||
150 | /* Update a fraction of the display. */ | 136 | /* Update a fraction of the display. */ |
151 | void lcd_update_rect(int x, int y, int width, int height) ICODE_ATTR; | 137 | void lcd_update_rect(int x, int y, int width, int height) ICODE_ATTR; |
@@ -155,7 +141,9 @@ void lcd_update_rect(int x, int y, int width, int height) | |||
155 | int newx,newwidth; | 141 | int newx,newwidth; |
156 | int count; | 142 | int count; |
157 | int c, r; | 143 | int c, r; |
144 | unsigned int data; | ||
158 | unsigned short *src; | 145 | unsigned short *src; |
146 | static int finishup_needed = 0; | ||
159 | 147 | ||
160 | /* Ensure x and width are both even - so we can read 32-bit aligned | 148 | /* Ensure x and width are both even - so we can read 32-bit aligned |
161 | data from lcd_framebuffer */ | 149 | data from lcd_framebuffer */ |
@@ -170,6 +158,18 @@ void lcd_update_rect(int x, int y, int width, int height) | |||
170 | rect3 = (x + width) - 1; /* max horiz */ | 158 | rect3 = (x + width) - 1; /* max horiz */ |
171 | rect4 = (y + height) - 1; /* max vert */ | 159 | rect4 = (y + height) - 1; /* max vert */ |
172 | 160 | ||
161 | if (finishup_needed) { | ||
162 | /* Bottom-half of original lcd_bcm_finishup() function */ | ||
163 | do { | ||
164 | /* This function takes about 14ms to execute - so we yield() */ | ||
165 | yield(); | ||
166 | data = lcd_bcm_read32(0x1F8); | ||
167 | } while (data == 0xFFFA0005 || data == 0xFFFF); | ||
168 | } | ||
169 | |||
170 | lcd_bcm_read32(0x1FC); | ||
171 | |||
172 | |||
173 | /* setup the drawing region */ | 173 | /* setup the drawing region */ |
174 | count=(width * height) << 1; | 174 | count=(width * height) << 1; |
175 | lcd_bcm_setup_rect(0x34, rect1, rect2, rect3, rect4, count); | 175 | lcd_bcm_setup_rect(0x34, rect1, rect2, rect3, rect4, count); |
@@ -193,7 +193,12 @@ void lcd_update_rect(int x, int y, int width, int height) | |||
193 | src += (LCD_WIDTH - width); | 193 | src += (LCD_WIDTH - width); |
194 | } | 194 | } |
195 | 195 | ||
196 | lcd_bcm_finishup(); | 196 | /* Top-half of original lcd_bcm_finishup() function */ |
197 | outw(0x31, 0x30030000); | ||
198 | |||
199 | lcd_bcm_read32(0x1FC); | ||
200 | |||
201 | finishup_needed = 1; | ||
197 | } | 202 | } |
198 | 203 | ||
199 | /* Update the display. | 204 | /* Update the display. |