Commit 9f19bc56 authored by Antonino A. Daplas's avatar Antonino A. Daplas Committed by Linus Torvalds

[PATCH] fbdev: neofb: Driver cleanups

- remove unneeded casts
- move memory for pseudo_palette inside struct neofb_par
Signed-off-by: default avatarAntonino Daplas <adaplas@pol.net>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent a26968df
...@@ -485,7 +485,7 @@ static void vgaHWRestore(const struct fb_info *info, ...@@ -485,7 +485,7 @@ static void vgaHWRestore(const struct fb_info *info,
*/ */
static inline int neo2200_sync(struct fb_info *info) static inline int neo2200_sync(struct fb_info *info)
{ {
struct neofb_par *par = (struct neofb_par *) info->par; struct neofb_par *par = info->par;
int waitcycles; int waitcycles;
while (readl(&par->neo2200->bltStat) & 1) while (readl(&par->neo2200->bltStat) & 1)
...@@ -525,7 +525,7 @@ static inline void neo2200_wait_fifo(struct fb_info *info, ...@@ -525,7 +525,7 @@ static inline void neo2200_wait_fifo(struct fb_info *info,
static inline void neo2200_accel_init(struct fb_info *info, static inline void neo2200_accel_init(struct fb_info *info,
struct fb_var_screeninfo *var) struct fb_var_screeninfo *var)
{ {
struct neofb_par *par = (struct neofb_par *) info->par; struct neofb_par *par = info->par;
Neo2200 __iomem *neo2200 = par->neo2200; Neo2200 __iomem *neo2200 = par->neo2200;
u32 bltMod, pitch; u32 bltMod, pitch;
...@@ -560,7 +560,7 @@ static inline void neo2200_accel_init(struct fb_info *info, ...@@ -560,7 +560,7 @@ static inline void neo2200_accel_init(struct fb_info *info,
static int static int
neofb_open(struct fb_info *info, int user) neofb_open(struct fb_info *info, int user)
{ {
struct neofb_par *par = (struct neofb_par *) info->par; struct neofb_par *par = info->par;
int cnt = atomic_read(&par->ref_count); int cnt = atomic_read(&par->ref_count);
if (!cnt) { if (!cnt) {
...@@ -575,7 +575,7 @@ neofb_open(struct fb_info *info, int user) ...@@ -575,7 +575,7 @@ neofb_open(struct fb_info *info, int user)
static int static int
neofb_release(struct fb_info *info, int user) neofb_release(struct fb_info *info, int user)
{ {
struct neofb_par *par = (struct neofb_par *) info->par; struct neofb_par *par = info->par;
int cnt = atomic_read(&par->ref_count); int cnt = atomic_read(&par->ref_count);
if (!cnt) if (!cnt)
...@@ -590,7 +590,7 @@ neofb_release(struct fb_info *info, int user) ...@@ -590,7 +590,7 @@ neofb_release(struct fb_info *info, int user)
static int static int
neofb_check_var(struct fb_var_screeninfo *var, struct fb_info *info) neofb_check_var(struct fb_var_screeninfo *var, struct fb_info *info)
{ {
struct neofb_par *par = (struct neofb_par *) info->par; struct neofb_par *par = info->par;
unsigned int pixclock = var->pixclock; unsigned int pixclock = var->pixclock;
struct xtimings timings; struct xtimings timings;
int memlen, vramlen; int memlen, vramlen;
...@@ -757,7 +757,7 @@ neofb_check_var(struct fb_var_screeninfo *var, struct fb_info *info) ...@@ -757,7 +757,7 @@ neofb_check_var(struct fb_var_screeninfo *var, struct fb_info *info)
static int neofb_set_par(struct fb_info *info) static int neofb_set_par(struct fb_info *info)
{ {
struct neofb_par *par = (struct neofb_par *) info->par; struct neofb_par *par = info->par;
struct xtimings timings; struct xtimings timings;
unsigned char temp; unsigned char temp;
int i, clock_hi = 0; int i, clock_hi = 0;
...@@ -1216,7 +1216,7 @@ static int neofb_set_par(struct fb_info *info) ...@@ -1216,7 +1216,7 @@ static int neofb_set_par(struct fb_info *info)
static void neofb_update_start(struct fb_info *info, static void neofb_update_start(struct fb_info *info,
struct fb_var_screeninfo *var) struct fb_var_screeninfo *var)
{ {
struct neofb_par *par = (struct neofb_par *) info->par; struct neofb_par *par = info->par;
struct vgastate *state = &par->state; struct vgastate *state = &par->state;
int oldExtCRTDispAddr; int oldExtCRTDispAddr;
int Base; int Base;
...@@ -1331,7 +1331,7 @@ static int neofb_blank(int blank_mode, struct fb_info *info) ...@@ -1331,7 +1331,7 @@ static int neofb_blank(int blank_mode, struct fb_info *info)
* wms...Enable VESA DPMS compatible powerdown mode * wms...Enable VESA DPMS compatible powerdown mode
* run "setterm -powersave powerdown" to take advantage * run "setterm -powersave powerdown" to take advantage
*/ */
struct neofb_par *par = (struct neofb_par *)info->par; struct neofb_par *par = info->par;
int seqflags, lcdflags, dpmsflags, reg; int seqflags, lcdflags, dpmsflags, reg;
switch (blank_mode) { switch (blank_mode) {
...@@ -1404,7 +1404,7 @@ static int neofb_blank(int blank_mode, struct fb_info *info) ...@@ -1404,7 +1404,7 @@ static int neofb_blank(int blank_mode, struct fb_info *info)
static void static void
neo2200_fillrect(struct fb_info *info, const struct fb_fillrect *rect) neo2200_fillrect(struct fb_info *info, const struct fb_fillrect *rect)
{ {
struct neofb_par *par = (struct neofb_par *) info->par; struct neofb_par *par = info->par;
u_long dst, rop; u_long dst, rop;
dst = rect->dx + rect->dy * info->var.xres_virtual; dst = rect->dx + rect->dy * info->var.xres_virtual;
...@@ -1440,7 +1440,7 @@ static void ...@@ -1440,7 +1440,7 @@ static void
neo2200_copyarea(struct fb_info *info, const struct fb_copyarea *area) neo2200_copyarea(struct fb_info *info, const struct fb_copyarea *area)
{ {
u32 sx = area->sx, sy = area->sy, dx = area->dx, dy = area->dy; u32 sx = area->sx, sy = area->sy, dx = area->dx, dy = area->dy;
struct neofb_par *par = (struct neofb_par *) info->par; struct neofb_par *par = info->par;
u_long src, dst, bltCntl; u_long src, dst, bltCntl;
bltCntl = NEO_BC3_FIFO_EN | NEO_BC3_SKIP_MAPPING | 0x0C0000; bltCntl = NEO_BC3_FIFO_EN | NEO_BC3_SKIP_MAPPING | 0x0C0000;
...@@ -1472,7 +1472,7 @@ neo2200_copyarea(struct fb_info *info, const struct fb_copyarea *area) ...@@ -1472,7 +1472,7 @@ neo2200_copyarea(struct fb_info *info, const struct fb_copyarea *area)
static void static void
neo2200_imageblit(struct fb_info *info, const struct fb_image *image) neo2200_imageblit(struct fb_info *info, const struct fb_image *image)
{ {
struct neofb_par *par = (struct neofb_par *) info->par; struct neofb_par *par = info->par;
int s_pitch = (image->width * image->depth + 7) >> 3; int s_pitch = (image->width * image->depth + 7) >> 3;
int scan_align = info->pixmap.scan_align - 1; int scan_align = info->pixmap.scan_align - 1;
int buf_align = info->pixmap.buf_align - 1; int buf_align = info->pixmap.buf_align - 1;
...@@ -1686,7 +1686,7 @@ static struct fb_videomode __devinitdata mode800x480 = { ...@@ -1686,7 +1686,7 @@ static struct fb_videomode __devinitdata mode800x480 = {
static int __devinit neo_map_mmio(struct fb_info *info, static int __devinit neo_map_mmio(struct fb_info *info,
struct pci_dev *dev) struct pci_dev *dev)
{ {
struct neofb_par *par = (struct neofb_par *) info->par; struct neofb_par *par = info->par;
DBG("neo_map_mmio"); DBG("neo_map_mmio");
...@@ -1733,7 +1733,7 @@ static int __devinit neo_map_mmio(struct fb_info *info, ...@@ -1733,7 +1733,7 @@ static int __devinit neo_map_mmio(struct fb_info *info,
static void neo_unmap_mmio(struct fb_info *info) static void neo_unmap_mmio(struct fb_info *info)
{ {
struct neofb_par *par = (struct neofb_par *) info->par; struct neofb_par *par = info->par;
DBG("neo_unmap_mmio"); DBG("neo_unmap_mmio");
...@@ -1796,7 +1796,7 @@ static void neo_unmap_video(struct fb_info *info) ...@@ -1796,7 +1796,7 @@ static void neo_unmap_video(struct fb_info *info)
#ifdef CONFIG_MTRR #ifdef CONFIG_MTRR
{ {
struct neofb_par *par = (struct neofb_par *) info->par; struct neofb_par *par = info->par;
mtrr_del(par->mtrr, info->fix.smem_start, mtrr_del(par->mtrr, info->fix.smem_start,
info->fix.smem_len); info->fix.smem_len);
...@@ -1811,7 +1811,7 @@ static void neo_unmap_video(struct fb_info *info) ...@@ -1811,7 +1811,7 @@ static void neo_unmap_video(struct fb_info *info)
static int __devinit neo_scan_monitor(struct fb_info *info) static int __devinit neo_scan_monitor(struct fb_info *info)
{ {
struct neofb_par *par = (struct neofb_par *) info->par; struct neofb_par *par = info->par;
unsigned char type, display; unsigned char type, display;
int w; int w;
...@@ -1890,7 +1890,7 @@ static int __devinit neo_scan_monitor(struct fb_info *info) ...@@ -1890,7 +1890,7 @@ static int __devinit neo_scan_monitor(struct fb_info *info)
static int __devinit neo_init_hw(struct fb_info *info) static int __devinit neo_init_hw(struct fb_info *info)
{ {
struct neofb_par *par = (struct neofb_par *) info->par; struct neofb_par *par = info->par;
int videoRam = 896; int videoRam = 896;
int maxClock = 65000; int maxClock = 65000;
int CursorMem = 1024; int CursorMem = 1024;
...@@ -2014,7 +2014,7 @@ static struct fb_info *__devinit neo_alloc_fb_info(struct pci_dev *dev, const st ...@@ -2014,7 +2014,7 @@ static struct fb_info *__devinit neo_alloc_fb_info(struct pci_dev *dev, const st
struct fb_info *info; struct fb_info *info;
struct neofb_par *par; struct neofb_par *par;
info = framebuffer_alloc(sizeof(struct neofb_par) + sizeof(u32) * 256, &dev->dev); info = framebuffer_alloc(sizeof(struct neofb_par), &dev->dev);
if (!info) if (!info)
return NULL; return NULL;
...@@ -2081,7 +2081,7 @@ static struct fb_info *__devinit neo_alloc_fb_info(struct pci_dev *dev, const st ...@@ -2081,7 +2081,7 @@ static struct fb_info *__devinit neo_alloc_fb_info(struct pci_dev *dev, const st
info->fix.accel = id->driver_data; info->fix.accel = id->driver_data;
info->fbops = &neofb_ops; info->fbops = &neofb_ops;
info->pseudo_palette = (void *) (par + 1); info->pseudo_palette = par->palette;
return info; return info;
} }
......
...@@ -196,6 +196,7 @@ struct neofb_par { ...@@ -196,6 +196,7 @@ struct neofb_par {
int internal_display; int internal_display;
int external_display; int external_display;
int libretto; int libretto;
u32 palette[16];
}; };
typedef struct { typedef struct {
......
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