summaryrefslogtreecommitdiffstats
path: root/firmware
diff options
context:
space:
mode:
authorDave Chapman <dave@dchapman.com>2007-05-15 14:26:44 +0000
committerDave Chapman <dave@dchapman.com>2007-05-15 14:26:44 +0000
commite22b33ec72abbcc71df30a38328311dd68a178c7 (patch)
tree0818bcd82df7a5f252d391d04b70394696a9d659 /firmware
parent4bf27eccdd91c9999e1bcbfe6350193498e30e96 (diff)
downloadrockbox-e22b33ec72abbcc71df30a38328311dd68a178c7.tar.gz
rockbox-e22b33ec72abbcc71df30a38328311dd68a178c7.zip
Gigabeat LCD driver cleanup: Revert the DMA optimisations to the gigabeat LCD driver - they are both buggy (the wrong background colour was often seen, e.g. in the USB screen after using a plugin) and significantly slower than the standard implementations (which use the ARM-optimised mem* functions) in lcd-16bit.c. lcd_clear_update was 4.5 times slower with DMA when a backdrop is in use, and 12 times slower with DMA when no backdrop is in use.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13392 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware')
-rw-r--r--firmware/drivers/lcd-16bit.c7
-rw-r--r--firmware/export/lcd.h2
-rw-r--r--firmware/target/arm/s3c2440/gigabeat-fx/lcd-meg-fx.c105
3 files changed, 0 insertions, 114 deletions
diff --git a/firmware/drivers/lcd-16bit.c b/firmware/drivers/lcd-16bit.c
index 67736ddf85..0a3d193cad 100644
--- a/firmware/drivers/lcd-16bit.c
+++ b/firmware/drivers/lcd-16bit.c
@@ -105,24 +105,20 @@ int lcd_get_drawmode(void)
return drawmode;
}
-#if !defined(TOSHIBA_GIGABEAT_F) || defined(SIMULATOR)
void lcd_set_foreground(unsigned color)
{
fg_pattern = color;
}
-#endif
unsigned lcd_get_foreground(void)
{
return fg_pattern;
}
-#if !defined(TOSHIBA_GIGABEAT_F) || defined(SIMULATOR)
void lcd_set_background(unsigned color)
{
bg_pattern = color;
}
-#endif
unsigned lcd_get_background(void)
{
@@ -221,7 +217,6 @@ void lcd_set_backdrop(fb_data* backdrop)
lcd_backdrop_offset = 0;
lcd_fastpixelfuncs = lcd_fastpixelfuncs_bgcolor;
}
- lcd_device_prepare_backdrop(backdrop);
}
fb_data* lcd_get_backdrop(void)
@@ -232,7 +227,6 @@ fb_data* lcd_get_backdrop(void)
/*** drawing functions ***/
/* Clear the whole display */
-#if !defined(TOSHIBA_GIGABEAT_F) || defined(SIMULATOR)
void lcd_clear_display(void)
{
fb_data *dst = LCDADDR(0, 0);
@@ -250,7 +244,6 @@ void lcd_clear_display(void)
}
scrolling_lines = 0;
}
-#endif
/* Set a single pixel */
void lcd_drawpixel(int x, int y)
diff --git a/firmware/export/lcd.h b/firmware/export/lcd.h
index 40e5129ad3..077664040e 100644
--- a/firmware/export/lcd.h
+++ b/firmware/export/lcd.h
@@ -346,10 +346,8 @@ extern void lcd_set_drawinfo(int mode, unsigned foreground,
unsigned background);
void lcd_set_backdrop(fb_data* backdrop);
#if defined(TOSHIBA_GIGABEAT_F) && !defined(SIMULATOR)
-void lcd_device_prepare_backdrop(fb_data* backdrop);
bool lcd_enabled(void);
#else
-#define lcd_device_prepare_backdrop(x) ;
#define lcd_enabled() true
#endif
diff --git a/firmware/target/arm/s3c2440/gigabeat-fx/lcd-meg-fx.c b/firmware/target/arm/s3c2440/gigabeat-fx/lcd-meg-fx.c
index 11edcfecb1..3bb2801b02 100644
--- a/firmware/target/arm/s3c2440/gigabeat-fx/lcd-meg-fx.c
+++ b/firmware/target/arm/s3c2440/gigabeat-fx/lcd-meg-fx.c
@@ -13,11 +13,6 @@
#include "bidi.h"
#define LCDADDR(x, y) (&lcd_framebuffer[(y)][(x)])
-/*
-** We prepare foreground and background fills ahead of time - DMA fills in 16 byte groups
-*/
-unsigned long fg_pattern_blit[4];
-unsigned long bg_pattern_blit[4];
volatile bool use_dma_blit = false;
static volatile bool lcd_on = true;
@@ -77,11 +72,6 @@ void lcd_init_device(void)
LCDCON5 |= 1 << 11; /* Switch from 555I mode to 565 mode */
#if !defined(BOOTLOADER)
- memset16(fg_pattern_blit, fg_pattern, sizeof(fg_pattern_blit)/2);
- memset16(bg_pattern_blit, bg_pattern, sizeof(bg_pattern_blit)/2);
- clean_dcache_range((void *)fg_pattern_blit, sizeof(fg_pattern_blit));
- clean_dcache_range((void *)bg_pattern_blit, sizeof(bg_pattern_blit));
- use_dma_blit = true;
lcd_poweroff = false;
#endif
}
@@ -155,101 +145,6 @@ void lcd_enable(bool state)
}
}
-void lcd_set_foreground(unsigned color)
-{
- fg_pattern = color;
-
- memset16(fg_pattern_blit, fg_pattern, sizeof(fg_pattern_blit)/2);
- invalidate_dcache_range((void *)fg_pattern_blit, sizeof(fg_pattern_blit));
-}
-
-void lcd_set_background(unsigned color)
-{
- bg_pattern = color;
- memset16(bg_pattern_blit, bg_pattern, sizeof(bg_pattern_blit)/2);
- invalidate_dcache_range((void *)bg_pattern_blit, sizeof(bg_pattern_blit));
-}
-
-void lcd_device_prepare_backdrop(fb_data* backdrop)
-{
- if(backdrop)
- invalidate_dcache_range((void *)backdrop, (LCD_HEIGHT * sizeof(fb_data) * LCD_WIDTH));
-}
-
-void lcd_clear_display_dma(void)
-{
- void *src;
- bool inc = false;
-
- if(!lcd_on) {
- sleep(200);
- }
- if (lcd_get_drawmode() & DRMODE_INVERSEVID)
- src = fg_pattern_blit;
- else
- {
- fb_data* lcd_backdrop = lcd_get_backdrop();
-
- if (!lcd_backdrop)
- src = bg_pattern_blit;
- else
- {
- src = lcd_backdrop;
- inc = true;
- }
- }
- /* Wait for any pending transfer to complete */
- while((DSTAT3 & 0x000fffff))
- CLKCON |= (1 << 2); /* set IDLE bit */
- DMASKTRIG3 |= 0x4; /* Stop controller */
- DIDST3 = ((int) &lcd_framebuffer[0][0]) + 0x30000000; /* set DMA dest, physical address */
- DIDSTC3 = 0; /* Dest on AHB, increment */
-
- DISRC3 = ((int) src) + 0x30000000; /* Set source, in physical space */
- DISRCC3 = inc ? 0x00 : 0x01; /* memory is on AHB bus, increment addresses based on backdrop */
-
- /* Handshake on AHB, Burst mode, whole service mode, no reload, move 32-bits */
- DCON3 = ((1<<30) | (1<<28) | (1<<27) | (1<<22) | (2<<20)) | ((LCD_WIDTH*LCD_HEIGHT*sizeof(fb_data)) >> 4);
-
- /* Dump DCache for dest, we are about to overwrite it with DMA */
- invalidate_dcache_range((void *)lcd_framebuffer, sizeof(lcd_framebuffer));
- /* Activate the channel */
- DMASKTRIG3 = 2;
- /* Start DMA */
- DMASKTRIG3 |= 1;
-
- /* Wait for transfer to complete */
- while((DSTAT3 & 0x000fffff))
- CLKCON |= (1 << 2); /* set IDLE bit */
-}
-
-void lcd_clear_display(void)
-{
- lcd_stop_scroll();
-
- if(use_dma_blit)
- {
- lcd_clear_display_dma();
- return;
- }
-
- fb_data *dst = &lcd_framebuffer[0][0];
-
- if (lcd_get_drawmode() & DRMODE_INVERSEVID)
- {
- memset16(dst, fg_pattern, LCD_WIDTH*LCD_HEIGHT);
- }
- else
- {
- fb_data* lcd_backdrop = lcd_get_backdrop();
- if (!lcd_backdrop)
- memset16(dst, bg_pattern, LCD_WIDTH*LCD_HEIGHT);
- else
- memcpy(dst, lcd_backdrop, sizeof(lcd_framebuffer));
- }
-}
-
-
/* Update the display.
This must be called after all other LCD functions that change the display. */
void lcd_update(void)