diff options
author | Dave Airlie <airlied@starflyer.(none)> | 2006-01-03 18:18:01 +1100 |
---|---|---|
committer | Dave Airlie <airlied@linux.ie> | 2006-01-03 18:18:01 +1100 |
commit | 97f2aab6698f3ab2552c41c1024a65ffd0763a6d (patch) | |
tree | bb6e3b2949459f54f884c710fc74d40eef00d834 /drivers/video/console/fbcon_rotate.h | |
parent | d985c1088146607532093d9eaaaf99758f6a4d21 (diff) | |
parent | 88026842b0a760145aa71d69e74fbc9ec118ca44 (diff) |
drm: merge in Linus mainline
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 90c672096c2..1b8f92fdc6a 100644 --- a/drivers/video/console/fbcon_rotate.h +++ b/drivers/video/console/fbcon_rotate.h @@ -21,21 +21,13 @@ (s == SCROLL_REDRAW || s == SCROLL_MOVE || !(i)->fix.xpanstep) ? \ (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) { u32 tmp = (y * pitch) + x, index = tmp / 8, bit = tmp % 8; 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) @@ -43,13 +35,14 @@ 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; 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) { int i, j; - int shift = width % 8; + int shift = (8 - (width % 8)) & 7; width = (width + 7) & ~7; @@ -85,7 +78,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; |