summaryrefslogtreecommitdiff
path: root/firmware
diff options
context:
space:
mode:
Diffstat (limited to 'firmware')
-rw-r--r--firmware/target/arm/tms320dm320/mrobe-500/lcd-mr500.c43
1 files changed, 37 insertions, 6 deletions
diff --git a/firmware/target/arm/tms320dm320/mrobe-500/lcd-mr500.c b/firmware/target/arm/tms320dm320/mrobe-500/lcd-mr500.c
index 90c96384fb..201b6e8063 100644
--- a/firmware/target/arm/tms320dm320/mrobe-500/lcd-mr500.c
+++ b/firmware/target/arm/tms320dm320/mrobe-500/lcd-mr500.c
@@ -27,6 +27,7 @@
27#include "string.h" 27#include "string.h"
28#include "kernel.h" 28#include "kernel.h"
29#include "memory.h" 29#include "memory.h"
30#include "mmu-arm.h"
30#include "system-target.h" 31#include "system-target.h"
31#include "lcd.h" 32#include "lcd.h"
32#include "lcd-target.h" 33#include "lcd-target.h"
@@ -280,9 +281,15 @@ static void dma_start_transfer16( char *src, int src_x, int src_y, int stride,
280 char *dst; 281 char *dst;
281 282
282 /* Addresses are relative to start of SDRAM */ 283 /* Addresses are relative to start of SDRAM */
283 src = src + (src_y*LCD_HEIGHT + src_x) * pix_width - CONFIG_SDRAM_START; 284 src = src + (src_y*LCD_HEIGHT + src_x) * pix_width;
284 dst = (char *)FRAME + (y * LCD_HEIGHT + x) * pix_width 285 dst = (char *)FRAME + (y * LCD_HEIGHT + x) * pix_width;
285 - CONFIG_SDRAM_START; 286
287 /* Flush the area that is being copied from. */
288 clean_dcache_range(src, (stride*pix_width*width));
289
290 /* Addresses are relative to start of SDRAM */
291 src -= CONFIG_SDRAM_START;
292 dst -= CONFIG_SDRAM_START;
286 293
287 /* Enable Clocks */ 294 /* Enable Clocks */
288 IO_CLK_MOD1 |= 1<<8; 295 IO_CLK_MOD1 |= 1<<8;
@@ -346,10 +353,18 @@ static void dma_start_transfer16( char *src, int src_x, int src_y, int stride,
346 int x, int y, 353 int x, int y,
347 int width, int height, int pix_width) { 354 int width, int height, int pix_width) {
348 char *dst; 355 char *dst;
349 /* Addresses are relative to start of SDRAM */ 356
350 src = src + (src_x*LCD_HEIGHT + src_y) * pix_width - CONFIG_SDRAM_START; 357 /* Calculate starting place */
358 src = src + (src_x*LCD_HEIGHT + src_y) * pix_width;
351 dst = (char *)FRAME + (LCD_HEIGHT*(LCD_WIDTH-1) - x * LCD_HEIGHT + y) 359 dst = (char *)FRAME + (LCD_HEIGHT*(LCD_WIDTH-1) - x * LCD_HEIGHT + y)
352 * pix_width - CONFIG_SDRAM_START; 360 * pix_width;
361
362 /* Flush the area that is being copied from. */
363 clean_dcache_range(src, (stride*pix_width*width));
364
365 /* Addresses are relative to start of SDRAM */
366 src -= CONFIG_SDRAM_START;
367 dst -= CONFIG_SDRAM_START;
353 368
354 /* Enable Clocks */ 369 /* Enable Clocks */
355 IO_CLK_MOD1 |= 1<<8; 370 IO_CLK_MOD1 |= 1<<8;
@@ -458,9 +473,25 @@ void lcd_update_rect(int x, int y, int width, int height)
458#else 473#else
459 474
460#if defined(LCD_STRIDEFORMAT) && LCD_STRIDEFORMAT == VERTICAL_STRIDE 475#if defined(LCD_STRIDEFORMAT) && LCD_STRIDEFORMAT == VERTICAL_STRIDE
476
477#if defined(LCD_USE_DMA)
461 dma_start_transfer16( (char *)lcd_framebuffer, x, y, LCD_HEIGHT, 478 dma_start_transfer16( (char *)lcd_framebuffer, x, y, LCD_HEIGHT,
462 x, y, width, height, 2); 479 x, y, width, height, 2);
463#else 480#else
481 fb_data *src;
482 fb_data *dst;
483 src = &lcd_framebuffer[0][0] + (x*LCD_HEIGHT + y);
484 dst = FRAME + (LCD_HEIGHT*(LCD_WIDTH-1) - x * LCD_HEIGHT + y);
485
486 while(width > 0) {
487 memcpy(src, dst, height);
488 src += LCD_HEIGHT;
489 dst -= LCD_HEIGHT;
490 width--;
491 }
492#endif
493
494#else
464 register fb_data *dst, *src; 495 register fb_data *dst, *src;
465 src = &lcd_framebuffer[y][x]; 496 src = &lcd_framebuffer[y][x];
466 497