From 4a5506df0a36a61b13c01b0173523a2ce31b5fb9 Mon Sep 17 00:00:00 2001 From: inmarket Date: Thu, 24 Oct 2013 11:32:46 +1000 Subject: [PATCH] Fixes to GDISP for streaming drivers. Turn optimisation back on for SSD1289 driver --- drivers/gdisp/SSD1289/gdisp_lld_config.h | 2 +- src/gdisp/gdisp.c | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/gdisp/SSD1289/gdisp_lld_config.h b/drivers/gdisp/SSD1289/gdisp_lld_config.h index f8743a2b..84e518d2 100644 --- a/drivers/gdisp/SSD1289/gdisp_lld_config.h +++ b/drivers/gdisp/SSD1289/gdisp_lld_config.h @@ -24,7 +24,7 @@ #define GDISP_HARDWARE_STREAM_WRITE TRUE #define GDISP_HARDWARE_STREAM_READ TRUE -//#define GDISP_HARDWARE_STREAM_POS TRUE +#define GDISP_HARDWARE_STREAM_POS TRUE #define GDISP_HARDWARE_CONTROL TRUE #if defined(GDISP_USE_DMA) diff --git a/src/gdisp/gdisp.c b/src/gdisp/gdisp.c index 53882492..3d2e6e36 100644 --- a/src/gdisp/gdisp.c +++ b/src/gdisp/gdisp.c @@ -87,6 +87,7 @@ GDisplay *GDISP = GDisplayArray; static INLINE void setglobalwindow(GDisplay *g) { coord_t x, y; x = g->p.x; y = g->p.y; + g->p.x = g->p.y = 0; g->p.cx = g->g.Width; g->p.cy = g->g.Height; gdisp_lld_write_start(g); g->p.x = x; g->p.y = y; @@ -304,8 +305,9 @@ static void hline_clip(GDisplay *g) { { if (!(g->flags & GDISP_FLG_SCRSTREAM)) setglobalwindow(g); + g->p.cx = g->p.x1 - g->p.x + 1; gdisp_lld_write_pos(g); - do { gdisp_lld_write_color(g); } while(g->p.cx--); + do { gdisp_lld_write_color(g); } while(--g->p.cx); return; } #endif @@ -319,7 +321,7 @@ static void hline_clip(GDisplay *g) { g->p.cx = g->p.x1 - g->p.x + 1; g->p.cy = 1; gdisp_lld_write_start(g); - do { gdisp_lld_write_color(g); } while(g->p.cx--); + do { gdisp_lld_write_color(g); } while(--g->p.cx); gdisp_lld_write_stop(g); return; } @@ -404,7 +406,7 @@ static void vline_clip(GDisplay *g) { #endif gdisp_lld_write_pos(g); #endif - do { gdisp_lld_write_color(g); } while(g->p.cy--); + do { gdisp_lld_write_color(g); } while(--g->p.cy); gdisp_lld_write_stop(g); return; }