diff options
author | Linus Nielsen Feltzing <linus@haxx.se> | 2005-12-21 00:52:02 +0000 |
---|---|---|
committer | Linus Nielsen Feltzing <linus@haxx.se> | 2005-12-21 00:52:02 +0000 |
commit | c70eb572c198fc1e7cb8c162ebb13586a55780bc (patch) | |
tree | cca3f8ad379c0f553b8421f304a4a9d72177e3fc /firmware/drivers | |
parent | b2295a4afb86634250a35312f056f3007eb9b42d (diff) | |
download | rockbox-c70eb572c198fc1e7cb8c162ebb13586a55780bc.tar.gz rockbox-c70eb572c198fc1e7cb8c162ebb13586a55780bc.zip |
H300: Roughly 20% faster LCD updates with DMA
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8271 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/drivers')
-rw-r--r-- | firmware/drivers/lcd-16bit.c | 2 | ||||
-rw-r--r-- | firmware/drivers/lcd-h300.c | 21 |
2 files changed, 17 insertions, 6 deletions
diff --git a/firmware/drivers/lcd-16bit.c b/firmware/drivers/lcd-16bit.c index 582050c878..6337fa1ea7 100644 --- a/firmware/drivers/lcd-16bit.c +++ b/firmware/drivers/lcd-16bit.c | |||
@@ -36,7 +36,7 @@ | |||
36 | #define SCROLLABLE_LINES 26 | 36 | #define SCROLLABLE_LINES 26 |
37 | 37 | ||
38 | /*** globals ***/ | 38 | /*** globals ***/ |
39 | fb_data lcd_framebuffer[LCD_HEIGHT][LCD_WIDTH] __attribute__ ((aligned (4))); | 39 | fb_data lcd_framebuffer[LCD_HEIGHT][LCD_WIDTH] __attribute__ ((aligned (16))); |
40 | 40 | ||
41 | static unsigned fg_pattern IDATA_ATTR = LCD_DEFAULT_FG; | 41 | static unsigned fg_pattern IDATA_ATTR = LCD_DEFAULT_FG; |
42 | static unsigned bg_pattern IDATA_ATTR = LCD_DEFAULT_BG; | 42 | static unsigned bg_pattern IDATA_ATTR = LCD_DEFAULT_BG; |
diff --git a/firmware/drivers/lcd-h300.c b/firmware/drivers/lcd-h300.c index bb2f9ec777..149062be96 100644 --- a/firmware/drivers/lcd-h300.c +++ b/firmware/drivers/lcd-h300.c | |||
@@ -89,12 +89,20 @@ inline void lcd_begin_write_gram(void) | |||
89 | *(volatile unsigned short *)0xf0000000 = R_WRITE_DATA_2_GRAM; | 89 | *(volatile unsigned short *)0xf0000000 = R_WRITE_DATA_2_GRAM; |
90 | } | 90 | } |
91 | 91 | ||
92 | /* called very frequently - inline! */ | 92 | void lcd_write_data(const unsigned short* p_bytes, int count) ICODE_ATTR; |
93 | inline void lcd_write_data(const unsigned short* p_bytes, int count) ICODE_ATTR; | 93 | void lcd_write_data(const unsigned short* p_bytes, int count) |
94 | inline void lcd_write_data(const unsigned short* p_bytes, int count) | ||
95 | { | 94 | { |
96 | while(count--) | 95 | SAR1 = (unsigned long)p_bytes; /* Destination address */ |
97 | *(volatile unsigned short *)0xf0000002 = *p_bytes++; | 96 | while(count) |
97 | { | ||
98 | int cnt = MIN(count, 256); | ||
99 | DAR1 = (unsigned long)0xf0000002; /* Destination address */ | ||
100 | BCR1 = cnt*2; /* Bytes to transfer */ | ||
101 | DCR1 = 0x02000000 | DMA_SINC | (2 << 20) | (2 << 17) | DMA_START; | ||
102 | while(!(DSR1 & 1)) {}; | ||
103 | DSR1 = 1; | ||
104 | count -= cnt; | ||
105 | } | ||
98 | } | 106 | } |
99 | 107 | ||
100 | /*** hardware configuration ***/ | 108 | /*** hardware configuration ***/ |
@@ -131,6 +139,9 @@ void lcd_roll(int lines) | |||
131 | /* LCD init */ | 139 | /* LCD init */ |
132 | void lcd_init_device(void) | 140 | void lcd_init_device(void) |
133 | { | 141 | { |
142 | MPARK = 0x81; /* PARK[1,0]=10 + BCR24BIT */ | ||
143 | DSR1 = 1; | ||
144 | |||
134 | /* GPO46 is LCD RESET */ | 145 | /* GPO46 is LCD RESET */ |
135 | or_l(0x00004000, &GPIO1_OUT); | 146 | or_l(0x00004000, &GPIO1_OUT); |
136 | or_l(0x00004000, &GPIO1_ENABLE); | 147 | or_l(0x00004000, &GPIO1_ENABLE); |