aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/console
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2005-11-28 16:43:52 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2005-11-28 17:42:23 -0500
commit1a9c3f78a32ddc4ec50f5da2cf2db5db6f442986 (patch)
tree4f0a03b971bf6ca17ed0ec6db4f42e24fca294dd /drivers/video/console
parent8080f231224ccd3169f39e73fd750ba98d5b98a7 (diff)
[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: Benjamin Herrenschmidt <benh@kernel.crashing.org> Acked-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/video/console')
-rw-r--r--drivers/video/console/fbcon_ccw.c2
-rw-r--r--drivers/video/console/fbcon_rotate.h13
2 files changed, 4 insertions, 11 deletions
diff --git a/drivers/video/console/fbcon_ccw.c b/drivers/video/console/fbcon_ccw.c
index 3afd1eeb1ad..4952b66ae20 100644
--- a/drivers/video/console/fbcon_ccw.c
+++ b/drivers/video/console/fbcon_ccw.c
@@ -34,7 +34,7 @@ static inline void ccw_update_attr(u8 *dst, u8 *src, int attribute,
34 msk <<= (8 - mod); 34 msk <<= (8 - mod);
35 35
36 if (offset > mod) 36 if (offset > mod)
37 set_bit(FBCON_BIT(7), (void *)&msk1); 37 msk1 |= 0x01;
38 38
39 for (i = 0; i < vc->vc_font.width; i++) { 39 for (i = 0; i < vc->vc_font.width; i++) {
40 for (j = 0; j < width; j++) { 40 for (j = 0; j < width; j++) {
diff --git a/drivers/video/console/fbcon_rotate.h b/drivers/video/console/fbcon_rotate.h
index e504fbf5c60..1b8f92fdc6a 100644
--- a/drivers/video/console/fbcon_rotate.h
+++ b/drivers/video/console/fbcon_rotate.h
@@ -21,21 +21,13 @@
21 (s == SCROLL_REDRAW || s == SCROLL_MOVE || !(i)->fix.xpanstep) ? \ 21 (s == SCROLL_REDRAW || s == SCROLL_MOVE || !(i)->fix.xpanstep) ? \
22 (i)->var.xres : (i)->var.xres_virtual; }) 22 (i)->var.xres : (i)->var.xres_virtual; })
23 23
24/*
25 * The bitmap is always big endian
26 */
27#if defined(__LITTLE_ENDIAN)
28#define FBCON_BIT(b) (7 - (b))
29#else
30#define FBCON_BIT(b) (b)
31#endif
32 24
33static inline int pattern_test_bit(u32 x, u32 y, u32 pitch, const char *pat) 25static inline int pattern_test_bit(u32 x, u32 y, u32 pitch, const char *pat)
34{ 26{
35 u32 tmp = (y * pitch) + x, index = tmp / 8, bit = tmp % 8; 27 u32 tmp = (y * pitch) + x, index = tmp / 8, bit = tmp % 8;
36 28
37 pat +=index; 29 pat +=index;
38 return (test_bit(FBCON_BIT(bit), (void *)pat)); 30 return (*pat) & (0x80 >> bit);
39} 31}
40 32
41static inline void pattern_set_bit(u32 x, u32 y, u32 pitch, char *pat) 33static 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 u32 tmp = (y * pitch) + x, index = tmp / 8, bit = tmp % 8; 35 u32 tmp = (y * pitch) + x, index = tmp / 8, bit = tmp % 8;
44 36
45 pat += index; 37 pat += index;
46 set_bit(FBCON_BIT(bit), (void *)pat); 38
39 (*pat) |= 0x80 >> bit;
47} 40}
48 41
49static inline void rotate_ud(const char *in, char *out, u32 width, u32 height) 42static inline void rotate_ud(const char *in, char *out, u32 width, u32 height)