提交 1a9c3f78 编写于 作者: B Benjamin Herrenschmidt 提交者: Linus Torvalds

[PATCH] Console rotation fixes

Remove bogus usage of test/set_bit() from fbcon rotation code and just
manipulate the bits directly.  This fixes an oops on powerpc among others
and should be faster.  Seems to work fine on the G5 here.
Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
Acked-by: NAntonino Daplas <adaplas@pol.net>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 8080f231
...@@ -34,7 +34,7 @@ static inline void ccw_update_attr(u8 *dst, u8 *src, int attribute, ...@@ -34,7 +34,7 @@ static inline void ccw_update_attr(u8 *dst, u8 *src, int attribute,
msk <<= (8 - mod); msk <<= (8 - mod);
if (offset > mod) if (offset > mod)
set_bit(FBCON_BIT(7), (void *)&msk1); msk1 |= 0x01;
for (i = 0; i < vc->vc_font.width; i++) { for (i = 0; i < vc->vc_font.width; i++) {
for (j = 0; j < width; j++) { for (j = 0; j < width; j++) {
......
...@@ -21,21 +21,13 @@ ...@@ -21,21 +21,13 @@
(s == SCROLL_REDRAW || s == SCROLL_MOVE || !(i)->fix.xpanstep) ? \ (s == SCROLL_REDRAW || s == SCROLL_MOVE || !(i)->fix.xpanstep) ? \
(i)->var.xres : (i)->var.xres_virtual; }) (i)->var.xres : (i)->var.xres_virtual; })
/*
* The bitmap is always big endian
*/
#if defined(__LITTLE_ENDIAN)
#define FBCON_BIT(b) (7 - (b))
#else
#define FBCON_BIT(b) (b)
#endif
static inline int pattern_test_bit(u32 x, u32 y, u32 pitch, const char *pat) static inline int pattern_test_bit(u32 x, u32 y, u32 pitch, const char *pat)
{ {
u32 tmp = (y * pitch) + x, index = tmp / 8, bit = tmp % 8; u32 tmp = (y * pitch) + x, index = tmp / 8, bit = tmp % 8;
pat +=index; pat +=index;
return (test_bit(FBCON_BIT(bit), (void *)pat)); return (*pat) & (0x80 >> bit);
} }
static inline void pattern_set_bit(u32 x, u32 y, u32 pitch, char *pat) static inline void pattern_set_bit(u32 x, u32 y, u32 pitch, char *pat)
...@@ -43,7 +35,8 @@ static inline void pattern_set_bit(u32 x, u32 y, u32 pitch, char *pat) ...@@ -43,7 +35,8 @@ static inline void pattern_set_bit(u32 x, u32 y, u32 pitch, char *pat)
u32 tmp = (y * pitch) + x, index = tmp / 8, bit = tmp % 8; u32 tmp = (y * pitch) + x, index = tmp / 8, bit = tmp % 8;
pat += index; pat += index;
set_bit(FBCON_BIT(bit), (void *)pat);
(*pat) |= 0x80 >> bit;
} }
static inline void rotate_ud(const char *in, char *out, u32 width, u32 height) static inline void rotate_ud(const char *in, char *out, u32 width, u32 height)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册