diff options
Diffstat (limited to 'drivers/video/fb_draw.h')
-rw-r--r-- | drivers/video/fb_draw.h | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/drivers/video/fb_draw.h b/drivers/video/fb_draw.h index a2a0618d86a..1db622192bd 100644 --- a/drivers/video/fb_draw.h +++ b/drivers/video/fb_draw.h | |||
@@ -94,41 +94,44 @@ static inline unsigned long fb_rev_pixels_in_long(unsigned long val, | |||
94 | return val; | 94 | return val; |
95 | } | 95 | } |
96 | 96 | ||
97 | static inline u32 fb_shifted_pixels_mask_u32(u32 index, u32 bswapmask) | 97 | static inline u32 fb_shifted_pixels_mask_u32(struct fb_info *p, u32 index, |
98 | u32 bswapmask) | ||
98 | { | 99 | { |
99 | u32 mask; | 100 | u32 mask; |
100 | 101 | ||
101 | if (!bswapmask) { | 102 | if (!bswapmask) { |
102 | mask = FB_SHIFT_HIGH(~(u32)0, index); | 103 | mask = FB_SHIFT_HIGH(p, ~(u32)0, index); |
103 | } else { | 104 | } else { |
104 | mask = 0xff << FB_LEFT_POS(8); | 105 | mask = 0xff << FB_LEFT_POS(p, 8); |
105 | mask = FB_SHIFT_LOW(mask, index & (bswapmask)) & mask; | 106 | mask = FB_SHIFT_LOW(p, mask, index & (bswapmask)) & mask; |
106 | mask = FB_SHIFT_HIGH(mask, index & ~(bswapmask)); | 107 | mask = FB_SHIFT_HIGH(p, mask, index & ~(bswapmask)); |
107 | #if defined(__i386__) || defined(__x86_64__) | 108 | #if defined(__i386__) || defined(__x86_64__) |
108 | /* Shift argument is limited to 0 - 31 on x86 based CPU's */ | 109 | /* Shift argument is limited to 0 - 31 on x86 based CPU's */ |
109 | if(index + bswapmask < 32) | 110 | if(index + bswapmask < 32) |
110 | #endif | 111 | #endif |
111 | mask |= FB_SHIFT_HIGH(~(u32)0, | 112 | mask |= FB_SHIFT_HIGH(p, ~(u32)0, |
112 | (index + bswapmask) & ~(bswapmask)); | 113 | (index + bswapmask) & ~(bswapmask)); |
113 | } | 114 | } |
114 | return mask; | 115 | return mask; |
115 | } | 116 | } |
116 | 117 | ||
117 | static inline unsigned long fb_shifted_pixels_mask_long(u32 index, u32 bswapmask) | 118 | static inline unsigned long fb_shifted_pixels_mask_long(struct fb_info *p, |
119 | u32 index, | ||
120 | u32 bswapmask) | ||
118 | { | 121 | { |
119 | unsigned long mask; | 122 | unsigned long mask; |
120 | 123 | ||
121 | if (!bswapmask) { | 124 | if (!bswapmask) { |
122 | mask = FB_SHIFT_HIGH(~0UL, index); | 125 | mask = FB_SHIFT_HIGH(p, ~0UL, index); |
123 | } else { | 126 | } else { |
124 | mask = 0xff << FB_LEFT_POS(8); | 127 | mask = 0xff << FB_LEFT_POS(p, 8); |
125 | mask = FB_SHIFT_LOW(mask, index & (bswapmask)) & mask; | 128 | mask = FB_SHIFT_LOW(p, mask, index & (bswapmask)) & mask; |
126 | mask = FB_SHIFT_HIGH(mask, index & ~(bswapmask)); | 129 | mask = FB_SHIFT_HIGH(p, mask, index & ~(bswapmask)); |
127 | #if defined(__i386__) || defined(__x86_64__) | 130 | #if defined(__i386__) || defined(__x86_64__) |
128 | /* Shift argument is limited to 0 - 31 on x86 based CPU's */ | 131 | /* Shift argument is limited to 0 - 31 on x86 based CPU's */ |
129 | if(index + bswapmask < BITS_PER_LONG) | 132 | if(index + bswapmask < BITS_PER_LONG) |
130 | #endif | 133 | #endif |
131 | mask |= FB_SHIFT_HIGH(~0UL, | 134 | mask |= FB_SHIFT_HIGH(p, ~0UL, |
132 | (index + bswapmask) & ~(bswapmask)); | 135 | (index + bswapmask) & ~(bswapmask)); |
133 | } | 136 | } |
134 | return mask; | 137 | return mask; |
@@ -158,8 +161,8 @@ static inline unsigned long fb_rev_pixels_in_long(unsigned long val, | |||
158 | return val; | 161 | return val; |
159 | } | 162 | } |
160 | 163 | ||
161 | #define fb_shifted_pixels_mask_u32(i, b) FB_SHIFT_HIGH(~(u32)0, (i)) | 164 | #define fb_shifted_pixels_mask_u32(p, i, b) FB_SHIFT_HIGH((p), ~(u32)0, (i)) |
162 | #define fb_shifted_pixels_mask_long(i, b) FB_SHIFT_HIGH(~0UL, (i)) | 165 | #define fb_shifted_pixels_mask_long(p, i, b) FB_SHIFT_HIGH((p), ~0UL, (i)) |
163 | #define fb_compute_bswapmask(...) 0 | 166 | #define fb_compute_bswapmask(...) 0 |
164 | 167 | ||
165 | #endif /* CONFIG_FB_CFB_REV_PIXELS_IN_BYTE */ | 168 | #endif /* CONFIG_FB_CFB_REV_PIXELS_IN_BYTE */ |