diff options
Diffstat (limited to 'firmware/target/arm')
16 files changed, 44 insertions, 25 deletions
diff --git a/firmware/target/arm/as3525/lcd-ssd1303.c b/firmware/target/arm/as3525/lcd-ssd1303.c index 2aa0b844c5..186fdcacbe 100644 --- a/firmware/target/arm/as3525/lcd-ssd1303.c +++ b/firmware/target/arm/as3525/lcd-ssd1303.c | |||
@@ -310,6 +310,7 @@ static void internal_update_rect(int x, int y, int width, int height) | |||
310 | const int column_high = get_column_high_byte(x); | 310 | const int column_high = get_column_high_byte(x); |
311 | const int column_low = get_column_low_byte(x); | 311 | const int column_low = get_column_low_byte(x); |
312 | 312 | ||
313 | void* (*fbaddr)(int x, int y) = FB_CURRENTVP_BUFFER->get_address_fn; | ||
313 | /* Copy specified rectange bitmap to hardware */ | 314 | /* Copy specified rectange bitmap to hardware */ |
314 | for (; y <= height; y++) | 315 | for (; y <= height; y++) |
315 | { | 316 | { |
@@ -320,7 +321,7 @@ static void internal_update_rect(int x, int y, int width, int height) | |||
320 | (column_low) | 321 | (column_low) |
321 | ); | 322 | ); |
322 | 323 | ||
323 | lcd_write_data (FBADDR(x,y), width); | 324 | lcd_write_data (fbaddr(x,y), width); |
324 | } | 325 | } |
325 | lcd_write_command (LCD_NOP); /* return to command mode */ | 326 | lcd_write_command (LCD_NOP); /* return to command mode */ |
326 | 327 | ||
diff --git a/firmware/target/arm/as3525/sansa-clipzip/lcd-clipzip.c b/firmware/target/arm/as3525/sansa-clipzip/lcd-clipzip.c index 03ed1de5d5..48594a2ac9 100644 --- a/firmware/target/arm/as3525/sansa-clipzip/lcd-clipzip.c +++ b/firmware/target/arm/as3525/sansa-clipzip/lcd-clipzip.c | |||
@@ -440,9 +440,10 @@ void lcd_update_rect(int x, int y, int width, int height) | |||
440 | /* setup GRAM write window */ | 440 | /* setup GRAM write window */ |
441 | lcd_setup_rect(x, x_end - 1, y, y_end - 1); | 441 | lcd_setup_rect(x, x_end - 1, y, y_end - 1); |
442 | 442 | ||
443 | void* (*fbaddr)(int x, int y) = FB_CURRENTVP_BUFFER->get_address_fn; | ||
443 | /* write to GRAM */ | 444 | /* write to GRAM */ |
444 | for (row = y; row < y_end; row++) { | 445 | for (row = y; row < y_end; row++) { |
445 | lcd_write_data(FBADDR(x,row), width); | 446 | lcd_write_data(fbaddr(x,row), width); |
446 | } | 447 | } |
447 | } | 448 | } |
448 | 449 | ||
diff --git a/firmware/target/arm/imx233/creative-zen/lcd-zenmozaic.c b/firmware/target/arm/imx233/creative-zen/lcd-zenmozaic.c index c1bc379a49..ab4466300b 100644 --- a/firmware/target/arm/imx233/creative-zen/lcd-zenmozaic.c +++ b/firmware/target/arm/imx233/creative-zen/lcd-zenmozaic.c | |||
@@ -149,6 +149,8 @@ void lcd_update_rect(int x, int y, int w, int h) | |||
149 | lcd_write_reg(0x17, y | (y + h - 1) << 8); | 149 | lcd_write_reg(0x17, y | (y + h - 1) << 8); |
150 | lcd_write_reg(0x21, y * LCD_WIDTH + x); | 150 | lcd_write_reg(0x21, y * LCD_WIDTH + x); |
151 | lcd_write_reg(0x22, 0); | 151 | lcd_write_reg(0x22, 0); |
152 | |||
153 | void* (*fbaddr)(int x, int y) = FB_CURRENTVP_BUFFER->get_address_fn; | ||
152 | for(int yy = y; yy < y + h; yy++) | 154 | for(int yy = y; yy < y + h; yy++) |
153 | imx233_lcdif_pio_send(true, 2 * w, FBADDR(x, yy)); | 155 | imx233_lcdif_pio_send(true, 2 * w, fbaddr(x,yy)); |
154 | } | 156 | } |
diff --git a/firmware/target/arm/imx233/creative-zen/lcd-zenv.c b/firmware/target/arm/imx233/creative-zen/lcd-zenv.c index 06b0f158f3..75d2775814 100644 --- a/firmware/target/arm/imx233/creative-zen/lcd-zenv.c +++ b/firmware/target/arm/imx233/creative-zen/lcd-zenv.c | |||
@@ -172,8 +172,9 @@ void lcd_update_rect(int x, int y, int w, int h) | |||
172 | lcd_send(false, 0x75); lcd_send(true, y); lcd_send(true, y + h - 1); | 172 | lcd_send(false, 0x75); lcd_send(true, y); lcd_send(true, y + h - 1); |
173 | lcd_send(false, 0x5c); | 173 | lcd_send(false, 0x5c); |
174 | imx233_lcdif_set_word_length(16); | 174 | imx233_lcdif_set_word_length(16); |
175 | void* (*fbaddr)(int x, int y) = FB_CURRENTVP_BUFFER->get_address_fn; | ||
175 | for(int yy = y; yy < y + h; yy++) | 176 | for(int yy = y; yy < y + h; yy++) |
176 | imx233_lcdif_pio_send(true, w, FBADDR(x, yy)); | 177 | imx233_lcdif_pio_send(true, w, fbaddr(x,yy)); |
177 | } | 178 | } |
178 | 179 | ||
179 | #ifndef BOOTLOADER | 180 | #ifndef BOOTLOADER |
diff --git a/firmware/target/arm/imx233/creative-zen/lcd-zenxfistyle.c b/firmware/target/arm/imx233/creative-zen/lcd-zenxfistyle.c index ce0bcc3885..825b0072a3 100644 --- a/firmware/target/arm/imx233/creative-zen/lcd-zenxfistyle.c +++ b/firmware/target/arm/imx233/creative-zen/lcd-zenxfistyle.c | |||
@@ -282,8 +282,9 @@ void lcd_update_rect(int x, int y, int w, int h) | |||
282 | } | 282 | } |
283 | else | 283 | else |
284 | { | 284 | { |
285 | void* (*fbaddr)(int x, int y) = FB_CURRENTVP_BUFFER->get_address_fn; | ||
285 | for(int i = 0; i < h; i++) | 286 | for(int i = 0; i < h; i++) |
286 | memcpy((fb_data *)FRAME + i * w, FBADDR(x,y + i), w * sizeof(fb_data)); | 287 | memcpy((fb_data *)FRAME + i * w, fbaddr(x,y + i), w * sizeof(fb_data)); |
287 | } | 288 | } |
288 | /* WARNING The LCDIF has a limitation on the vertical count ! In 16-bit packed mode | 289 | /* WARNING The LCDIF has a limitation on the vertical count ! In 16-bit packed mode |
289 | * (which we used, ie 16-bit per pixel, 2 pixels per 32-bit words), the v_count | 290 | * (which we used, ie 16-bit per pixel, 2 pixels per 32-bit words), the v_count |
diff --git a/firmware/target/arm/imx233/creative-zenxfi2/lcd-zenxfi2.c b/firmware/target/arm/imx233/creative-zenxfi2/lcd-zenxfi2.c index 890ff0b586..d0084900e7 100644 --- a/firmware/target/arm/imx233/creative-zenxfi2/lcd-zenxfi2.c +++ b/firmware/target/arm/imx233/creative-zenxfi2/lcd-zenxfi2.c | |||
@@ -241,8 +241,9 @@ void lcd_update_rect(int x, int y, int w, int h) | |||
241 | } | 241 | } |
242 | else | 242 | else |
243 | { | 243 | { |
244 | void* (*fbaddr)(int x, int y) = FB_CURRENTVP_BUFFER->get_address_fn; | ||
244 | for(int i = 0; i < h; i++) | 245 | for(int i = 0; i < h; i++) |
245 | memcpy((fb_data *)FRAME + i * w, FBADDR(x,y + i), w * sizeof(fb_data)); | 246 | memcpy((fb_data *)FRAME + i * w, fbaddr(x,y + i), w * sizeof(fb_data)); |
246 | } | 247 | } |
247 | /* WARNING The LCDIF has a limitation on the vertical count ! In 16-bit packed mode | 248 | /* WARNING The LCDIF has a limitation on the vertical count ! In 16-bit packed mode |
248 | * (which we used, ie 16-bit per pixel, 2 pixels per 32-bit words), the v_count | 249 | * (which we used, ie 16-bit per pixel, 2 pixels per 32-bit words), the v_count |
diff --git a/firmware/target/arm/imx233/creative-zenxfi3/lcd-zenxfi3.c b/firmware/target/arm/imx233/creative-zenxfi3/lcd-zenxfi3.c index 59496f2d24..d5f25a523c 100644 --- a/firmware/target/arm/imx233/creative-zenxfi3/lcd-zenxfi3.c +++ b/firmware/target/arm/imx233/creative-zenxfi3/lcd-zenxfi3.c | |||
@@ -188,8 +188,9 @@ void lcd_update_rect(int x, int y, int w, int h) | |||
188 | } | 188 | } |
189 | else | 189 | else |
190 | { | 190 | { |
191 | void* (*fbaddr)(int x, int y) = FB_CURRENTVP_BUFFER->get_address_fn; | ||
191 | for(int i = 0; i < h; i++) | 192 | for(int i = 0; i < h; i++) |
192 | memcpy((fb_data *)FRAME + i * w, FBADDR(x,y + i), w * sizeof(fb_data)); | 193 | memcpy((fb_data *)FRAME + i * w, fbaddr(x,y + i), w * sizeof(fb_data)); |
193 | } | 194 | } |
194 | /* WARNING The LCDIF has a limitation on the vertical count ! In 16-bit packed mode | 195 | /* WARNING The LCDIF has a limitation on the vertical count ! In 16-bit packed mode |
195 | * (which we used, ie 16-bit per pixel, 2 pixels per 32-bit words), the v_count | 196 | * (which we used, ie 16-bit per pixel, 2 pixels per 32-bit words), the v_count |
diff --git a/firmware/target/arm/imx233/sansa-fuzeplus/lcd-fuzeplus.c b/firmware/target/arm/imx233/sansa-fuzeplus/lcd-fuzeplus.c index 92864c9ed7..ceb7b4e090 100644 --- a/firmware/target/arm/imx233/sansa-fuzeplus/lcd-fuzeplus.c +++ b/firmware/target/arm/imx233/sansa-fuzeplus/lcd-fuzeplus.c | |||
@@ -637,8 +637,9 @@ void lcd_update_rect(int x, int y, int w, int h) | |||
637 | } | 637 | } |
638 | else | 638 | else |
639 | { | 639 | { |
640 | void* (*fbaddr)(int x, int y) = FB_CURRENTVP_BUFFER->get_address_fn; | ||
640 | for(int i = 0; i < h; i++) | 641 | for(int i = 0; i < h; i++) |
641 | memcpy((fb_data *)FRAME + i * w, FBADDR(x,y + i), w * sizeof(fb_data)); | 642 | memcpy((fb_data *)FRAME + i * w, fbaddr(x,y + i), w * sizeof(fb_data)); |
642 | } | 643 | } |
643 | /* WARNING The LCDIF has a limitation on the vertical count ! In 16-bit packed mode | 644 | /* WARNING The LCDIF has a limitation on the vertical count ! In 16-bit packed mode |
644 | * (which we used, ie 16-bit per pixel, 2 pixels per 32-bit words), the v_count | 645 | * (which we used, ie 16-bit per pixel, 2 pixels per 32-bit words), the v_count |
diff --git a/firmware/target/arm/imx233/sony-nwz/lcd-nwze360.c b/firmware/target/arm/imx233/sony-nwz/lcd-nwze360.c index cfcf85bfc0..8f49bfa3eb 100644 --- a/firmware/target/arm/imx233/sony-nwz/lcd-nwze360.c +++ b/firmware/target/arm/imx233/sony-nwz/lcd-nwze360.c | |||
@@ -228,8 +228,9 @@ void lcd_update_rect(int x, int y, int w, int h) | |||
228 | } | 228 | } |
229 | else | 229 | else |
230 | { | 230 | { |
231 | void* (*fbaddr)(int x, int y) = FB_CURRENTVP_BUFFER->get_address_fn; | ||
231 | for(int i = 0; i < h; i++) | 232 | for(int i = 0; i < h; i++) |
232 | memcpy((fb_data *)FRAME + i * w, FBADDR(x,y + i), w * sizeof(fb_data)); | 233 | memcpy((fb_data *)FRAME + i * w, fbaddr(x,y + i), w * sizeof(fb_data)); |
233 | } | 234 | } |
234 | /* WARNING The LCDIF has a limitation on the vertical count ! In 16-bit packed mode | 235 | /* WARNING The LCDIF has a limitation on the vertical count ! In 16-bit packed mode |
235 | * (which we used, ie 16-bit per pixel, 2 pixels per 32-bit words), the v_count | 236 | * (which we used, ie 16-bit per pixel, 2 pixels per 32-bit words), the v_count |
diff --git a/firmware/target/arm/imx233/sony-nwz/lcd-nwze370.c b/firmware/target/arm/imx233/sony-nwz/lcd-nwze370.c index 999f4ee525..862522da15 100644 --- a/firmware/target/arm/imx233/sony-nwz/lcd-nwze370.c +++ b/firmware/target/arm/imx233/sony-nwz/lcd-nwze370.c | |||
@@ -189,8 +189,9 @@ void lcd_update_rect(int x, int y, int w, int h) | |||
189 | } | 189 | } |
190 | else | 190 | else |
191 | { | 191 | { |
192 | void* (*fbaddr)(int x, int y) = FB_CURRENTVP_BUFFER->get_address_fn; | ||
192 | for(int i = 0; i < h; i++) | 193 | for(int i = 0; i < h; i++) |
193 | memcpy((fb_data *)FRAME + i * w, FBADDR(x,y + i), w * sizeof(fb_data)); | 194 | memcpy((fb_data *)FRAME + i * w, fbaddr(x,y + i), w * sizeof(fb_data)); |
194 | } | 195 | } |
195 | /* WARNING The LCDIF has a limitation on the vertical count ! In 16-bit packed mode | 196 | /* WARNING The LCDIF has a limitation on the vertical count ! In 16-bit packed mode |
196 | * (which we used, ie 16-bit per pixel, 2 pixels per 32-bit words), the v_count | 197 | * (which we used, ie 16-bit per pixel, 2 pixels per 32-bit words), the v_count |
diff --git a/firmware/target/arm/ipod/lcd-gray.c b/firmware/target/arm/ipod/lcd-gray.c index d8695cdb10..883897b997 100644 --- a/firmware/target/arm/ipod/lcd-gray.c +++ b/firmware/target/arm/ipod/lcd-gray.c | |||
@@ -333,17 +333,18 @@ void lcd_update_rect(int x, int y, int width, int height) | |||
333 | x >>= 3; | 333 | x >>= 3; |
334 | width = xmax - x + 1; | 334 | width = xmax - x + 1; |
335 | 335 | ||
336 | for (; y <= ymax; y++) | 336 | void* (*fbaddr)(int x, int y) = FB_CURRENTVP_BUFFER->get_address_fn; |
337 | for (; y <= ymax; y++) | ||
337 | { | 338 | { |
338 | lcd_cmd_and_data(R_RAM_ADDR_SET, (y << 5) + addr_offset - x); | 339 | lcd_cmd_and_data(R_RAM_ADDR_SET, (y << 5) + addr_offset - x); |
339 | lcd_prepare_cmd(R_RAM_DATA); | 340 | lcd_prepare_cmd(R_RAM_DATA); |
340 | 341 | fb_data *data = fbaddr(2*x,y); | |
341 | #if defined(IPOD_MINI) || defined(IPOD_MINI2G) | 342 | #if defined(IPOD_MINI) || defined(IPOD_MINI2G) |
342 | if (pix_offset == -2) | 343 | if (pix_offset == -2) |
343 | lcd_write_data_shifted(FBADDR(2*x, y), width); | 344 | lcd_write_data_shifted(data, width); |
344 | else | 345 | else |
345 | #endif | 346 | #endif |
346 | lcd_write_data(FBADDR(2*x, y), width); | 347 | lcd_write_data(data, width); |
347 | } | 348 | } |
348 | } | 349 | } |
349 | 350 | ||
diff --git a/firmware/target/arm/lcd-ssd1815.c b/firmware/target/arm/lcd-ssd1815.c index 028362f91c..0af20cd34f 100644 --- a/firmware/target/arm/lcd-ssd1815.c +++ b/firmware/target/arm/lcd-ssd1815.c | |||
@@ -221,6 +221,7 @@ void lcd_update(void) | |||
221 | { | 221 | { |
222 | int y; | 222 | int y; |
223 | 223 | ||
224 | void* (*fbaddr)(int x, int y) = FB_CURRENTVP_BUFFER->get_address_fn; | ||
224 | /* Copy display bitmap to hardware */ | 225 | /* Copy display bitmap to hardware */ |
225 | for (y = 0; y < LCD_FBHEIGHT; y++) | 226 | for (y = 0; y < LCD_FBHEIGHT; y++) |
226 | { | 227 | { |
@@ -228,7 +229,7 @@ void lcd_update(void) | |||
228 | lcd_write_command (LCD_CNTL_HIGHCOL | ((xoffset >> 4) & 0xf)); | 229 | lcd_write_command (LCD_CNTL_HIGHCOL | ((xoffset >> 4) & 0xf)); |
229 | lcd_write_command (LCD_CNTL_LOWCOL | (xoffset & 0xf)); | 230 | lcd_write_command (LCD_CNTL_LOWCOL | (xoffset & 0xf)); |
230 | 231 | ||
231 | lcd_write_data (FBADDR(0, y), LCD_WIDTH); | 232 | lcd_write_data (fbaddr(0,y), LCD_WIDTH); |
232 | } | 233 | } |
233 | } | 234 | } |
234 | 235 | ||
@@ -249,6 +250,7 @@ void lcd_update_rect(int x, int y, int width, int height) | |||
249 | if(ymax >= LCD_FBHEIGHT) | 250 | if(ymax >= LCD_FBHEIGHT) |
250 | ymax = LCD_FBHEIGHT-1; | 251 | ymax = LCD_FBHEIGHT-1; |
251 | 252 | ||
253 | void* (*fbaddr)(int x, int y) = FB_CURRENTVP_BUFFER->get_address_fn; | ||
252 | /* Copy specified rectange bitmap to hardware */ | 254 | /* Copy specified rectange bitmap to hardware */ |
253 | for (; y <= ymax; y++) | 255 | for (; y <= ymax; y++) |
254 | { | 256 | { |
@@ -256,6 +258,6 @@ void lcd_update_rect(int x, int y, int width, int height) | |||
256 | lcd_write_command (LCD_CNTL_HIGHCOL | (((x+xoffset) >> 4) & 0xf)); | 258 | lcd_write_command (LCD_CNTL_HIGHCOL | (((x+xoffset) >> 4) & 0xf)); |
257 | lcd_write_command (LCD_CNTL_LOWCOL | ((x+xoffset) & 0xf)); | 259 | lcd_write_command (LCD_CNTL_LOWCOL | ((x+xoffset) & 0xf)); |
258 | 260 | ||
259 | lcd_write_data (FBADDR(x,y), width); | 261 | lcd_write_data (fbaddr(x,y), width); |
260 | } | 262 | } |
261 | } | 263 | } |
diff --git a/firmware/target/arm/olympus/mrobe-100/lcd-mr100.c b/firmware/target/arm/olympus/mrobe-100/lcd-mr100.c index d336ad7419..c10b4ca8f6 100644 --- a/firmware/target/arm/olympus/mrobe-100/lcd-mr100.c +++ b/firmware/target/arm/olympus/mrobe-100/lcd-mr100.c | |||
@@ -232,6 +232,7 @@ void lcd_update(void) | |||
232 | cmd1 = LCD_CNTL_HIGHCOL | (((xoffset) >> 4) & 0xf); | 232 | cmd1 = LCD_CNTL_HIGHCOL | (((xoffset) >> 4) & 0xf); |
233 | cmd2 = LCD_CNTL_LOWCOL | ((xoffset) & 0xf); | 233 | cmd2 = LCD_CNTL_LOWCOL | ((xoffset) & 0xf); |
234 | 234 | ||
235 | void* (*fbaddr)(int x, int y) = FB_CURRENTVP_BUFFER->get_address_fn; | ||
235 | /* Copy display bitmap to hardware */ | 236 | /* Copy display bitmap to hardware */ |
236 | for (y = 0; y < LCD_FBHEIGHT; y++) | 237 | for (y = 0; y < LCD_FBHEIGHT; y++) |
237 | { | 238 | { |
@@ -239,7 +240,7 @@ void lcd_update(void) | |||
239 | lcd_write_command(cmd1); | 240 | lcd_write_command(cmd1); |
240 | lcd_write_command(cmd2); | 241 | lcd_write_command(cmd2); |
241 | 242 | ||
242 | lcd_write_data (FBADDR(0, y), LCD_WIDTH); | 243 | lcd_write_data (fbaddr(0,y), LCD_WIDTH); |
243 | } | 244 | } |
244 | } | 245 | } |
245 | 246 | ||
@@ -264,6 +265,7 @@ void lcd_update_rect(int x, int y, int width, int height) | |||
264 | cmd1 = LCD_CNTL_HIGHCOL | (((x + xoffset) >> 4) & 0xf); | 265 | cmd1 = LCD_CNTL_HIGHCOL | (((x + xoffset) >> 4) & 0xf); |
265 | cmd2 = LCD_CNTL_LOWCOL | ((x + xoffset) & 0xf); | 266 | cmd2 = LCD_CNTL_LOWCOL | ((x + xoffset) & 0xf); |
266 | 267 | ||
268 | void* (*fbaddr)(int x, int y) = FB_CURRENTVP_BUFFER->get_address_fn; | ||
267 | /* Copy specified rectange bitmap to hardware */ | 269 | /* Copy specified rectange bitmap to hardware */ |
268 | for (; y <= ymax; y++) | 270 | for (; y <= ymax; y++) |
269 | { | 271 | { |
@@ -271,6 +273,6 @@ void lcd_update_rect(int x, int y, int width, int height) | |||
271 | lcd_write_command(cmd1); | 273 | lcd_write_command(cmd1); |
272 | lcd_write_command(cmd2); | 274 | lcd_write_command(cmd2); |
273 | 275 | ||
274 | lcd_write_data (FBADDR(x,y), width); | 276 | lcd_write_data (fbaddr(x,y), width); |
275 | } | 277 | } |
276 | } | 278 | } |
diff --git a/firmware/target/arm/rk27xx/lcdif-rk27xx.c b/firmware/target/arm/rk27xx/lcdif-rk27xx.c index e6af0d978a..618b476480 100644 --- a/firmware/target/arm/rk27xx/lcdif-rk27xx.c +++ b/firmware/target/arm/rk27xx/lcdif-rk27xx.c | |||
@@ -198,9 +198,10 @@ static void create_llp(int x, int y, int width, int height) | |||
198 | 198 | ||
199 | width = width>>1; | 199 | width = width>>1; |
200 | 200 | ||
201 | void* (*fbaddr)(int x, int y) = FB_CURRENTVP_BUFFER->get_address_fn; | ||
201 | /* build LLPs */ | 202 | /* build LLPs */ |
202 | for (i=0; i<height; i++) | 203 | for (i=0; i<height; i++) |
203 | llp_setup((void *)FBADDR(x,y+i), | 204 | llp_setup((void *)fbaddr(x,y+i), |
204 | (void*)(LCD_BUFF+((i%4)*4*width)), | 205 | (void*)(LCD_BUFF+((i%4)*4*width)), |
205 | &(scr_llp[i]), | 206 | &(scr_llp[i]), |
206 | width); | 207 | width); |
diff --git a/firmware/target/arm/s5l8700/yps3/lcd-yps3.c b/firmware/target/arm/s5l8700/yps3/lcd-yps3.c index a9830bca57..eec11e34b8 100644 --- a/firmware/target/arm/s5l8700/yps3/lcd-yps3.c +++ b/firmware/target/arm/s5l8700/yps3/lcd-yps3.c | |||
@@ -299,14 +299,15 @@ void lcd_update_rect(int x, int y, int width, int height) | |||
299 | { | 299 | { |
300 | fb_data* p; | 300 | fb_data* p; |
301 | int h, w; | 301 | int h, w; |
302 | 302 | ||
303 | void* (*fbaddr)(int x, int y) = FB_CURRENTVP_BUFFER->get_address_fn; | ||
303 | if (lcd_type == 1) { | 304 | if (lcd_type == 1) { |
304 | /* TODO implement and test */ | 305 | /* TODO implement and test */ |
305 | lcd_set_window1(x, y, width, height); | 306 | lcd_set_window1(x, y, width, height); |
306 | lcd_set_position1(x, y); | 307 | lcd_set_position1(x, y); |
307 | 308 | ||
308 | for (h = 0; h < height; h++) { | 309 | for (h = 0; h < height; h++) { |
309 | p = FBADDR(0,y); | 310 | p = fbaddr(0,y); |
310 | for (w = 0; w < LCD_WIDTH; w++) { | 311 | for (w = 0; w < LCD_WIDTH; w++) { |
311 | while (LCD_STATUS & 0x10); | 312 | while (LCD_STATUS & 0x10); |
312 | LCD_WDATA = *p++; | 313 | LCD_WDATA = *p++; |
@@ -317,9 +318,9 @@ void lcd_update_rect(int x, int y, int width, int height) | |||
317 | else { | 318 | else { |
318 | lcd_set_window2(x, y, width, height); | 319 | lcd_set_window2(x, y, width, height); |
319 | lcd_set_position2(x, y); | 320 | lcd_set_position2(x, y); |
320 | 321 | ||
321 | for (h = 0; h < height; h++) { | 322 | for (h = 0; h < height; h++) { |
322 | p = FBADDR(x,y); | 323 | p = fbaddr(x,y); |
323 | for (w = 0; w < width; w++) { | 324 | for (w = 0; w < width; w++) { |
324 | while (LCD_STATUS & 0x10); | 325 | while (LCD_STATUS & 0x10); |
325 | LCD_WDATA = *p++; | 326 | LCD_WDATA = *p++; |
diff --git a/firmware/target/arm/samsung/yh920/lcd-yh920.c b/firmware/target/arm/samsung/yh920/lcd-yh920.c index 06aa3d718d..6a579f382a 100644 --- a/firmware/target/arm/samsung/yh920/lcd-yh920.c +++ b/firmware/target/arm/samsung/yh920/lcd-yh920.c | |||
@@ -253,13 +253,14 @@ void lcd_update_rect(int x, int y, int width, int height) | |||
253 | if(ymax >= LCD_FBHEIGHT) | 253 | if(ymax >= LCD_FBHEIGHT) |
254 | ymax = LCD_FBHEIGHT-1; | 254 | ymax = LCD_FBHEIGHT-1; |
255 | 255 | ||
256 | void* (*fbaddr)(int x, int y) = FB_CURRENTVP_BUFFER->get_address_fn; | ||
256 | /* Copy specified rectange bitmap to hardware */ | 257 | /* Copy specified rectange bitmap to hardware */ |
257 | for (; y <= ymax; y++) | 258 | for (; y <= ymax; y++) |
258 | { | 259 | { |
259 | lcd_write_reg(LCD_CNTL_PAGE, y); | 260 | lcd_write_reg(LCD_CNTL_PAGE, y); |
260 | lcd_write_reg(LCD_CNTL_COLUMN, x); | 261 | lcd_write_reg(LCD_CNTL_COLUMN, x); |
261 | 262 | ||
262 | addr = FBADDR(x,y); | 263 | addr = fbaddr(x,y); |
263 | 264 | ||
264 | lcd_send_cmd(LCD_CNTL_DATA_WRITE); | 265 | lcd_send_cmd(LCD_CNTL_DATA_WRITE); |
265 | lcd_write_data(addr, width); | 266 | lcd_write_data(addr, width); |