summaryrefslogtreecommitdiff
path: root/firmware/drivers/lcd-h300.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/drivers/lcd-h300.c')
-rw-r--r--firmware/drivers/lcd-h300.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/firmware/drivers/lcd-h300.c b/firmware/drivers/lcd-h300.c
index b7865fa7c5..3e5642e35d 100644
--- a/firmware/drivers/lcd-h300.c
+++ b/firmware/drivers/lcd-h300.c
@@ -304,10 +304,11 @@ void lcd_blit(const fb_data* data, int x, int by, int width,
304/* Line write helper function for lcd_yuv_blit. Write two lines of yuv420. 304/* Line write helper function for lcd_yuv_blit. Write two lines of yuv420.
305 * y should have two lines of Y back to back. 305 * y should have two lines of Y back to back.
306 * bu and rv should contain the Cb and Cr data for the two lines of Y. 306 * bu and rv should contain the Cb and Cr data for the two lines of Y.
307 * Stores bu, guv and rv in repective buffers for use in second line. 307 * Needs EMAC set to saturated, signed integer mode.
308 */ 308 */
309extern void lcd_write_yuv420_lines(const unsigned char *y, 309extern void lcd_write_yuv420_lines(const unsigned char *y,
310 unsigned char *bu, unsigned char *guv, unsigned char *rv, int width); 310 const unsigned char *bu,
311 const unsigned char *rv, int width);
311 312
312/* Performance function to blit a YUV bitmap directly to the LCD 313/* Performance function to blit a YUV bitmap directly to the LCD
313 * src_x, src_y, width and height should be even 314 * src_x, src_y, width and height should be even
@@ -317,10 +318,9 @@ void lcd_yuv_blit(unsigned char * const src[3],
317 int src_x, int src_y, int stride, 318 int src_x, int src_y, int stride,
318 int x, int y, int width, int height) 319 int x, int y, int width, int height)
319{ 320{
320 /* IRAM Y, Cb/bu, guv and Cb/rv buffers. */ 321 /* IRAM Y, Cb and Cb buffers. */
321 unsigned char y_ibuf[LCD_WIDTH*2]; 322 unsigned char y_ibuf[LCD_WIDTH*2];
322 unsigned char bu_ibuf[LCD_WIDTH/2]; 323 unsigned char bu_ibuf[LCD_WIDTH/2];
323 unsigned char guv_ibuf[LCD_WIDTH/2];
324 unsigned char rv_ibuf[LCD_WIDTH/2]; 324 unsigned char rv_ibuf[LCD_WIDTH/2];
325 const unsigned char *ysrc, *usrc, *vsrc; 325 const unsigned char *ysrc, *usrc, *vsrc;
326 const unsigned char *ysrc_max; 326 const unsigned char *ysrc_max;
@@ -342,13 +342,14 @@ void lcd_yuv_blit(unsigned char * const src[3],
342 vsrc = src[2] + (src_y * stride >> 2) + (src_x >> 1); 342 vsrc = src[2] + (src_y * stride >> 2) + (src_x >> 1);
343 ysrc_max = ysrc + height * stride; 343 ysrc_max = ysrc + height * stride;
344 344
345 coldfire_set_macsr(EMAC_SATURATE);
345 do 346 do
346 { 347 {
347 memcpy(y_ibuf, ysrc, width); 348 memcpy(y_ibuf, ysrc, width);
348 memcpy(y_ibuf + width, ysrc + stride, width); 349 memcpy(y_ibuf + width, ysrc + stride, width);
349 memcpy(bu_ibuf, usrc, width >> 1); 350 memcpy(bu_ibuf, usrc, width >> 1);
350 memcpy(rv_ibuf, vsrc, width >> 1); 351 memcpy(rv_ibuf, vsrc, width >> 1);
351 lcd_write_yuv420_lines(y_ibuf, bu_ibuf, guv_ibuf, rv_ibuf, width); 352 lcd_write_yuv420_lines(y_ibuf, bu_ibuf, rv_ibuf, width);
352 ysrc += 2 * stride; 353 ysrc += 2 * stride;
353 usrc += stride >> 1; 354 usrc += stride >> 1;
354 vsrc += stride >> 1; 355 vsrc += stride >> 1;
@@ -381,6 +382,7 @@ void lcd_update(void)
381 } 382 }
382} 383}
383 384
385
384/* Update a fraction of the display. */ 386/* Update a fraction of the display. */
385void lcd_update_rect(int, int, int, int) ICODE_ATTR; 387void lcd_update_rect(int, int, int, int) ICODE_ATTR;
386void lcd_update_rect(int x, int y, int width, int height) 388void lcd_update_rect(int x, int y, int width, int height)