diff options
Diffstat (limited to 'drivers/video/console/softcursor.c')
-rw-r--r-- | drivers/video/console/softcursor.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/drivers/video/console/softcursor.c b/drivers/video/console/softcursor.c index 7d07d8383569..f577bd80e020 100644 --- a/drivers/video/console/softcursor.c +++ b/drivers/video/console/softcursor.c | |||
@@ -1,11 +1,13 @@ | |||
1 | /* | 1 | /* |
2 | * linux/drivers/video/softcursor.c -- Generic software cursor for frame buffer devices | 2 | * linux/drivers/video/softcursor.c |
3 | * | ||
4 | * Generic software cursor for frame buffer devices | ||
3 | * | 5 | * |
4 | * Created 14 Nov 2002 by James Simmons | 6 | * Created 14 Nov 2002 by James Simmons |
5 | * | 7 | * |
6 | * This file is subject to the terms and conditions of the GNU General Public | 8 | * This file is subject to the terms and conditions of the GNU General |
7 | * License. See the file COPYING in the main directory of this archive | 9 | * Public License. See the file COPYING in the main directory of this |
8 | * for more details. | 10 | * archive for more details. |
9 | */ | 11 | */ |
10 | 12 | ||
11 | #include <linux/module.h> | 13 | #include <linux/module.h> |
@@ -25,7 +27,7 @@ int soft_cursor(struct fb_info *info, struct fb_cursor *cursor) | |||
25 | unsigned int buf_align = info->pixmap.buf_align - 1; | 27 | unsigned int buf_align = info->pixmap.buf_align - 1; |
26 | unsigned int i, size, dsize, s_pitch, d_pitch; | 28 | unsigned int i, size, dsize, s_pitch, d_pitch; |
27 | struct fb_image *image; | 29 | struct fb_image *image; |
28 | u8 *dst; | 30 | u8 *src, *dst; |
29 | 31 | ||
30 | if (info->state != FBINFO_STATE_RUNNING) | 32 | if (info->state != FBINFO_STATE_RUNNING) |
31 | return 0; | 33 | return 0; |
@@ -45,7 +47,8 @@ int soft_cursor(struct fb_info *info, struct fb_cursor *cursor) | |||
45 | } | 47 | } |
46 | } | 48 | } |
47 | 49 | ||
48 | image = (struct fb_image *) (ops->cursor_src + dsize); | 50 | src = ops->cursor_src + sizeof(struct fb_image); |
51 | image = (struct fb_image *)ops->cursor_src; | ||
49 | *image = cursor->image; | 52 | *image = cursor->image; |
50 | d_pitch = (s_pitch + scan_align) & ~scan_align; | 53 | d_pitch = (s_pitch + scan_align) & ~scan_align; |
51 | 54 | ||
@@ -57,21 +60,18 @@ int soft_cursor(struct fb_info *info, struct fb_cursor *cursor) | |||
57 | switch (cursor->rop) { | 60 | switch (cursor->rop) { |
58 | case ROP_XOR: | 61 | case ROP_XOR: |
59 | for (i = 0; i < dsize; i++) | 62 | for (i = 0; i < dsize; i++) |
60 | ops->cursor_src[i] = image->data[i] ^ | 63 | src[i] = image->data[i] ^ cursor->mask[i]; |
61 | cursor->mask[i]; | ||
62 | break; | 64 | break; |
63 | case ROP_COPY: | 65 | case ROP_COPY: |
64 | default: | 66 | default: |
65 | for (i = 0; i < dsize; i++) | 67 | for (i = 0; i < dsize; i++) |
66 | ops->cursor_src[i] = image->data[i] & | 68 | src[i] = image->data[i] & cursor->mask[i]; |
67 | cursor->mask[i]; | ||
68 | break; | 69 | break; |
69 | } | 70 | } |
70 | } else | 71 | } else |
71 | memcpy(ops->cursor_src, image->data, dsize); | 72 | memcpy(src, image->data, dsize); |
72 | 73 | ||
73 | fb_pad_aligned_buffer(dst, d_pitch, ops->cursor_src, s_pitch, | 74 | fb_pad_aligned_buffer(dst, d_pitch, src, s_pitch, image->height); |
74 | image->height); | ||
75 | image->data = dst; | 75 | image->data = dst; |
76 | info->fbops->fb_imageblit(info, image); | 76 | info->fbops->fb_imageblit(info, image); |
77 | return 0; | 77 | return 0; |