summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorAntonino A. Daplas2005-11-22 06:32:25 +0100
committerLinus Torvalds2005-11-22 18:13:43 +0100
commitb4627dea032ab1f6e472fcf030e28f22ea971f9b (patch)
treecf4a6509616f137e46098bbbb0573194b4ef0af5 /drivers
parent[PATCH] Fix hugetlbfs_statfs() reporting of block limits (diff)
downloadkernel-qcow2-linux-b4627dea032ab1f6e472fcf030e28f22ea971f9b.tar.gz
kernel-qcow2-linux-b4627dea032ab1f6e472fcf030e28f22ea971f9b.tar.xz
kernel-qcow2-linux-b4627dea032ab1f6e472fcf030e28f22ea971f9b.zip
[PATCH] fbcon: Console Rotation - Fix wrong shift calculation
The shift value (amount to shift the bitmap so first pixel starts at origin(0,0)) is incorrect. This causes corrupted characters or a kernel crash if fontwidth is not divisible by 8 at 270 degrees, or fontheight not divisible by 8 at 180 degrees. Report and part of the fix contributed by Knut Petersen. Signed-off-by: Antonino Daplas <adaplas@pol.net> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/video/console/fbcon_rotate.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/video/console/fbcon_rotate.h b/drivers/video/console/fbcon_rotate.h
index 90c672096c2e..e504fbf5c604 100644
--- a/drivers/video/console/fbcon_rotate.h
+++ b/drivers/video/console/fbcon_rotate.h
@@ -49,7 +49,7 @@ static inline void pattern_set_bit(u32 x, u32 y, u32 pitch, char *pat)
static inline void rotate_ud(const char *in, char *out, u32 width, u32 height)
{
int i, j;
- int shift = width % 8;
+ int shift = (8 - (width % 8)) & 7;
width = (width + 7) & ~7;
@@ -85,7 +85,7 @@ static inline void rotate_cw(const char *in, char *out, u32 width, u32 height)
static inline void rotate_ccw(const char *in, char *out, u32 width, u32 height)
{
int i, j, h = height, w = width;
- int shift = width % 8;
+ int shift = (8 - (width % 8)) & 7;
width = (width + 7) & ~7;
height = (height + 7) & ~7;