aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/aty
diff options
context:
space:
mode:
authorAntonino A. Daplas <adaplas@gmail.com>2006-06-26 03:26:31 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-06-26 12:58:29 -0400
commit72c24cc51aef31219f2e258b4dcb68e09399e040 (patch)
tree22744106aeeef6f10abf45b34e2a5c3e5da8cb09 /drivers/video/aty
parent8eec4981080dc9dcf8fd5931a947c6f066ee0be6 (diff)
[PATCH] atyfb: Fix hardware cursor handling
Fix image and color handling in atyfb_cursor() - In the 2-bit scheme of the cursor image, just set the first bit to be always zero (turn off transparency and/or XOR), and just do the masking manually - The cursor color is converted into 32-bit RGBA8888 using struct fb_cmap. Each component in the cmap is u16 in size, so mask the upper 8 bits. Signed-off-by: Antonino Daplas <adaplas@pol.net> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/video/aty')
-rw-r--r--drivers/video/aty/mach64_cursor.c31
1 files changed, 12 insertions, 19 deletions
diff --git a/drivers/video/aty/mach64_cursor.c b/drivers/video/aty/mach64_cursor.c
index ad8b7496f853..27bf0137e3bb 100644
--- a/drivers/video/aty/mach64_cursor.c
+++ b/drivers/video/aty/mach64_cursor.c
@@ -66,11 +66,6 @@ static const u8 cursor_bits_lookup[16] = {
66 0x01, 0x41, 0x11, 0x51, 0x05, 0x45, 0x15, 0x55 66 0x01, 0x41, 0x11, 0x51, 0x05, 0x45, 0x15, 0x55
67}; 67};
68 68
69static const u8 cursor_mask_lookup[16] = {
70 0xaa, 0x2a, 0x8a, 0x0a, 0xa2, 0x22, 0x82, 0x02,
71 0xa8, 0x28, 0x88, 0x08, 0xa0, 0x20, 0x80, 0x00
72};
73
74static int atyfb_cursor(struct fb_info *info, struct fb_cursor *cursor) 69static int atyfb_cursor(struct fb_info *info, struct fb_cursor *cursor)
75{ 70{
76 struct atyfb_par *par = (struct atyfb_par *) info->par; 71 struct atyfb_par *par = (struct atyfb_par *) info->par;
@@ -130,13 +125,13 @@ static int atyfb_cursor(struct fb_info *info, struct fb_cursor *cursor)
130 fg_idx = cursor->image.fg_color; 125 fg_idx = cursor->image.fg_color;
131 bg_idx = cursor->image.bg_color; 126 bg_idx = cursor->image.bg_color;
132 127
133 fg = (info->cmap.red[fg_idx] << 24) | 128 fg = ((info->cmap.red[fg_idx] & 0xff) << 24) |
134 (info->cmap.green[fg_idx] << 16) | 129 ((info->cmap.green[fg_idx] & 0xff) << 16) |
135 (info->cmap.blue[fg_idx] << 8) | 15; 130 ((info->cmap.blue[fg_idx] & 0xff) << 8) | 0xff;
136 131
137 bg = (info->cmap.red[bg_idx] << 24) | 132 bg = ((info->cmap.red[bg_idx] & 0xff) << 24) |
138 (info->cmap.green[bg_idx] << 16) | 133 ((info->cmap.green[bg_idx] & 0xff) << 16) |
139 (info->cmap.blue[bg_idx] << 8); 134 ((info->cmap.blue[bg_idx] & 0xff) << 8);
140 135
141 wait_for_fifo(2, par); 136 wait_for_fifo(2, par);
142 aty_st_le32(CUR_CLR0, bg, par); 137 aty_st_le32(CUR_CLR0, bg, par);
@@ -166,19 +161,17 @@ static int atyfb_cursor(struct fb_info *info, struct fb_cursor *cursor)
166 switch (cursor->rop) { 161 switch (cursor->rop) {
167 case ROP_XOR: 162 case ROP_XOR:
168 // Upper 4 bits of mask data 163 // Upper 4 bits of mask data
169 fb_writeb(cursor_mask_lookup[m >> 4 ] | 164 fb_writeb(cursor_bits_lookup[(b ^ m) >> 4], dst++);
170 cursor_bits_lookup[(b ^ m) >> 4], dst++);
171 // Lower 4 bits of mask 165 // Lower 4 bits of mask
172 fb_writeb(cursor_mask_lookup[m & 0x0f ] | 166 fb_writeb(cursor_bits_lookup[(b ^ m) & 0x0f],
173 cursor_bits_lookup[(b ^ m) & 0x0f], dst++); 167 dst++);
174 break; 168 break;
175 case ROP_COPY: 169 case ROP_COPY:
176 // Upper 4 bits of mask data 170 // Upper 4 bits of mask data
177 fb_writeb(cursor_mask_lookup[m >> 4 ] | 171 fb_writeb(cursor_bits_lookup[(b & m) >> 4], dst++);
178 cursor_bits_lookup[(b & m) >> 4], dst++);
179 // Lower 4 bits of mask 172 // Lower 4 bits of mask
180 fb_writeb(cursor_mask_lookup[m & 0x0f ] | 173 fb_writeb(cursor_bits_lookup[(b & m) & 0x0f],
181 cursor_bits_lookup[(b & m) & 0x0f], dst++); 174 dst++);
182 break; 175 break;
183 } 176 }
184 } 177 }