diff options
Diffstat (limited to 'drivers/video/fbmem.c')
-rw-r--r-- | drivers/video/fbmem.c | 67 |
1 files changed, 8 insertions, 59 deletions
diff --git a/drivers/video/fbmem.c b/drivers/video/fbmem.c index 8cef020d1801..2222de6ad844 100644 --- a/drivers/video/fbmem.c +++ b/drivers/video/fbmem.c | |||
@@ -76,70 +76,22 @@ int fb_get_color_depth(struct fb_var_screeninfo *var) | |||
76 | EXPORT_SYMBOL(fb_get_color_depth); | 76 | EXPORT_SYMBOL(fb_get_color_depth); |
77 | 77 | ||
78 | /* | 78 | /* |
79 | * Drawing helpers. | 79 | * Data padding functions. |
80 | */ | 80 | */ |
81 | void fb_iomove_buf_aligned(struct fb_info *info, struct fb_pixmap *buf, | 81 | void fb_pad_aligned_buffer(u8 *dst, u32 d_pitch, u8 *src, u32 s_pitch, u32 height) |
82 | u8 *dst, u32 d_pitch, u8 *src, u32 s_pitch, | ||
83 | u32 height) | ||
84 | { | 82 | { |
85 | int i; | 83 | int i; |
86 | 84 | ||
87 | for (i = height; i--; ) { | 85 | for (i = height; i--; ) { |
88 | buf->outbuf(info, dst, src, s_pitch); | 86 | memcpy(dst, src, s_pitch); |
89 | src += s_pitch; | 87 | src += s_pitch; |
90 | dst += d_pitch; | 88 | dst += d_pitch; |
91 | } | 89 | } |
92 | } | 90 | } |
91 | EXPORT_SYMBOL(fb_pad_aligned_buffer); | ||
93 | 92 | ||
94 | void fb_sysmove_buf_aligned(struct fb_info *info, struct fb_pixmap *buf, | 93 | void fb_pad_unaligned_buffer(u8 *dst, u32 d_pitch, u8 *src, u32 idx, u32 height, |
95 | u8 *dst, u32 d_pitch, u8 *src, u32 s_pitch, | 94 | u32 shift_high, u32 shift_low, u32 mod) |
96 | u32 height) | ||
97 | { | ||
98 | int i, j; | ||
99 | |||
100 | for (i = height; i--; ) { | ||
101 | for (j = 0; j < s_pitch; j++) | ||
102 | dst[j] = src[j]; | ||
103 | src += s_pitch; | ||
104 | dst += d_pitch; | ||
105 | } | ||
106 | } | ||
107 | |||
108 | void fb_iomove_buf_unaligned(struct fb_info *info, struct fb_pixmap *buf, | ||
109 | u8 *dst, u32 d_pitch, u8 *src, u32 idx, | ||
110 | u32 height, u32 shift_high, u32 shift_low, | ||
111 | u32 mod) | ||
112 | { | ||
113 | u8 mask = (u8) (0xfff << shift_high), tmp; | ||
114 | int i, j; | ||
115 | |||
116 | for (i = height; i--; ) { | ||
117 | for (j = 0; j < idx; j++) { | ||
118 | tmp = buf->inbuf(info, dst+j); | ||
119 | tmp &= mask; | ||
120 | tmp |= *src >> shift_low; | ||
121 | buf->outbuf(info, dst+j, &tmp, 1); | ||
122 | tmp = *src << shift_high; | ||
123 | buf->outbuf(info, dst+j+1, &tmp, 1); | ||
124 | src++; | ||
125 | } | ||
126 | tmp = buf->inbuf(info, dst+idx); | ||
127 | tmp &= mask; | ||
128 | tmp |= *src >> shift_low; | ||
129 | buf->outbuf(info, dst+idx, &tmp, 1); | ||
130 | if (shift_high < mod) { | ||
131 | tmp = *src << shift_high; | ||
132 | buf->outbuf(info, dst+idx+1, &tmp, 1); | ||
133 | } | ||
134 | src++; | ||
135 | dst += d_pitch; | ||
136 | } | ||
137 | } | ||
138 | |||
139 | void fb_sysmove_buf_unaligned(struct fb_info *info, struct fb_pixmap *buf, | ||
140 | u8 *dst, u32 d_pitch, u8 *src, u32 idx, | ||
141 | u32 height, u32 shift_high, u32 shift_low, | ||
142 | u32 mod) | ||
143 | { | 95 | { |
144 | u8 mask = (u8) (0xfff << shift_high), tmp; | 96 | u8 mask = (u8) (0xfff << shift_high), tmp; |
145 | int i, j; | 97 | int i, j; |
@@ -166,6 +118,7 @@ void fb_sysmove_buf_unaligned(struct fb_info *info, struct fb_pixmap *buf, | |||
166 | dst += d_pitch; | 118 | dst += d_pitch; |
167 | } | 119 | } |
168 | } | 120 | } |
121 | EXPORT_SYMBOL(fb_pad_unaligned_buffer); | ||
169 | 122 | ||
170 | /* | 123 | /* |
171 | * we need to lock this section since fb_cursor | 124 | * we need to lock this section since fb_cursor |
@@ -1081,7 +1034,7 @@ register_framebuffer(struct fb_info *fb_info) | |||
1081 | fb_info->pixmap.size = FBPIXMAPSIZE; | 1034 | fb_info->pixmap.size = FBPIXMAPSIZE; |
1082 | fb_info->pixmap.buf_align = 1; | 1035 | fb_info->pixmap.buf_align = 1; |
1083 | fb_info->pixmap.scan_align = 1; | 1036 | fb_info->pixmap.scan_align = 1; |
1084 | fb_info->pixmap.access_align = 4; | 1037 | fb_info->pixmap.access_align = 32; |
1085 | fb_info->pixmap.flags = FB_PIXMAP_DEFAULT; | 1038 | fb_info->pixmap.flags = FB_PIXMAP_DEFAULT; |
1086 | } | 1039 | } |
1087 | } | 1040 | } |
@@ -1357,10 +1310,6 @@ EXPORT_SYMBOL(fb_set_var); | |||
1357 | EXPORT_SYMBOL(fb_blank); | 1310 | EXPORT_SYMBOL(fb_blank); |
1358 | EXPORT_SYMBOL(fb_pan_display); | 1311 | EXPORT_SYMBOL(fb_pan_display); |
1359 | EXPORT_SYMBOL(fb_get_buffer_offset); | 1312 | EXPORT_SYMBOL(fb_get_buffer_offset); |
1360 | EXPORT_SYMBOL(fb_iomove_buf_unaligned); | ||
1361 | EXPORT_SYMBOL(fb_iomove_buf_aligned); | ||
1362 | EXPORT_SYMBOL(fb_sysmove_buf_unaligned); | ||
1363 | EXPORT_SYMBOL(fb_sysmove_buf_aligned); | ||
1364 | EXPORT_SYMBOL(fb_set_suspend); | 1313 | EXPORT_SYMBOL(fb_set_suspend); |
1365 | EXPORT_SYMBOL(fb_register_client); | 1314 | EXPORT_SYMBOL(fb_register_client); |
1366 | EXPORT_SYMBOL(fb_unregister_client); | 1315 | EXPORT_SYMBOL(fb_unregister_client); |