Commit 896f8bce authored by James Simmons's avatar James Simmons

[FBDEV] Made the upper layer code always use the cursor mask of struct...

[FBDEV] Made the upper layer code always use the cursor mask of struct fb_cursor inside struct fb_info. This moved memory management of the mask and image data to the upper layers.

[RADEON FBDEV] Updates for the Radeon 9100.
parent 64a8617f
...@@ -992,7 +992,6 @@ static void fbcon_cursor(struct vc_data *vc, int mode) ...@@ -992,7 +992,6 @@ static void fbcon_cursor(struct vc_data *vc, int mode)
int w = (vc->vc_font.width + 7) >> 3, c; int w = (vc->vc_font.width + 7) >> 3, c;
int y = real_y(p, vc->vc_y); int y = real_y(p, vc->vc_y);
struct fb_cursor cursor; struct fb_cursor cursor;
char *mask = NULL;
if (mode & CM_SOFTBACK) { if (mode & CM_SOFTBACK) {
mode &= ~CM_SOFTBACK; mode &= ~CM_SOFTBACK;
...@@ -1045,11 +1044,15 @@ static void fbcon_cursor(struct vc_data *vc, int mode) ...@@ -1045,11 +1044,15 @@ static void fbcon_cursor(struct vc_data *vc, int mode)
} }
if ((cursor.set & FB_CUR_SETSIZE) || ((vc->vc_cursor_type & 0x0f) != p->cursor_shape)) { if ((cursor.set & FB_CUR_SETSIZE) || ((vc->vc_cursor_type & 0x0f) != p->cursor_shape)) {
char *mask = kmalloc(w*vc->vc_font.height, GFP_ATOMIC);
int cur_height, size, i = 0; int cur_height, size, i = 0;
mask = kmalloc(w*vc->vc_font.height, GFP_ATOMIC);
if (!mask) return; if (!mask) return;
if (info->cursor.mask)
kfree(info->cursor.mask);
info->cursor.mask = mask;
p->cursor_shape = vc->vc_cursor_type & 0x0f; p->cursor_shape = vc->vc_cursor_type & 0x0f;
cursor.set |= FB_CUR_SETSHAPE; cursor.set |= FB_CUR_SETSHAPE;
...@@ -1080,13 +1083,9 @@ static void fbcon_cursor(struct vc_data *vc, int mode) ...@@ -1080,13 +1083,9 @@ static void fbcon_cursor(struct vc_data *vc, int mode)
size = cur_height * w; size = cur_height * w;
while (size--) while (size--)
mask[i++] = 0xff; mask[i++] = 0xff;
cursor.mask = mask;
} }
info->cursor.rop = ROP_XOR; info->cursor.rop = ROP_XOR;
info->fbops->fb_cursor(info, &cursor); info->fbops->fb_cursor(info, &cursor);
if (mask)
kfree(mask);
vbl_cursor_cnt = CURSOR_DRAW_DELAY; vbl_cursor_cnt = CURSOR_DRAW_DELAY;
break; break;
} }
......
...@@ -257,7 +257,6 @@ struct i810fb_par { ...@@ -257,7 +257,6 @@ struct i810fb_par {
u32 pci_state[16]; u32 pci_state[16];
unsigned long mmio_start_phys; unsigned long mmio_start_phys;
u8 *mmio_start_virtual; u8 *mmio_start_virtual;
u32 cursor_reset;
u32 pitch; u32 pitch;
u32 pixconf; u32 pixconf;
u32 watermark; u32 watermark;
......
...@@ -1301,7 +1301,6 @@ static int i810fb_set_par(struct fb_info *info) ...@@ -1301,7 +1301,6 @@ static int i810fb_set_par(struct fb_info *info)
decode_var(&info->var, par); decode_var(&info->var, par);
i810_load_regs(par); i810_load_regs(par);
i810_init_cursor(par); i810_init_cursor(par);
par->cursor_reset = 1;
encode_fix(&info->fix, info); encode_fix(&info->fix, info);
...@@ -1340,24 +1339,17 @@ static int i810fb_cursor(struct fb_info *info, struct fb_cursor *cursor) ...@@ -1340,24 +1339,17 @@ static int i810fb_cursor(struct fb_info *info, struct fb_cursor *cursor)
{ {
struct i810fb_par *par = (struct i810fb_par *)info->par; struct i810fb_par *par = (struct i810fb_par *)info->par;
u8 *mmio = par->mmio_start_virtual; u8 *mmio = par->mmio_start_virtual;
static u8 data[64 * 8]; u8 data[64 * 8];
if (!info->var.accel_flags || par->dev_flags & LOCKUP) if (!info->var.accel_flags || par->dev_flags & LOCKUP)
return soft_cursor(info, cursor); return soft_cursor(info, cursor);
if (cursor->image.width > 64 || cursor->image.height > 64) if (cursor->image.width > 64 || cursor->image.height > 64)
return 1; return -ENXIO;
if ((i810_readl(CURBASE, mmio) & 0xf) != par->cursor_heap.physical) { if ((i810_readl(CURBASE, mmio) & 0xf) != par->cursor_heap.physical)
i810_init_cursor(par); i810_init_cursor(par);
par->cursor_reset = 1;
}
if (par->cursor_reset) {
cursor->set = FB_CUR_SETALL;
par->cursor_reset = 0;
}
i810_enable_cursor(mmio, OFF); i810_enable_cursor(mmio, OFF);
if (cursor->set & FB_CUR_SETHOT) if (cursor->set & FB_CUR_SETHOT)
...@@ -1397,12 +1389,12 @@ static int i810fb_cursor(struct fb_info *info, struct fb_cursor *cursor) ...@@ -1397,12 +1389,12 @@ static int i810fb_cursor(struct fb_info *info, struct fb_cursor *cursor)
switch (info->cursor.rop) { switch (info->cursor.rop) {
case ROP_XOR: case ROP_XOR:
for (i = 0; i < size; i++) for (i = 0; i < size; i++)
data[i] = cursor->image.data[i] ^ cursor->mask[i]; data[i] = cursor->image.data[i] ^ info->cursor.mask[i];
break; break;
case ROP_COPY: case ROP_COPY:
default: default:
for (i = 0; i < size; i++) for (i = 0; i < size; i++)
data[i] = cursor->image.data[i] & cursor->mask[i]; data[i] = cursor->image.data[i] & info->cursor.mask[i];
break; break;
} }
i810_load_cursor_image(info->cursor.image.width, i810_load_cursor_image(info->cursor.image.width,
......
...@@ -121,7 +121,8 @@ enum radeon_chips { ...@@ -121,7 +121,8 @@ enum radeon_chips {
RADEON_ND, RADEON_ND,
RADEON_NE, RADEON_NE,
RADEON_NF, RADEON_NF,
RADEON_NG RADEON_NG,
RADEON_QM /* LN (my Radeon 9100) */
}; };
enum radeon_arch { enum radeon_arch {
...@@ -168,7 +169,8 @@ static struct radeon_chip_info { ...@@ -168,7 +169,8 @@ static struct radeon_chip_info {
{ "9700 ND", RADEON_R300 }, { "9700 ND", RADEON_R300 },
{ "9700 NE", RADEON_R300 }, { "9700 NE", RADEON_R300 },
{ "9700 NF", RADEON_R300 }, { "9700 NF", RADEON_R300 },
{ "9700 NG", RADEON_R300 } { "9700 NG", RADEON_R300 },
{ "9100 QM", RADEON_R200 } /* LN (my Radeon 9100) */
}; };
...@@ -213,6 +215,7 @@ static struct pci_device_id radeonfb_pci_table[] __devinitdata = { ...@@ -213,6 +215,7 @@ static struct pci_device_id radeonfb_pci_table[] __devinitdata = {
{ PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RADEON_NE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RADEON_NE}, { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RADEON_NE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RADEON_NE},
{ PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RADEON_NF, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RADEON_NF}, { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RADEON_NF, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RADEON_NF},
{ PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RADEON_NG, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RADEON_NG}, { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RADEON_NG, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RADEON_NG},
{ PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RADEON_QM, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RADEON_QM}, /* LN (my Radeon 9100) */
{ 0, } { 0, }
}; };
MODULE_DEVICE_TABLE(pci, radeonfb_pci_table); MODULE_DEVICE_TABLE(pci, radeonfb_pci_table);
...@@ -884,6 +887,16 @@ static void radeon_get_pllinfo(struct radeonfb_info *rinfo, char *bios_seg) ...@@ -884,6 +887,16 @@ static void radeon_get_pllinfo(struct radeonfb_info *rinfo, char *bios_seg)
case PCI_DEVICE_ID_ATI_RADEON_ND: case PCI_DEVICE_ID_ATI_RADEON_ND:
case PCI_DEVICE_ID_ATI_RADEON_NE: case PCI_DEVICE_ID_ATI_RADEON_NE:
case PCI_DEVICE_ID_ATI_RADEON_NF: case PCI_DEVICE_ID_ATI_RADEON_NF:
case PCI_DEVICE_ID_ATI_RADEON_NG:
rinfo->pll.ppll_max = 40000;
rinfo->pll.ppll_min = 20000;
rinfo->pll.xclk = 27000;
rinfo->pll.ref_div = 12;
rinfo->pll.ref_clk = 2700;
break;
case PCI_DEVICE_ID_ATI_RADEON_ND:
case PCI_DEVICE_ID_ATI_RADEON_NE:
case PCI_DEVICE_ID_ATI_RADEON_NF:
case PCI_DEVICE_ID_ATI_RADEON_NG: case PCI_DEVICE_ID_ATI_RADEON_NG:
rinfo->pll.ppll_max = 40000; rinfo->pll.ppll_max = 40000;
rinfo->pll.ppll_min = 20000; rinfo->pll.ppll_min = 20000;
......
This diff is collapsed.
...@@ -55,17 +55,6 @@ int soft_cursor(struct fb_info *info, struct fb_cursor *cursor) ...@@ -55,17 +55,6 @@ int soft_cursor(struct fb_info *info, struct fb_cursor *cursor)
size &= ~buf_align; size &= ~buf_align;
dst = info->pixmap.addr + fb_get_buffer_offset(info, size); dst = info->pixmap.addr + fb_get_buffer_offset(info, size);
if (cursor->set & FB_CUR_SETSHAPE) {
if (cursor->set & FB_CUR_SETSIZE) {
if (info->cursor.mask)
kfree(info->cursor.mask);
info->cursor.mask = kmalloc(dsize, GFP_ATOMIC);
if (!info->cursor.mask)
return -ENOMEM;
}
memcpy(info->cursor.mask, cursor->mask, dsize);
}
if (info->cursor.enable) { if (info->cursor.enable) {
switch (info->cursor.rop) { switch (info->cursor.rop) {
case ROP_XOR: case ROP_XOR:
...@@ -81,7 +70,7 @@ int soft_cursor(struct fb_info *info, struct fb_cursor *cursor) ...@@ -81,7 +70,7 @@ int soft_cursor(struct fb_info *info, struct fb_cursor *cursor)
} else } else
memcpy(src, cursor->image.data, size); memcpy(src, cursor->image.data, size);
move_buf_aligned(info, dst, src, d_pitch, s_pitch,info->cursor.image.height); move_buf_aligned(info, dst, src, d_pitch, s_pitch, info->cursor.image.height);
info->cursor.image.data = dst; info->cursor.image.data = dst;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment