[lkml]   [2008]   [Sep]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[PATCH] Re: fbcon: replace mono col macro with static inline

Commit 22af89aa0c0b4012a7431114a340efd3665a7617 changed the order of
operations for computing monochrome color values. This generates
0xffff000f instead of 0x0000000f for a 4 bit monochrome color, leading
to image corruption if it is passed to cfb_imageblit or other similar
Here's a quick patch to fix it up.
David Winn

PS: Please CC me with any replies. Thanks

diff --git a/drivers/video/console/fbcon.h
index a6e38e9..89a3468 100644
--- a/drivers/video/console/fbcon.h
+++ b/drivers/video/console/fbcon.h
@@ -110,7 +110,7 @@ static inline int mono_col(const struct fb_info
__u32 max_len;
max_len = max(info->, info->;
max_len = max(info->, max_len);
- return ~(0xfff << (max_len & 0xff));
+ return (~(0xfff << max_len)) & 0xff;

static inline int attr_col_ec(int shift, struct vc_data *vc,

 \ /
  Last update: 2008-09-09 04:35    [W:0.019 / U:0.544 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site