[PATCH 1/4] FRAMEBUFFER: Fix cfbfillrect for non-zero colours.

Ben Dooks <[email protected]> Mon, 23 Nov 2009 16:01:25 +0000
Newsgroups gmane.linux.fbdev.devel
Message-ID <[email protected]>
simtec/ready/cfbrectfill-colorfix.patch (text/plain, 1.4 KB)
From: Vincent Sanders <[email protected]>

The cfbfillrect routine was incorrectly using the palette to lookup true and
direct colours, but using indexed colours directly. This was simply the
inversion of the sense of an 'if' statement. This patch fixes that so that
colours other than black work properly for cfbfillrect.

Signed-off-by: Vincent Sanders <[email protected]>
Signed-off-by: Simtec Linux Team <[email protected]>

---
 drivers/video/cfbfillrect.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Index: b/drivers/video/cfbfillrect.c
===================================================================
--- a/drivers/video/cfbfillrect.c	2009-05-10 14:11:19.000000000 +0100
+++ b/drivers/video/cfbfillrect.c	2009-05-10 14:16:33.000000000 +0100
@@ -289,9 +289,9 @@ void cfb_fillrect(struct fb_info *p, con
 
 	if (p->fix.visual == FB_VISUAL_TRUECOLOR ||
 	    p->fix.visual == FB_VISUAL_DIRECTCOLOR )
-		fg = ((u32 *) (p->pseudo_palette))[rect->color];
-	else
 		fg = rect->color;
+	else
+		fg = ((u32 *) (p->pseudo_palette))[rect->color];
 
 	pat = pixel_to_pat(bpp, fg);
 


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july