diff options
Diffstat (limited to 'firmware/target/arm/imx31/gigabeat-s')
-rw-r--r-- | firmware/target/arm/imx31/gigabeat-s/lcd-imx31.c | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/firmware/target/arm/imx31/gigabeat-s/lcd-imx31.c b/firmware/target/arm/imx31/gigabeat-s/lcd-imx31.c index 07258fa123..b834320c12 100644 --- a/firmware/target/arm/imx31/gigabeat-s/lcd-imx31.c +++ b/firmware/target/arm/imx31/gigabeat-s/lcd-imx31.c | |||
@@ -11,13 +11,16 @@ static volatile bool lcd_on = true; | |||
11 | volatile bool lcd_poweroff = false; | 11 | volatile bool lcd_poweroff = false; |
12 | static unsigned lcd_yuv_options = 0; | 12 | static unsigned lcd_yuv_options = 0; |
13 | /* | 13 | /* |
14 | ** These are imported from lcd-16bit.c | 14 | ** This is imported from lcd-16bit.c |
15 | */ | 15 | */ |
16 | extern unsigned fg_pattern; | ||
17 | extern unsigned bg_pattern; | ||
18 | |||
19 | extern struct viewport* current_vp; | 16 | extern struct viewport* current_vp; |
20 | 17 | ||
18 | /* Copies a rectangle from one framebuffer to another. Can be used in | ||
19 | single transfer mode with width = num pixels, and height = 1 which | ||
20 | allows a full-width rectangle to be copied more efficiently. */ | ||
21 | extern void lcd_copy_buffer_rect(fb_data *dst, const fb_data *src, | ||
22 | int width, int height); | ||
23 | |||
21 | #if 0 | 24 | #if 0 |
22 | bool lcd_enabled() | 25 | bool lcd_enabled() |
23 | { | 26 | { |
@@ -106,26 +109,25 @@ void lcd_bitmap_transparent_part(const fb_data *src, int src_x, int src_y, | |||
106 | int stride, int x, int y, int width, | 109 | int stride, int x, int y, int width, |
107 | int height) | 110 | int height) |
108 | { | 111 | { |
109 | #if 0 | ||
110 | int w, px; | 112 | int w, px; |
111 | fb_data *dst; | 113 | fb_data *dst; |
112 | 114 | ||
113 | if (x + width > LCD_WIDTH) | 115 | if (x + width > current_vp->width) |
114 | width = LCD_WIDTH - x; /* Clip right */ | 116 | width = current_vp->width - x; /* Clip right */ |
115 | if (x < 0) | 117 | if (x < 0) |
116 | width += x, x = 0; /* Clip left */ | 118 | width += x, x = 0; /* Clip left */ |
117 | if (width <= 0) | 119 | if (width <= 0) |
118 | return; /* nothing left to do */ | 120 | return; /* nothing left to do */ |
119 | 121 | ||
120 | if (y + height > LCD_HEIGHT) | 122 | if (y + height > current_vp->height) |
121 | height = LCD_HEIGHT - y; /* Clip bottom */ | 123 | height = current_vp->height - y; /* Clip bottom */ |
122 | if (y < 0) | 124 | if (y < 0) |
123 | height += y, y = 0; /* Clip top */ | 125 | height += y, y = 0; /* Clip top */ |
124 | if (height <= 0) | 126 | if (height <= 0) |
125 | return; /* nothing left to do */ | 127 | return; /* nothing left to do */ |
126 | 128 | ||
127 | src += stride * src_y + src_x; /* move starting point */ | 129 | src += stride * src_y + src_x; /* move starting point */ |
128 | dst = &lcd_framebuffer[y][x]; | 130 | dst = &lcd_framebuffer[current_vp->y+y][current_vp->x+x]; |
129 | 131 | ||
130 | asm volatile ( | 132 | asm volatile ( |
131 | ".rowstart: \r\n" | 133 | ".rowstart: \r\n" |
@@ -152,7 +154,6 @@ void lcd_bitmap_transparent_part(const fb_data *src, int src_x, int src_y, | |||
152 | [fgcolor]"r"(REPLACEWITHFG_COLOR), | 154 | [fgcolor]"r"(REPLACEWITHFG_COLOR), |
153 | [fgpat]"r"(current_vp->fg_pattern) | 155 | [fgpat]"r"(current_vp->fg_pattern) |
154 | ); | 156 | ); |
155 | #endif | ||
156 | } | 157 | } |
157 | 158 | ||
158 | void lcd_yuv_set_options(unsigned options) | 159 | void lcd_yuv_set_options(unsigned options) |