diff options
Diffstat (limited to 'drivers/video/fb_draw.h')
-rw-r--r-- | drivers/video/fb_draw.h | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/drivers/video/fb_draw.h b/drivers/video/fb_draw.h index 1db622192bd..04c01faaf77 100644 --- a/drivers/video/fb_draw.h +++ b/drivers/video/fb_draw.h | |||
@@ -33,11 +33,11 @@ pixel_to_pat( u32 bpp, u32 pixel) | |||
33 | case 8: | 33 | case 8: |
34 | return 0x0101010101010101ul*pixel; | 34 | return 0x0101010101010101ul*pixel; |
35 | case 12: | 35 | case 12: |
36 | return 0x0001001001001001ul*pixel; | 36 | return 0x1001001001001001ul*pixel; |
37 | case 16: | 37 | case 16: |
38 | return 0x0001000100010001ul*pixel; | 38 | return 0x0001000100010001ul*pixel; |
39 | case 24: | 39 | case 24: |
40 | return 0x0000000001000001ul*pixel; | 40 | return 0x0001000001000001ul*pixel; |
41 | case 32: | 41 | case 32: |
42 | return 0x0000000100000001ul*pixel; | 42 | return 0x0000000100000001ul*pixel; |
43 | default: | 43 | default: |
@@ -58,11 +58,11 @@ pixel_to_pat( u32 bpp, u32 pixel) | |||
58 | case 8: | 58 | case 8: |
59 | return 0x01010101ul*pixel; | 59 | return 0x01010101ul*pixel; |
60 | case 12: | 60 | case 12: |
61 | return 0x00001001ul*pixel; | 61 | return 0x01001001ul*pixel; |
62 | case 16: | 62 | case 16: |
63 | return 0x00010001ul*pixel; | 63 | return 0x00010001ul*pixel; |
64 | case 24: | 64 | case 24: |
65 | return 0x00000001ul*pixel; | 65 | return 0x01000001ul*pixel; |
66 | case 32: | 66 | case 32: |
67 | return 0x00000001ul*pixel; | 67 | return 0x00000001ul*pixel; |
68 | default: | 68 | default: |
@@ -167,4 +167,17 @@ static inline unsigned long fb_rev_pixels_in_long(unsigned long val, | |||
167 | 167 | ||
168 | #endif /* CONFIG_FB_CFB_REV_PIXELS_IN_BYTE */ | 168 | #endif /* CONFIG_FB_CFB_REV_PIXELS_IN_BYTE */ |
169 | 169 | ||
170 | #define cpu_to_le_long _cpu_to_le_long(BITS_PER_LONG) | ||
171 | #define _cpu_to_le_long(x) __cpu_to_le_long(x) | ||
172 | #define __cpu_to_le_long(x) cpu_to_le##x | ||
173 | |||
174 | #define le_long_to_cpu _le_long_to_cpu(BITS_PER_LONG) | ||
175 | #define _le_long_to_cpu(x) __le_long_to_cpu(x) | ||
176 | #define __le_long_to_cpu(x) le##x##_to_cpu | ||
177 | |||
178 | static inline unsigned long rolx(unsigned long word, unsigned int shift, unsigned int x) | ||
179 | { | ||
180 | return (word << shift) | (word >> (x - shift)); | ||
181 | } | ||
182 | |||
170 | #endif /* FB_DRAW_H */ | 183 | #endif /* FB_DRAW_H */ |