diff options
author | Dave Chapman <dave@dchapman.com> | 2007-05-15 16:00:06 +0000 |
---|---|---|
committer | Dave Chapman <dave@dchapman.com> | 2007-05-15 16:00:06 +0000 |
commit | 0030378f74918f2d4f92517a2b36c7a0b473cbb9 (patch) | |
tree | 62cf911dc0b6ec60551fcb328d92055f4225f3e2 | |
parent | e22b33ec72abbcc71df30a38328311dd68a178c7 (diff) | |
download | rockbox-0030378f74918f2d4f92517a2b36c7a0b473cbb9.tar.gz rockbox-0030378f74918f2d4f92517a2b36c7a0b473cbb9.zip |
More gigabeat LCD cleanup and completely remove the use of DMA for lcd_update_rect() (this was accidentally disabled anyway by the previous commit). The DMA version of lcd_update_rect() managed 64fps, but the memcpy based implementation manages 264fps.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13393 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | firmware/drivers/lcd-16bit.c | 9 | ||||
-rw-r--r-- | firmware/target/arm/s3c2440/gigabeat-fx/lcd-meg-fx.c | 36 |
2 files changed, 3 insertions, 42 deletions
diff --git a/firmware/drivers/lcd-16bit.c b/firmware/drivers/lcd-16bit.c index 0a3d193cad..44e42ad617 100644 --- a/firmware/drivers/lcd-16bit.c +++ b/firmware/drivers/lcd-16bit.c | |||
@@ -33,11 +33,6 @@ | |||
33 | #include "font.h" | 33 | #include "font.h" |
34 | #include "rbunicode.h" | 34 | #include "rbunicode.h" |
35 | #include "bidi.h" | 35 | #include "bidi.h" |
36 | #if defined(TOSHIBA_GIGABEAT_F) | ||
37 | #define NON_GB_STATIC | ||
38 | #else | ||
39 | #define NON_GB_STATIC static | ||
40 | #endif | ||
41 | 36 | ||
42 | #define SCROLLABLE_LINES ((LCD_HEIGHT+4)/5 < 32 ? (LCD_HEIGHT+4)/5 : 32) | 37 | #define SCROLLABLE_LINES ((LCD_HEIGHT+4)/5 < 32 ? (LCD_HEIGHT+4)/5 : 32) |
43 | 38 | ||
@@ -54,8 +49,8 @@ fb_data lcd_framebuffer[LCD_FBHEIGHT][LCD_FBWIDTH] IRAM_LCDFRAMEBUFFER __attribu | |||
54 | static fb_data* lcd_backdrop = NULL; | 49 | static fb_data* lcd_backdrop = NULL; |
55 | static long lcd_backdrop_offset IDATA_ATTR = 0; | 50 | static long lcd_backdrop_offset IDATA_ATTR = 0; |
56 | 51 | ||
57 | NON_GB_STATIC unsigned fg_pattern IDATA_ATTR = LCD_DEFAULT_FG; | 52 | static unsigned fg_pattern IDATA_ATTR = LCD_DEFAULT_FG; |
58 | NON_GB_STATIC unsigned bg_pattern IDATA_ATTR = LCD_DEFAULT_BG; | 53 | static unsigned bg_pattern IDATA_ATTR = LCD_DEFAULT_BG; |
59 | static int drawmode = DRMODE_SOLID; | 54 | static int drawmode = DRMODE_SOLID; |
60 | static int xmargin = 0; | 55 | static int xmargin = 0; |
61 | static int ymargin = 0; | 56 | static int ymargin = 0; |
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 3bb2801b02..17b0a6966e 100644 --- a/firmware/target/arm/s3c2440/gigabeat-fx/lcd-meg-fx.c +++ b/firmware/target/arm/s3c2440/gigabeat-fx/lcd-meg-fx.c | |||
@@ -14,7 +14,6 @@ | |||
14 | 14 | ||
15 | #define LCDADDR(x, y) (&lcd_framebuffer[(y)][(x)]) | 15 | #define LCDADDR(x, y) (&lcd_framebuffer[(y)][(x)]) |
16 | 16 | ||
17 | volatile bool use_dma_blit = false; | ||
18 | static volatile bool lcd_on = true; | 17 | static volatile bool lcd_on = true; |
19 | volatile bool lcd_poweroff = false; | 18 | volatile bool lcd_poweroff = false; |
20 | /* | 19 | /* |
@@ -89,40 +88,7 @@ void lcd_update_rect(int x, int y, int width, int height) | |||
89 | sleep(200); | 88 | sleep(200); |
90 | return; | 89 | return; |
91 | } | 90 | } |
92 | if (use_dma_blit) | 91 | memcpy(((char*)FRAME) + (y * sizeof(fb_data) * LCD_WIDTH), ((char *)&lcd_framebuffer) + (y * sizeof(fb_data) * LCD_WIDTH), ((height * sizeof(fb_data) * LCD_WIDTH))); |
93 | { | ||
94 | /* Wait for this controller to stop pending transfer */ | ||
95 | while((DSTAT1 & 0x000fffff)) | ||
96 | CLKCON |= (1 << 2); /* set IDLE bit */ | ||
97 | |||
98 | /* Flush DCache */ | ||
99 | invalidate_dcache_range((void *)(((int) &lcd_framebuffer[0][0])+(y * sizeof(fb_data) * LCD_WIDTH)), (height * sizeof(fb_data) * LCD_WIDTH)); | ||
100 | |||
101 | /* set DMA dest */ | ||
102 | DIDST1 = ((int) FRAME) + (y * sizeof(fb_data) * LCD_WIDTH); | ||
103 | |||
104 | /* FRAME on AHB buf, increment */ | ||
105 | DIDSTC1 = 0; | ||
106 | /* Handshake on AHB, Burst transfer, Whole service, Don't reload, transfer 32-bits */ | ||
107 | DCON1 = ((1<<30) | (1<<28) | (1<<27) | (1<<22) | (2<<20)) | ((height * sizeof(fb_data) * LCD_WIDTH) >> 4); | ||
108 | |||
109 | /* set DMA source */ | ||
110 | DISRC1 = ((int) &lcd_framebuffer[0][0]) + (y * sizeof(fb_data) * LCD_WIDTH) + 0x30000000; | ||
111 | /* memory is on AHB bus, increment addresses */ | ||
112 | DISRCC1 = 0x00; | ||
113 | |||
114 | /* Activate the channel */ | ||
115 | DMASKTRIG1 = 0x2; | ||
116 | |||
117 | /* Start DMA */ | ||
118 | DMASKTRIG1 |= 0x1; | ||
119 | |||
120 | /* Wait for transfer to complete */ | ||
121 | while((DSTAT1 & 0x000fffff)) | ||
122 | CLKCON |= (1 << 2); /* set IDLE bit */ | ||
123 | } | ||
124 | else | ||
125 | memcpy(((char*)FRAME) + (y * sizeof(fb_data) * LCD_WIDTH), ((char *)&lcd_framebuffer) + (y * sizeof(fb_data) * LCD_WIDTH), ((height * sizeof(fb_data) * LCD_WIDTH))); | ||
126 | } | 92 | } |
127 | 93 | ||
128 | 94 | ||