git://git.onelab.eu
/
linux-2.6.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fedora kernel-2.6.17-1.2142_FC4 patched with stable patch-2.6.17.4-vs2.0.2-rc26.diff
[linux-2.6.git]
/
drivers
/
video
/
kyro
/
fbdev.c
diff --git
a/drivers/video/kyro/fbdev.c
b/drivers/video/kyro/fbdev.c
index
d8bac9e
..
477ad29
100644
(file)
--- a/
drivers/video/kyro/fbdev.c
+++ b/
drivers/video/kyro/fbdev.c
@@
-73,8
+73,6
@@
static struct fb_var_screeninfo kyro_var __devinitdata = {
.vmode = FB_VMODE_NONINTERLACED,
};
.vmode = FB_VMODE_NONINTERLACED,
};
-static struct kyrofb_info *currentpar;
-
typedef struct {
STG4000REG __iomem *pSTGReg; /* Virtual address of PCI register region */
u32 ulNextFreeVidMem; /* Offset from start of vid mem to next free region */
typedef struct {
STG4000REG __iomem *pSTGReg; /* Virtual address of PCI register region */
u32 ulNextFreeVidMem; /* Offset from start of vid mem to next free region */
@@
-309,7
+307,7
@@
enum {
/* Accessors */
static int kyro_dev_video_mode_set(struct fb_info *info)
{
/* Accessors */
static int kyro_dev_video_mode_set(struct fb_info *info)
{
- struct kyrofb_info *par =
(struct kyrofb_info *)
info->par;
+ struct kyrofb_info *par = info->par;
/* Turn off display */
StopVTG(deviceInfo.pSTGReg);
/* Turn off display */
StopVTG(deviceInfo.pSTGReg);
@@
-402,7
+400,7
@@
static inline unsigned long get_line_length(int x, int bpp)
static int kyrofb_check_var(struct fb_var_screeninfo *var, struct fb_info *info)
{
static int kyrofb_check_var(struct fb_var_screeninfo *var, struct fb_info *info)
{
- struct kyrofb_info *par =
(struct kyrofb_info *)
info->par;
+ struct kyrofb_info *par = info->par;
if (var->bits_per_pixel != 16 && var->bits_per_pixel != 32) {
printk(KERN_WARNING "kyrofb: depth not supported: %u\n", var->bits_per_pixel);
if (var->bits_per_pixel != 16 && var->bits_per_pixel != 32) {
printk(KERN_WARNING "kyrofb: depth not supported: %u\n", var->bits_per_pixel);
@@
-478,7
+476,7
@@
static int kyrofb_check_var(struct fb_var_screeninfo *var, struct fb_info *info)
static int kyrofb_set_par(struct fb_info *info)
{
static int kyrofb_set_par(struct fb_info *info)
{
- struct kyrofb_info *par =
(struct kyrofb_info *)
info->par;
+ struct kyrofb_info *par = info->par;
unsigned long lineclock;
unsigned long frameclock;
unsigned long lineclock;
unsigned long frameclock;
@@
-536,20
+534,22
@@
static int kyrofb_set_par(struct fb_info *info)
static int kyrofb_setcolreg(u_int regno, u_int red, u_int green,
u_int blue, u_int transp, struct fb_info *info)
{
static int kyrofb_setcolreg(u_int regno, u_int red, u_int green,
u_int blue, u_int transp, struct fb_info *info)
{
+ struct kyrofb_info *par = info->par;
+
if (regno > 255)
return 1; /* Invalid register */
if (regno < 16) {
switch (info->var.bits_per_pixel) {
case 16:
if (regno > 255)
return 1; /* Invalid register */
if (regno < 16) {
switch (info->var.bits_per_pixel) {
case 16:
-
((u16*)(info->pseudo_palette))
[regno] =
+
par->palette
[regno] =
(red & 0xf800) |
((green & 0xfc00) >> 5) |
((blue & 0xf800) >> 11);
break;
case 32:
red >>= 8; green >>= 8; blue >>= 8; transp >>= 8;
(red & 0xf800) |
((green & 0xfc00) >> 5) |
((blue & 0xf800) >> 11);
break;
case 32:
red >>= 8; green >>= 8; blue >>= 8; transp >>= 8;
-
((u32*)(info->pseudo_palette))
[regno] =
+
par->palette
[regno] =
(transp << 24) | (red << 16) | (green << 8) | blue;
break;
}
(transp << 24) | (red << 16) | (green << 8) | blue;
break;
}
@@
-586,9
+586,8
@@
static int __init kyrofb_setup(char *options)
}
#endif
}
#endif
-static int kyrofb_ioctl(struct inode *inode, struct file *file,
- unsigned int cmd, unsigned long arg,
- struct fb_info *info)
+static int kyrofb_ioctl(struct fb_info *info,
+ unsigned int cmd, unsigned long arg)
{
overlay_create ol_create;
overlay_viewport_set ol_viewport_set;
{
overlay_create ol_create;
overlay_viewport_set ol_viewport_set;
@@
-669,13
+668,13
@@
static struct fb_ops kyrofb_ops = {
.fb_fillrect = cfb_fillrect,
.fb_copyarea = cfb_copyarea,
.fb_imageblit = cfb_imageblit,
.fb_fillrect = cfb_fillrect,
.fb_copyarea = cfb_copyarea,
.fb_imageblit = cfb_imageblit,
- .fb_cursor = soft_cursor,
};
static int __devinit kyrofb_probe(struct pci_dev *pdev,
const struct pci_device_id *ent)
{
struct fb_info *info;
};
static int __devinit kyrofb_probe(struct pci_dev *pdev,
const struct pci_device_id *ent)
{
struct fb_info *info;
+ struct kyrofb_info *currentpar;
unsigned long size;
int err;
unsigned long size;
int err;
@@
-684,14
+683,11
@@
static int __devinit kyrofb_probe(struct pci_dev *pdev,
return err;
}
return err;
}
- size = sizeof(struct fb_info) + sizeof(struct kyrofb_info) + 16 * sizeof(u32);
- info = kmalloc(size, GFP_KERNEL);
+ info = framebuffer_alloc(sizeof(struct kyrofb_info), &pdev->dev);
if (!info)
return -ENOMEM;
if (!info)
return -ENOMEM;
- memset(info, 0, size);
-
- currentpar = (struct kyrofb_info *)(info + 1);
+ currentpar = info->par;
kyro_fix.smem_start = pci_resource_start(pdev, 0);
kyro_fix.smem_len = pci_resource_len(pdev, 0);
kyro_fix.smem_start = pci_resource_start(pdev, 0);
kyro_fix.smem_len = pci_resource_len(pdev, 0);
@@
-717,8
+713,7
@@
static int __devinit kyrofb_probe(struct pci_dev *pdev,
info->fbops = &kyrofb_ops;
info->fix = kyro_fix;
info->fbops = &kyrofb_ops;
info->fix = kyro_fix;
- info->par = currentpar;
- info->pseudo_palette = (void *)(currentpar + 1);
+ info->pseudo_palette = currentpar->palette;
info->flags = FBINFO_DEFAULT;
SetCoreClockPLL(deviceInfo.pSTGReg, pdev);
info->flags = FBINFO_DEFAULT;
SetCoreClockPLL(deviceInfo.pSTGReg, pdev);
@@
-742,7
+737,6
@@
static int __devinit kyrofb_probe(struct pci_dev *pdev,
fb_memset(info->screen_base, 0, size);
fb_memset(info->screen_base, 0, size);
- info->device = &pdev->dev;
if (register_framebuffer(info) < 0)
goto out_unmap;
if (register_framebuffer(info) < 0)
goto out_unmap;
@@
-758,7
+752,7
@@
static int __devinit kyrofb_probe(struct pci_dev *pdev,
out_unmap:
iounmap(currentpar->regbase);
iounmap(info->screen_base);
out_unmap:
iounmap(currentpar->regbase);
iounmap(info->screen_base);
-
kfre
e(info);
+
framebuffer_releas
e(info);
return -EINVAL;
}
return -EINVAL;
}
@@
-766,7
+760,7
@@
out_unmap:
static void __devexit kyrofb_remove(struct pci_dev *pdev)
{
struct fb_info *info = pci_get_drvdata(pdev);
static void __devexit kyrofb_remove(struct pci_dev *pdev)
{
struct fb_info *info = pci_get_drvdata(pdev);
- struct kyrofb_info *par =
(struct kyrofb_info *)
info->par;
+ struct kyrofb_info *par = info->par;
/* Reset the board */
StopVTG(deviceInfo.pSTGReg);
/* Reset the board */
StopVTG(deviceInfo.pSTGReg);
@@
-790,7
+784,7
@@
static void __devexit kyrofb_remove(struct pci_dev *pdev)
unregister_framebuffer(info);
pci_set_drvdata(pdev, NULL);
unregister_framebuffer(info);
pci_set_drvdata(pdev, NULL);
-
kfre
e(info);
+
framebuffer_releas
e(info);
}
static int __init kyrofb_init(void)
}
static int __init kyrofb_init(void)