diff options
author | Jeff Garzik <jgarzik@pobox.com> | 2005-11-29 03:55:47 -0500 |
---|---|---|
committer | Jeff Garzik <jgarzik@pobox.com> | 2005-11-29 03:55:47 -0500 |
commit | b71d4da092801634d04190693a38ca03bdbe2505 (patch) | |
tree | e4adc88ade5832b844768c114b15d4d97253c4d0 /drivers/video/console/fbcon_rotate.h | |
parent | 656563e32c3f1dfdc35b3944305ece1c5dfeade5 (diff) | |
parent | 624f54be206adf970cd8eece16446b027913e533 (diff) |
Merge branch 'master'
Diffstat (limited to 'drivers/video/console/fbcon_rotate.h')
-rw-r--r-- | drivers/video/console/fbcon_rotate.h | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/drivers/video/console/fbcon_rotate.h b/drivers/video/console/fbcon_rotate.h index 90c672096c2e..1b8f92fdc6a8 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 | ||
33 | static inline int pattern_test_bit(u32 x, u32 y, u32 pitch, const char *pat) | 25 | static 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 | ||
41 | static inline void pattern_set_bit(u32 x, u32 y, u32 pitch, char *pat) | 33 | static inline void pattern_set_bit(u32 x, u32 y, u32 pitch, char *pat) |
@@ -43,13 +35,14 @@ 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 | ||
49 | static inline void rotate_ud(const char *in, char *out, u32 width, u32 height) | 42 | static inline void rotate_ud(const char *in, char *out, u32 width, u32 height) |
50 | { | 43 | { |
51 | int i, j; | 44 | int i, j; |
52 | int shift = width % 8; | 45 | int shift = (8 - (width % 8)) & 7; |
53 | 46 | ||
54 | width = (width + 7) & ~7; | 47 | width = (width + 7) & ~7; |
55 | 48 | ||
@@ -85,7 +78,7 @@ static inline void rotate_cw(const char *in, char *out, u32 width, u32 height) | |||
85 | static inline void rotate_ccw(const char *in, char *out, u32 width, u32 height) | 78 | static inline void rotate_ccw(const char *in, char *out, u32 width, u32 height) |
86 | { | 79 | { |
87 | int i, j, h = height, w = width; | 80 | int i, j, h = height, w = width; |
88 | int shift = width % 8; | 81 | int shift = (8 - (width % 8)) & 7; |
89 | 82 | ||
90 | width = (width + 7) & ~7; | 83 | width = (width + 7) & ~7; |
91 | height = (height + 7) & ~7; | 84 | height = (height + 7) & ~7; |