diff options
author | David Winn <q-newsgroup@qypea.com> | 2008-10-02 17:50:11 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-10-02 18:53:13 -0400 |
commit | 08650869e0ec581f8d88cfdb563d37f5383abfe2 (patch) | |
tree | 0698a09e45bf4e9c814dd0b5fef71f7424853c6c /drivers/video/console/fbcon.h | |
parent | 550ac958791399266c20e15e8048cd12bfce08ae (diff) |
fbcon: fix monochrome color value calculation
Commit 22af89aa0c0b4012a7431114a340efd3665a7617 ("fbcon: replace mono_col
macro with static inline") 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 functions. Fix it up.
Cc: Harvey Harrison <harvey.harrison@gmail.com>
Cc: "Antonino A. Daplas" <adaplas@pol.net>
Cc: Krzysztof Helt <krzysztof.h1@poczta.fm>
Cc: <stable@kernel.org> [2.6.26.x]
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/video/console/fbcon.h')
-rw-r--r-- | drivers/video/console/fbcon.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/video/console/fbcon.h b/drivers/video/console/fbcon.h index a6e38e9ea73f..89a346880ec0 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 *info) | |||
110 | __u32 max_len; | 110 | __u32 max_len; |
111 | max_len = max(info->var.green.length, info->var.red.length); | 111 | max_len = max(info->var.green.length, info->var.red.length); |
112 | max_len = max(info->var.blue.length, max_len); | 112 | max_len = max(info->var.blue.length, max_len); |
113 | return ~(0xfff << (max_len & 0xff)); | 113 | return (~(0xfff << max_len)) & 0xff; |
114 | } | 114 | } |
115 | 115 | ||
116 | static inline int attr_col_ec(int shift, struct vc_data *vc, | 116 | static inline int attr_col_ec(int shift, struct vc_data *vc, |