Commit adfbf653 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'fbdev-for-6.4-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/linux-fbdev

Pull fbdev fixes from Helge Deller:

 - use after free fix in imsttfb (Zheng Wang)

 - fix error handling in arcfb (Zongjie Li)

 - lots of whitespace cleanups (Thomas Zimmermann)

 - add 1920x1080 modedb entry (me)

* tag 'fbdev-for-6.4-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/linux-fbdev:
  fbdev: stifb: Fix info entry in sti_struct on error path
  fbdev: modedb: Add 1920x1080 at 60 Hz video mode
  fbdev: imsttfb: Fix use after free bug in imsttfb_probe
  fbdev: vfb: Remove trailing whitespaces
  fbdev: valkyriefb: Remove trailing whitespaces
  fbdev: stifb: Remove trailing whitespaces
  fbdev: sa1100fb: Remove trailing whitespaces
  fbdev: platinumfb: Remove trailing whitespaces
  fbdev: p9100: Remove trailing whitespaces
  fbdev: maxinefb: Remove trailing whitespaces
  fbdev: macfb: Remove trailing whitespaces
  fbdev: hpfb: Remove trailing whitespaces
  fbdev: hgafb: Remove trailing whitespaces
  fbdev: g364fb: Remove trailing whitespaces
  fbdev: controlfb: Remove trailing whitespaces
  fbdev: cg14: Remove trailing whitespaces
  fbdev: atmel_lcdfb: Remove trailing whitespaces
  fbdev: 68328fb: Remove trailing whitespaces
  fbdev: arcfb: Fix error handling in arcfb_probe()
parents 046206ba 0bdf1ad8
...@@ -124,7 +124,7 @@ static u_long get_line_length(int xres_virtual, int bpp) ...@@ -124,7 +124,7 @@ static u_long get_line_length(int xres_virtual, int bpp)
* First part, xxxfb_check_var, must not write anything * First part, xxxfb_check_var, must not write anything
* to hardware, it should only verify and adjust var. * to hardware, it should only verify and adjust var.
* This means it doesn't alter par but it does use hardware * This means it doesn't alter par but it does use hardware
* data from it to check this var. * data from it to check this var.
*/ */
static int mc68x328fb_check_var(struct fb_var_screeninfo *var, static int mc68x328fb_check_var(struct fb_var_screeninfo *var,
...@@ -182,7 +182,7 @@ static int mc68x328fb_check_var(struct fb_var_screeninfo *var, ...@@ -182,7 +182,7 @@ static int mc68x328fb_check_var(struct fb_var_screeninfo *var,
/* /*
* Now that we checked it we alter var. The reason being is that the video * Now that we checked it we alter var. The reason being is that the video
* mode passed in might not work but slight changes to it might make it * mode passed in might not work but slight changes to it might make it
* work. This way we let the user know what is acceptable. * work. This way we let the user know what is acceptable.
*/ */
switch (var->bits_per_pixel) { switch (var->bits_per_pixel) {
...@@ -257,8 +257,8 @@ static int mc68x328fb_check_var(struct fb_var_screeninfo *var, ...@@ -257,8 +257,8 @@ static int mc68x328fb_check_var(struct fb_var_screeninfo *var,
} }
/* This routine actually sets the video mode. It's in here where we /* This routine actually sets the video mode. It's in here where we
* the hardware state info->par and fix which can be affected by the * the hardware state info->par and fix which can be affected by the
* change in par. For this driver it doesn't do much. * change in par. For this driver it doesn't do much.
*/ */
static int mc68x328fb_set_par(struct fb_info *info) static int mc68x328fb_set_par(struct fb_info *info)
{ {
...@@ -295,7 +295,7 @@ static int mc68x328fb_setcolreg(u_int regno, u_int red, u_int green, u_int blue, ...@@ -295,7 +295,7 @@ static int mc68x328fb_setcolreg(u_int regno, u_int red, u_int green, u_int blue,
* {hardwarespecific} contains width of RAMDAC * {hardwarespecific} contains width of RAMDAC
* cmap[X] is programmed to (X << red.offset) | (X << green.offset) | (X << blue.offset) * cmap[X] is programmed to (X << red.offset) | (X << green.offset) | (X << blue.offset)
* RAMDAC[X] is programmed to (red, green, blue) * RAMDAC[X] is programmed to (red, green, blue)
* *
* Pseudocolor: * Pseudocolor:
* uses offset = 0 && length = RAMDAC register width. * uses offset = 0 && length = RAMDAC register width.
* var->{color}.offset is 0 * var->{color}.offset is 0
...@@ -384,7 +384,7 @@ static int mc68x328fb_pan_display(struct fb_var_screeninfo *var, ...@@ -384,7 +384,7 @@ static int mc68x328fb_pan_display(struct fb_var_screeninfo *var,
} }
/* /*
* Most drivers don't need their own mmap function * Most drivers don't need their own mmap function
*/ */
static int mc68x328fb_mmap(struct fb_info *info, struct vm_area_struct *vma) static int mc68x328fb_mmap(struct fb_info *info, struct vm_area_struct *vma)
......
...@@ -523,7 +523,7 @@ static int arcfb_probe(struct platform_device *dev) ...@@ -523,7 +523,7 @@ static int arcfb_probe(struct platform_device *dev)
info = framebuffer_alloc(sizeof(struct arcfb_par), &dev->dev); info = framebuffer_alloc(sizeof(struct arcfb_par), &dev->dev);
if (!info) if (!info)
goto err; goto err_fb_alloc;
info->screen_base = (char __iomem *)videomemory; info->screen_base = (char __iomem *)videomemory;
info->fbops = &arcfb_ops; info->fbops = &arcfb_ops;
...@@ -535,7 +535,7 @@ static int arcfb_probe(struct platform_device *dev) ...@@ -535,7 +535,7 @@ static int arcfb_probe(struct platform_device *dev)
if (!dio_addr || !cio_addr || !c2io_addr) { if (!dio_addr || !cio_addr || !c2io_addr) {
printk(KERN_WARNING "no IO addresses supplied\n"); printk(KERN_WARNING "no IO addresses supplied\n");
goto err1; goto err_addr;
} }
par->dio_addr = dio_addr; par->dio_addr = dio_addr;
par->cio_addr = cio_addr; par->cio_addr = cio_addr;
...@@ -551,12 +551,12 @@ static int arcfb_probe(struct platform_device *dev) ...@@ -551,12 +551,12 @@ static int arcfb_probe(struct platform_device *dev)
printk(KERN_INFO printk(KERN_INFO
"arcfb: Failed req IRQ %d\n", par->irq); "arcfb: Failed req IRQ %d\n", par->irq);
retval = -EBUSY; retval = -EBUSY;
goto err1; goto err_addr;
} }
} }
retval = register_framebuffer(info); retval = register_framebuffer(info);
if (retval < 0) if (retval < 0)
goto err1; goto err_register_fb;
platform_set_drvdata(dev, info); platform_set_drvdata(dev, info);
fb_info(info, "Arc frame buffer device, using %dK of video memory\n", fb_info(info, "Arc frame buffer device, using %dK of video memory\n",
videomemorysize >> 10); videomemorysize >> 10);
...@@ -580,9 +580,12 @@ static int arcfb_probe(struct platform_device *dev) ...@@ -580,9 +580,12 @@ static int arcfb_probe(struct platform_device *dev)
} }
return 0; return 0;
err1:
err_register_fb:
free_irq(par->irq, info);
err_addr:
framebuffer_release(info); framebuffer_release(info);
err: err_fb_alloc:
vfree(videomemory); vfree(videomemory);
return retval; return retval;
} }
......
...@@ -317,7 +317,7 @@ static inline void atmel_lcdfb_free_video_memory(struct atmel_lcdfb_info *sinfo) ...@@ -317,7 +317,7 @@ static inline void atmel_lcdfb_free_video_memory(struct atmel_lcdfb_info *sinfo)
/** /**
* atmel_lcdfb_alloc_video_memory - Allocate framebuffer memory * atmel_lcdfb_alloc_video_memory - Allocate framebuffer memory
* @sinfo: the frame buffer to allocate memory for * @sinfo: the frame buffer to allocate memory for
* *
* This function is called only from the atmel_lcdfb_probe() * This function is called only from the atmel_lcdfb_probe()
* so no locking by fb_info->mm_lock around smem_len setting is needed. * so no locking by fb_info->mm_lock around smem_len setting is needed.
*/ */
......
...@@ -512,7 +512,7 @@ static int cg14_probe(struct platform_device *op) ...@@ -512,7 +512,7 @@ static int cg14_probe(struct platform_device *op)
is_8mb = (resource_size(&op->resource[1]) == (8 * 1024 * 1024)); is_8mb = (resource_size(&op->resource[1]) == (8 * 1024 * 1024));
BUILD_BUG_ON(sizeof(par->mmap_map) != sizeof(__cg14_mmap_map)); BUILD_BUG_ON(sizeof(par->mmap_map) != sizeof(__cg14_mmap_map));
memcpy(&par->mmap_map, &__cg14_mmap_map, sizeof(par->mmap_map)); memcpy(&par->mmap_map, &__cg14_mmap_map, sizeof(par->mmap_map));
for (i = 0; i < CG14_MMAP_ENTRIES; i++) { for (i = 0; i < CG14_MMAP_ENTRIES; i++) {
......
...@@ -113,14 +113,14 @@ struct fb_info_control { ...@@ -113,14 +113,14 @@ struct fb_info_control {
struct fb_info info; struct fb_info info;
struct fb_par_control par; struct fb_par_control par;
u32 pseudo_palette[16]; u32 pseudo_palette[16];
struct cmap_regs __iomem *cmap_regs; struct cmap_regs __iomem *cmap_regs;
unsigned long cmap_regs_phys; unsigned long cmap_regs_phys;
struct control_regs __iomem *control_regs; struct control_regs __iomem *control_regs;
unsigned long control_regs_phys; unsigned long control_regs_phys;
unsigned long control_regs_size; unsigned long control_regs_size;
__u8 __iomem *frame_buffer; __u8 __iomem *frame_buffer;
unsigned long frame_buffer_phys; unsigned long frame_buffer_phys;
unsigned long fb_orig_base; unsigned long fb_orig_base;
...@@ -196,7 +196,7 @@ static void set_control_clock(unsigned char *params) ...@@ -196,7 +196,7 @@ static void set_control_clock(unsigned char *params)
while (!req.complete) while (!req.complete)
cuda_poll(); cuda_poll();
} }
#endif #endif
} }
/* /*
...@@ -233,19 +233,19 @@ static void control_set_hardware(struct fb_info_control *p, struct fb_par_contro ...@@ -233,19 +233,19 @@ static void control_set_hardware(struct fb_info_control *p, struct fb_par_contro
if (p->par.xoffset != par->xoffset || if (p->par.xoffset != par->xoffset ||
p->par.yoffset != par->yoffset) p->par.yoffset != par->yoffset)
set_screen_start(par->xoffset, par->yoffset, p); set_screen_start(par->xoffset, par->yoffset, p);
return; return;
} }
p->par = *par; p->par = *par;
cmode = p->par.cmode; cmode = p->par.cmode;
r = &par->regvals; r = &par->regvals;
/* Turn off display */ /* Turn off display */
out_le32(CNTRL_REG(p,ctrl), 0x400 | par->ctrl); out_le32(CNTRL_REG(p,ctrl), 0x400 | par->ctrl);
set_control_clock(r->clock_params); set_control_clock(r->clock_params);
RADACAL_WRITE(0x20, r->radacal_ctrl); RADACAL_WRITE(0x20, r->radacal_ctrl);
RADACAL_WRITE(0x21, p->control_use_bank2 ? 0 : 1); RADACAL_WRITE(0x21, p->control_use_bank2 ? 0 : 1);
RADACAL_WRITE(0x10, 0); RADACAL_WRITE(0x10, 0);
...@@ -254,7 +254,7 @@ static void control_set_hardware(struct fb_info_control *p, struct fb_par_contro ...@@ -254,7 +254,7 @@ static void control_set_hardware(struct fb_info_control *p, struct fb_par_contro
rp = &p->control_regs->vswin; rp = &p->control_regs->vswin;
for (i = 0; i < 16; ++i, ++rp) for (i = 0; i < 16; ++i, ++rp)
out_le32(&rp->r, r->regs[i]); out_le32(&rp->r, r->regs[i]);
out_le32(CNTRL_REG(p,pitch), par->pitch); out_le32(CNTRL_REG(p,pitch), par->pitch);
out_le32(CNTRL_REG(p,mode), r->mode); out_le32(CNTRL_REG(p,mode), r->mode);
out_le32(CNTRL_REG(p,vram_attr), p->vram_attr); out_le32(CNTRL_REG(p,vram_attr), p->vram_attr);
...@@ -366,7 +366,7 @@ static int read_control_sense(struct fb_info_control *p) ...@@ -366,7 +366,7 @@ static int read_control_sense(struct fb_info_control *p)
sense |= (in_le32(CNTRL_REG(p,mon_sense)) & 0x180) >> 7; sense |= (in_le32(CNTRL_REG(p,mon_sense)) & 0x180) >> 7;
out_le32(CNTRL_REG(p,mon_sense), 077); /* turn off drivers */ out_le32(CNTRL_REG(p,mon_sense), 077); /* turn off drivers */
return sense; return sense;
} }
...@@ -558,9 +558,9 @@ static int control_var_to_par(struct fb_var_screeninfo *var, ...@@ -558,9 +558,9 @@ static int control_var_to_par(struct fb_var_screeninfo *var,
static void control_par_to_var(struct fb_par_control *par, struct fb_var_screeninfo *var) static void control_par_to_var(struct fb_par_control *par, struct fb_var_screeninfo *var)
{ {
struct control_regints *rv; struct control_regints *rv;
rv = (struct control_regints *) par->regvals.regs; rv = (struct control_regints *) par->regvals.regs;
memset(var, 0, sizeof(*var)); memset(var, 0, sizeof(*var));
var->xres = par->xres; var->xres = par->xres;
var->yres = par->yres; var->yres = par->yres;
...@@ -568,7 +568,7 @@ static void control_par_to_var(struct fb_par_control *par, struct fb_var_screeni ...@@ -568,7 +568,7 @@ static void control_par_to_var(struct fb_par_control *par, struct fb_var_screeni
var->yres_virtual = par->vyres; var->yres_virtual = par->vyres;
var->xoffset = par->xoffset; var->xoffset = par->xoffset;
var->yoffset = par->yoffset; var->yoffset = par->yoffset;
switch(par->cmode) { switch(par->cmode) {
default: default:
case CMODE_8: case CMODE_8:
...@@ -634,7 +634,7 @@ static int controlfb_check_var (struct fb_var_screeninfo *var, struct fb_info *i ...@@ -634,7 +634,7 @@ static int controlfb_check_var (struct fb_var_screeninfo *var, struct fb_info *i
err = control_var_to_par(var, &par, info); err = control_var_to_par(var, &par, info);
if (err) if (err)
return err; return err;
control_par_to_var(&par, var); control_par_to_var(&par, var);
return 0; return 0;
...@@ -655,7 +655,7 @@ static int controlfb_set_par (struct fb_info *info) ...@@ -655,7 +655,7 @@ static int controlfb_set_par (struct fb_info *info)
" control_var_to_par: %d.\n", err); " control_var_to_par: %d.\n", err);
return err; return err;
} }
control_set_hardware(p, &par); control_set_hardware(p, &par);
info->fix.visual = (p->par.cmode == CMODE_8) ? info->fix.visual = (p->par.cmode == CMODE_8) ?
...@@ -840,7 +840,7 @@ static int __init init_control(struct fb_info_control *p) ...@@ -840,7 +840,7 @@ static int __init init_control(struct fb_info_control *p)
int full, sense, vmode, cmode, vyres; int full, sense, vmode, cmode, vyres;
struct fb_var_screeninfo var; struct fb_var_screeninfo var;
int rc; int rc;
printk(KERN_INFO "controlfb: "); printk(KERN_INFO "controlfb: ");
full = p->total_vram == 0x400000; full = p->total_vram == 0x400000;
......
...@@ -257,6 +257,11 @@ static const struct fb_videomode modedb[] = { ...@@ -257,6 +257,11 @@ static const struct fb_videomode modedb[] = {
{ NULL, 72, 480, 300, 33386, 40, 24, 11, 19, 80, 3, 0, { NULL, 72, 480, 300, 33386, 40, 24, 11, 19, 80, 3, 0,
FB_VMODE_DOUBLE }, FB_VMODE_DOUBLE },
/* 1920x1080 @ 60 Hz, 67.3 kHz hsync */
{ NULL, 60, 1920, 1080, 6734, 148, 88, 36, 4, 44, 5, 0,
FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
FB_VMODE_NONINTERLACED },
/* 1920x1200 @ 60 Hz, 74.5 Khz hsync */ /* 1920x1200 @ 60 Hz, 74.5 Khz hsync */
{ NULL, 60, 1920, 1200, 5177, 128, 336, 1, 38, 208, 3, { NULL, 60, 1920, 1200, 5177, 128, 336, 1, 38, 208, 3,
FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
* *
* This driver is based on tgafb.c * This driver is based on tgafb.c
* *
* Copyright (C) 1997 Geert Uytterhoeven * Copyright (C) 1997 Geert Uytterhoeven
* Copyright (C) 1995 Jay Estabrook * Copyright (C) 1995 Jay Estabrook
* *
* This file is subject to the terms and conditions of the GNU General Public * This file is subject to the terms and conditions of the GNU General Public
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
#include <asm/io.h> #include <asm/io.h>
#include <asm/jazz.h> #include <asm/jazz.h>
/* /*
* Various defines for the G364 * Various defines for the G364
*/ */
#define G364_MEM_BASE 0xe4400000 #define G364_MEM_BASE 0xe4400000
...@@ -125,7 +125,7 @@ static const struct fb_ops g364fb_ops = { ...@@ -125,7 +125,7 @@ static const struct fb_ops g364fb_ops = {
* *
* This call looks only at xoffset, yoffset and the FB_VMODE_YWRAP flag * This call looks only at xoffset, yoffset and the FB_VMODE_YWRAP flag
*/ */
static int g364fb_pan_display(struct fb_var_screeninfo *var, static int g364fb_pan_display(struct fb_var_screeninfo *var,
struct fb_info *info) struct fb_info *info)
{ {
if (var->xoffset || if (var->xoffset ||
......
/* /*
* linux/drivers/video/hgafb.c -- Hercules graphics adaptor frame buffer device * linux/drivers/video/hgafb.c -- Hercules graphics adaptor frame buffer device
* *
* Created 25 Nov 1999 by Ferenc Bakonyi (fero@drama.obuda.kando.hu) * Created 25 Nov 1999 by Ferenc Bakonyi (fero@drama.obuda.kando.hu)
* Based on skeletonfb.c by Geert Uytterhoeven and * Based on skeletonfb.c by Geert Uytterhoeven and
* mdacon.c by Andrew Apted * mdacon.c by Andrew Apted
...@@ -8,14 +8,14 @@ ...@@ -8,14 +8,14 @@
* History: * History:
* *
* - Revision 0.1.8 (23 Oct 2002): Ported to new framebuffer api. * - Revision 0.1.8 (23 Oct 2002): Ported to new framebuffer api.
* *
* - Revision 0.1.7 (23 Jan 2001): fix crash resulting from MDA only cards * - Revision 0.1.7 (23 Jan 2001): fix crash resulting from MDA only cards
* being detected as Hercules. (Paul G.) * being detected as Hercules. (Paul G.)
* - Revision 0.1.6 (17 Aug 2000): new style structs * - Revision 0.1.6 (17 Aug 2000): new style structs
* documentation * documentation
* - Revision 0.1.5 (13 Mar 2000): spinlocks instead of saveflags();cli();etc * - Revision 0.1.5 (13 Mar 2000): spinlocks instead of saveflags();cli();etc
* minor fixes * minor fixes
* - Revision 0.1.4 (24 Jan 2000): fixed a bug in hga_card_detect() for * - Revision 0.1.4 (24 Jan 2000): fixed a bug in hga_card_detect() for
* HGA-only systems * HGA-only systems
* - Revision 0.1.3 (22 Jan 2000): modified for the new fb_info structure * - Revision 0.1.3 (22 Jan 2000): modified for the new fb_info structure
* screen is cleared after rmmod * screen is cleared after rmmod
...@@ -143,7 +143,7 @@ static bool nologo = 0; ...@@ -143,7 +143,7 @@ static bool nologo = 0;
static void write_hga_b(unsigned int val, unsigned char reg) static void write_hga_b(unsigned int val, unsigned char reg)
{ {
outb_p(reg, HGA_INDEX_PORT); outb_p(reg, HGA_INDEX_PORT);
outb_p(val, HGA_VALUE_PORT); outb_p(val, HGA_VALUE_PORT);
} }
...@@ -155,7 +155,7 @@ static void write_hga_w(unsigned int val, unsigned char reg) ...@@ -155,7 +155,7 @@ static void write_hga_w(unsigned int val, unsigned char reg)
static int test_hga_b(unsigned char val, unsigned char reg) static int test_hga_b(unsigned char val, unsigned char reg)
{ {
outb_p(reg, HGA_INDEX_PORT); outb_p(reg, HGA_INDEX_PORT);
outb (val, HGA_VALUE_PORT); outb (val, HGA_VALUE_PORT);
udelay(20); val = (inb_p(HGA_VALUE_PORT) == val); udelay(20); val = (inb_p(HGA_VALUE_PORT) == val);
return val; return val;
...@@ -244,7 +244,7 @@ static void hga_show_logo(struct fb_info *info) ...@@ -244,7 +244,7 @@ static void hga_show_logo(struct fb_info *info)
void __iomem *dest = hga_vram; void __iomem *dest = hga_vram;
char *logo = linux_logo_bw; char *logo = linux_logo_bw;
int x, y; int x, y;
for (y = 134; y < 134 + 80 ; y++) * this needs some cleanup * for (y = 134; y < 134 + 80 ; y++) * this needs some cleanup *
for (x = 0; x < 10 ; x++) for (x = 0; x < 10 ; x++)
writeb(~*(logo++),(dest + HGA_ROWADDR(y) + x + 40)); writeb(~*(logo++),(dest + HGA_ROWADDR(y) + x + 40));
...@@ -255,7 +255,7 @@ static void hga_pan(unsigned int xoffset, unsigned int yoffset) ...@@ -255,7 +255,7 @@ static void hga_pan(unsigned int xoffset, unsigned int yoffset)
{ {
unsigned int base; unsigned int base;
unsigned long flags; unsigned long flags;
base = (yoffset / 8) * 90 + xoffset; base = (yoffset / 8) * 90 + xoffset;
spin_lock_irqsave(&hga_reg_lock, flags); spin_lock_irqsave(&hga_reg_lock, flags);
write_hga_w(base, 0x0c); /* start address */ write_hga_w(base, 0x0c); /* start address */
...@@ -310,7 +310,7 @@ static int hga_card_detect(void) ...@@ -310,7 +310,7 @@ static int hga_card_detect(void)
/* Ok, there is definitely a card registering at the correct /* Ok, there is definitely a card registering at the correct
* memory location, so now we do an I/O port test. * memory location, so now we do an I/O port test.
*/ */
if (!test_hga_b(0x66, 0x0f)) /* cursor low register */ if (!test_hga_b(0x66, 0x0f)) /* cursor low register */
goto error; goto error;
...@@ -321,7 +321,7 @@ static int hga_card_detect(void) ...@@ -321,7 +321,7 @@ static int hga_card_detect(void)
* bit of the status register is changing. This test lasts for * bit of the status register is changing. This test lasts for
* approximately 1/10th of a second. * approximately 1/10th of a second.
*/ */
p_save = q_save = inb_p(HGA_STATUS_PORT) & HGA_STATUS_VSYNC; p_save = q_save = inb_p(HGA_STATUS_PORT) & HGA_STATUS_VSYNC;
for (count=0; count < 50000 && p_save == q_save; count++) { for (count=0; count < 50000 && p_save == q_save; count++) {
...@@ -329,7 +329,7 @@ static int hga_card_detect(void) ...@@ -329,7 +329,7 @@ static int hga_card_detect(void)
udelay(2); udelay(2);
} }
if (p_save == q_save) if (p_save == q_save)
goto error; goto error;
switch (inb_p(HGA_STATUS_PORT) & 0x70) { switch (inb_p(HGA_STATUS_PORT) & 0x70) {
...@@ -415,7 +415,7 @@ static int hgafb_setcolreg(u_int regno, u_int red, u_int green, u_int blue, ...@@ -415,7 +415,7 @@ static int hgafb_setcolreg(u_int regno, u_int red, u_int green, u_int blue,
* @info:pointer to fb_info object containing info for current hga board * @info:pointer to fb_info object containing info for current hga board
* *
* This function looks only at xoffset, yoffset and the %FB_VMODE_YWRAP * This function looks only at xoffset, yoffset and the %FB_VMODE_YWRAP
* flag in @var. If input parameters are correct it calls hga_pan() to * flag in @var. If input parameters are correct it calls hga_pan() to
* program the hardware. @info->var is updated to the new values. * program the hardware. @info->var is updated to the new values.
* A zero is returned on success and %-EINVAL for failure. * A zero is returned on success and %-EINVAL for failure.
*/ */
...@@ -442,9 +442,9 @@ static int hgafb_pan_display(struct fb_var_screeninfo *var, ...@@ -442,9 +442,9 @@ static int hgafb_pan_display(struct fb_var_screeninfo *var,
* hgafb_blank - (un)blank the screen * hgafb_blank - (un)blank the screen
* @blank_mode:blanking method to use * @blank_mode:blanking method to use
* @info:unused * @info:unused
* *
* Blank the screen if blank_mode != 0, else unblank. * Blank the screen if blank_mode != 0, else unblank.
* Implements VESA suspend and powerdown modes on hardware that supports * Implements VESA suspend and powerdown modes on hardware that supports
* disabling hsync/vsync: * disabling hsync/vsync:
* @blank_mode == 2 means suspend vsync, * @blank_mode == 2 means suspend vsync,
* @blank_mode == 3 means suspend hsync, * @blank_mode == 3 means suspend hsync,
...@@ -539,15 +539,15 @@ static const struct fb_ops hgafb_ops = { ...@@ -539,15 +539,15 @@ static const struct fb_ops hgafb_ops = {
.fb_copyarea = hgafb_copyarea, .fb_copyarea = hgafb_copyarea,
.fb_imageblit = hgafb_imageblit, .fb_imageblit = hgafb_imageblit,
}; };
/* ------------------------------------------------------------------------- * /* ------------------------------------------------------------------------- *
* *
* Functions in fb_info * Functions in fb_info
* *
* ------------------------------------------------------------------------- */ * ------------------------------------------------------------------------- */
/* ------------------------------------------------------------------------- */ /* ------------------------------------------------------------------------- */
/* /*
* Initialization * Initialization
*/ */
......
...@@ -92,7 +92,7 @@ static int hpfb_setcolreg(unsigned regno, unsigned red, unsigned green, ...@@ -92,7 +92,7 @@ static int hpfb_setcolreg(unsigned regno, unsigned red, unsigned green,
if (regno >= info->cmap.len) if (regno >= info->cmap.len)
return 1; return 1;
while (in_be16(fb_regs + 0x6002) & 0x4) udelay(1); while (in_be16(fb_regs + 0x6002) & 0x4) udelay(1);
out_be16(fb_regs + 0x60ba, 0xff); out_be16(fb_regs + 0x60ba, 0xff);
...@@ -143,7 +143,7 @@ static void topcat_blit(int x0, int y0, int x1, int y1, int w, int h, int rr) ...@@ -143,7 +143,7 @@ static void topcat_blit(int x0, int y0, int x1, int y1, int w, int h, int rr)
out_8(fb_regs + WMOVE, fb_bitmask); out_8(fb_regs + WMOVE, fb_bitmask);
} }
static void hpfb_copyarea(struct fb_info *info, const struct fb_copyarea *area) static void hpfb_copyarea(struct fb_info *info, const struct fb_copyarea *area)
{ {
topcat_blit(area->sx, area->sy, area->dx, area->dy, area->width, area->height, RR_COPY); topcat_blit(area->sx, area->sy, area->dx, area->dy, area->width, area->height, RR_COPY);
} }
...@@ -315,7 +315,7 @@ static int hpfb_init_one(unsigned long phys_base, unsigned long virt_base) ...@@ -315,7 +315,7 @@ static int hpfb_init_one(unsigned long phys_base, unsigned long virt_base)
return ret; return ret;
} }
/* /*
* Check that the secondary ID indicates that we have some hope of working with this * Check that the secondary ID indicates that we have some hope of working with this
* framebuffer. The catseye boards are pretty much like topcats and we can muddle through. * framebuffer. The catseye boards are pretty much like topcats and we can muddle through.
*/ */
...@@ -323,7 +323,7 @@ static int hpfb_init_one(unsigned long phys_base, unsigned long virt_base) ...@@ -323,7 +323,7 @@ static int hpfb_init_one(unsigned long phys_base, unsigned long virt_base)
#define topcat_sid_ok(x) (((x) == DIO_ID2_LRCATSEYE) || ((x) == DIO_ID2_HRCCATSEYE) \ #define topcat_sid_ok(x) (((x) == DIO_ID2_LRCATSEYE) || ((x) == DIO_ID2_HRCCATSEYE) \
|| ((x) == DIO_ID2_HRMCATSEYE) || ((x) == DIO_ID2_TOPCAT)) || ((x) == DIO_ID2_HRMCATSEYE) || ((x) == DIO_ID2_TOPCAT))
/* /*
* Initialise the framebuffer * Initialise the framebuffer
*/ */
static int hpfb_dio_probe(struct dio_dev *d, const struct dio_device_id *ent) static int hpfb_dio_probe(struct dio_dev *d, const struct dio_device_id *ent)
......
...@@ -1347,7 +1347,7 @@ static const struct fb_ops imsttfb_ops = { ...@@ -1347,7 +1347,7 @@ static const struct fb_ops imsttfb_ops = {
.fb_ioctl = imsttfb_ioctl, .fb_ioctl = imsttfb_ioctl,
}; };
static void init_imstt(struct fb_info *info) static int init_imstt(struct fb_info *info)
{ {
struct imstt_par *par = info->par; struct imstt_par *par = info->par;
__u32 i, tmp, *ip, *end; __u32 i, tmp, *ip, *end;
...@@ -1420,7 +1420,7 @@ static void init_imstt(struct fb_info *info) ...@@ -1420,7 +1420,7 @@ static void init_imstt(struct fb_info *info)
|| !(compute_imstt_regvals(par, info->var.xres, info->var.yres))) { || !(compute_imstt_regvals(par, info->var.xres, info->var.yres))) {
printk("imsttfb: %ux%ux%u not supported\n", info->var.xres, info->var.yres, info->var.bits_per_pixel); printk("imsttfb: %ux%ux%u not supported\n", info->var.xres, info->var.yres, info->var.bits_per_pixel);
framebuffer_release(info); framebuffer_release(info);
return; return -ENODEV;
} }
sprintf(info->fix.id, "IMS TT (%s)", par->ramdac == IBM ? "IBM" : "TVP"); sprintf(info->fix.id, "IMS TT (%s)", par->ramdac == IBM ? "IBM" : "TVP");
...@@ -1456,12 +1456,13 @@ static void init_imstt(struct fb_info *info) ...@@ -1456,12 +1456,13 @@ static void init_imstt(struct fb_info *info)
if (register_framebuffer(info) < 0) { if (register_framebuffer(info) < 0) {
framebuffer_release(info); framebuffer_release(info);
return; return -ENODEV;
} }
tmp = (read_reg_le32(par->dc_regs, SSTATUS) & 0x0f00) >> 8; tmp = (read_reg_le32(par->dc_regs, SSTATUS) & 0x0f00) >> 8;
fb_info(info, "%s frame buffer; %uMB vram; chip version %u\n", fb_info(info, "%s frame buffer; %uMB vram; chip version %u\n",
info->fix.id, info->fix.smem_len >> 20, tmp); info->fix.id, info->fix.smem_len >> 20, tmp);
return 0;
} }
static int imsttfb_probe(struct pci_dev *pdev, const struct pci_device_id *ent) static int imsttfb_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
...@@ -1529,10 +1530,10 @@ static int imsttfb_probe(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -1529,10 +1530,10 @@ static int imsttfb_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
if (!par->cmap_regs) if (!par->cmap_regs)
goto error; goto error;
info->pseudo_palette = par->palette; info->pseudo_palette = par->palette;
init_imstt(info); ret = init_imstt(info);
if (!ret)
pci_set_drvdata(pdev, info); pci_set_drvdata(pdev, info);
return 0; return ret;
error: error:
if (par->dc_regs) if (par->dc_regs)
......
...@@ -339,7 +339,7 @@ static int civic_setpalette(unsigned int regno, unsigned int red, ...@@ -339,7 +339,7 @@ static int civic_setpalette(unsigned int regno, unsigned int red,
{ {
unsigned long flags; unsigned long flags;
int clut_status; int clut_status;
local_irq_save(flags); local_irq_save(flags);
/* Set the register address */ /* Set the register address */
...@@ -439,7 +439,7 @@ static int macfb_setcolreg(unsigned regno, unsigned red, unsigned green, ...@@ -439,7 +439,7 @@ static int macfb_setcolreg(unsigned regno, unsigned red, unsigned green,
* (according to the entries in the `var' structure). * (according to the entries in the `var' structure).
* Return non-zero for invalid regno. * Return non-zero for invalid regno.
*/ */
if (regno >= fb_info->cmap.len) if (regno >= fb_info->cmap.len)
return 1; return 1;
...@@ -548,7 +548,7 @@ static int __init macfb_init(void) ...@@ -548,7 +548,7 @@ static int __init macfb_init(void)
return -ENODEV; return -ENODEV;
macfb_setup(option); macfb_setup(option);
if (!MACH_IS_MAC) if (!MACH_IS_MAC)
return -ENODEV; return -ENODEV;
if (mac_bi_data.id == MAC_MODEL_Q630 || if (mac_bi_data.id == MAC_MODEL_Q630 ||
...@@ -644,7 +644,7 @@ static int __init macfb_init(void) ...@@ -644,7 +644,7 @@ static int __init macfb_init(void)
err = -EINVAL; err = -EINVAL;
goto fail_unmap; goto fail_unmap;
} }
/* /*
* We take a wild guess that if the video physical address is * We take a wild guess that if the video physical address is
* in nubus slot space, that the nubus card is driving video. * in nubus slot space, that the nubus card is driving video.
...@@ -774,7 +774,7 @@ static int __init macfb_init(void) ...@@ -774,7 +774,7 @@ static int __init macfb_init(void)
civic_cmap_regs = ioremap(CIVIC_BASE, 0x1000); civic_cmap_regs = ioremap(CIVIC_BASE, 0x1000);
break; break;
/* /*
* Assorted weirdos * Assorted weirdos
* We think this may be like the LC II * We think this may be like the LC II
......
...@@ -138,7 +138,7 @@ int __init maxinefb_init(void) ...@@ -138,7 +138,7 @@ int __init maxinefb_init(void)
*(volatile unsigned char *)fboff = 0x0; *(volatile unsigned char *)fboff = 0x0;
maxinefb_fix.smem_start = fb_start; maxinefb_fix.smem_start = fb_start;
/* erase hardware cursor */ /* erase hardware cursor */
for (i = 0; i < 512; i++) { for (i = 0; i < 512; i++) {
maxinefb_ims332_write_register(IMS332_REG_CURSOR_RAM + i, maxinefb_ims332_write_register(IMS332_REG_CURSOR_RAM + i,
......
...@@ -65,7 +65,7 @@ static const struct fb_ops p9100_ops = { ...@@ -65,7 +65,7 @@ static const struct fb_ops p9100_ops = {
#define P9100_FB_OFF 0x0UL #define P9100_FB_OFF 0x0UL
/* 3 bits: 2=8bpp 3=16bpp 5=32bpp 7=24bpp */ /* 3 bits: 2=8bpp 3=16bpp 5=32bpp 7=24bpp */
#define SYS_CONFIG_PIXELSIZE_SHIFT 26 #define SYS_CONFIG_PIXELSIZE_SHIFT 26
#define SCREENPAINT_TIMECTL1_ENABLE_VIDEO 0x20 /* 0 = off, 1 = on */ #define SCREENPAINT_TIMECTL1_ENABLE_VIDEO 0x20 /* 0 = off, 1 = on */
...@@ -110,7 +110,7 @@ struct p9100_regs { ...@@ -110,7 +110,7 @@ struct p9100_regs {
u32 vram_xxx[25]; u32 vram_xxx[25];
/* Registers for IBM RGB528 Palette */ /* Registers for IBM RGB528 Palette */
u32 ramdac_cmap_wridx; u32 ramdac_cmap_wridx;
u32 ramdac_palette_data; u32 ramdac_palette_data;
u32 ramdac_pixel_mask; u32 ramdac_pixel_mask;
u32 ramdac_palette_rdaddr; u32 ramdac_palette_rdaddr;
......
...@@ -52,17 +52,17 @@ struct fb_info_platinum { ...@@ -52,17 +52,17 @@ struct fb_info_platinum {
__u8 red, green, blue; __u8 red, green, blue;
} palette[256]; } palette[256];
u32 pseudo_palette[16]; u32 pseudo_palette[16];
volatile struct cmap_regs __iomem *cmap_regs; volatile struct cmap_regs __iomem *cmap_regs;
unsigned long cmap_regs_phys; unsigned long cmap_regs_phys;
volatile struct platinum_regs __iomem *platinum_regs; volatile struct platinum_regs __iomem *platinum_regs;
unsigned long platinum_regs_phys; unsigned long platinum_regs_phys;
__u8 __iomem *frame_buffer; __u8 __iomem *frame_buffer;
volatile __u8 __iomem *base_frame_buffer; volatile __u8 __iomem *base_frame_buffer;
unsigned long frame_buffer_phys; unsigned long frame_buffer_phys;
unsigned long total_vram; unsigned long total_vram;
int clktype; int clktype;
int dactype; int dactype;
...@@ -133,7 +133,7 @@ static int platinumfb_set_par (struct fb_info *info) ...@@ -133,7 +133,7 @@ static int platinumfb_set_par (struct fb_info *info)
platinum_set_hardware(pinfo); platinum_set_hardware(pinfo);
init = platinum_reg_init[pinfo->vmode-1]; init = platinum_reg_init[pinfo->vmode-1];
if ((pinfo->vmode == VMODE_832_624_75) && (pinfo->cmode > CMODE_8)) if ((pinfo->vmode == VMODE_832_624_75) && (pinfo->cmode > CMODE_8))
offset = 0x10; offset = 0x10;
...@@ -214,7 +214,7 @@ static int platinumfb_setcolreg(u_int regno, u_int red, u_int green, u_int blue, ...@@ -214,7 +214,7 @@ static int platinumfb_setcolreg(u_int regno, u_int red, u_int green, u_int blue,
break; break;
} }
} }
return 0; return 0;
} }
...@@ -269,7 +269,7 @@ static void platinum_set_hardware(struct fb_info_platinum *pinfo) ...@@ -269,7 +269,7 @@ static void platinum_set_hardware(struct fb_info_platinum *pinfo)
struct platinum_regvals *init; struct platinum_regvals *init;
int i; int i;
int vmode, cmode; int vmode, cmode;
vmode = pinfo->vmode; vmode = pinfo->vmode;
cmode = pinfo->cmode; cmode = pinfo->cmode;
...@@ -436,7 +436,7 @@ static int read_platinum_sense(struct fb_info_platinum *info) ...@@ -436,7 +436,7 @@ static int read_platinum_sense(struct fb_info_platinum *info)
* This routine takes a user-supplied var, and picks the best vmode/cmode from it. * This routine takes a user-supplied var, and picks the best vmode/cmode from it.
* It also updates the var structure to the actual mode data obtained * It also updates the var structure to the actual mode data obtained
*/ */
static int platinum_var_to_par(struct fb_var_screeninfo *var, static int platinum_var_to_par(struct fb_var_screeninfo *var,
struct fb_info_platinum *pinfo, struct fb_info_platinum *pinfo,
int check_only) int check_only)
{ {
...@@ -478,12 +478,12 @@ static int platinum_var_to_par(struct fb_var_screeninfo *var, ...@@ -478,12 +478,12 @@ static int platinum_var_to_par(struct fb_var_screeninfo *var,
pinfo->yoffset = 0; pinfo->yoffset = 0;
pinfo->vxres = pinfo->xres; pinfo->vxres = pinfo->xres;
pinfo->vyres = pinfo->yres; pinfo->vyres = pinfo->yres;
return 0; return 0;
} }
/* /*
* Parse user specified options (`video=platinumfb:') * Parse user specified options (`video=platinumfb:')
*/ */
static int __init platinumfb_setup(char *options) static int __init platinumfb_setup(char *options)
...@@ -624,7 +624,7 @@ static int platinumfb_probe(struct platform_device* odev) ...@@ -624,7 +624,7 @@ static int platinumfb_probe(struct platform_device* odev)
break; break;
} }
dev_set_drvdata(&odev->dev, info); dev_set_drvdata(&odev->dev, info);
rc = platinum_init_fb(info); rc = platinum_init_fb(info);
if (rc != 0) { if (rc != 0) {
iounmap(pinfo->frame_buffer); iounmap(pinfo->frame_buffer);
...@@ -640,9 +640,9 @@ static void platinumfb_remove(struct platform_device* odev) ...@@ -640,9 +640,9 @@ static void platinumfb_remove(struct platform_device* odev)
{ {
struct fb_info *info = dev_get_drvdata(&odev->dev); struct fb_info *info = dev_get_drvdata(&odev->dev);
struct fb_info_platinum *pinfo = info->par; struct fb_info_platinum *pinfo = info->par;
unregister_framebuffer (info); unregister_framebuffer (info);
/* Unmap frame buffer and registers */ /* Unmap frame buffer and registers */
iounmap(pinfo->frame_buffer); iounmap(pinfo->frame_buffer);
iounmap(pinfo->platinum_regs); iounmap(pinfo->platinum_regs);
...@@ -656,7 +656,7 @@ static void platinumfb_remove(struct platform_device* odev) ...@@ -656,7 +656,7 @@ static void platinumfb_remove(struct platform_device* odev)
framebuffer_release(info); framebuffer_release(info);
} }
static struct of_device_id platinumfb_match[] = static struct of_device_id platinumfb_match[] =
{ {
{ {
.name = "platinum", .name = "platinum",
...@@ -664,7 +664,7 @@ static struct of_device_id platinumfb_match[] = ...@@ -664,7 +664,7 @@ static struct of_device_id platinumfb_match[] =
{}, {},
}; };
static struct platform_driver platinum_driver = static struct platform_driver platinum_driver =
{ {
.driver = { .driver = {
.name = "platinumfb", .name = "platinumfb",
......
...@@ -57,14 +57,14 @@ ...@@ -57,14 +57,14 @@
* - Driver appears to be working for Brutus 320x200x8bpp mode. Other * - Driver appears to be working for Brutus 320x200x8bpp mode. Other
* resolutions are working, but only the 8bpp mode is supported. * resolutions are working, but only the 8bpp mode is supported.
* Changes need to be made to the palette encode and decode routines * Changes need to be made to the palette encode and decode routines
* to support 4 and 16 bpp modes. * to support 4 and 16 bpp modes.
* Driver is not designed to be a module. The FrameBuffer is statically * Driver is not designed to be a module. The FrameBuffer is statically
* allocated since dynamic allocation of a 300k buffer cannot be * allocated since dynamic allocation of a 300k buffer cannot be
* guaranteed. * guaranteed.
* *
* 1999/06/17: * 1999/06/17:
* - FrameBuffer memory is now allocated at run-time when the * - FrameBuffer memory is now allocated at run-time when the
* driver is initialized. * driver is initialized.
* *
* 2000/04/10: Nicolas Pitre <nico@fluxnic.net> * 2000/04/10: Nicolas Pitre <nico@fluxnic.net>
* - Big cleanup for dynamic selection of machine type at run time. * - Big cleanup for dynamic selection of machine type at run time.
...@@ -74,8 +74,8 @@ ...@@ -74,8 +74,8 @@
* *
* 2000/08/07: Tak-Shing Chan <tchan.rd@idthk.com> * 2000/08/07: Tak-Shing Chan <tchan.rd@idthk.com>
* Jeff Sutherland <jsutherland@accelent.com> * Jeff Sutherland <jsutherland@accelent.com>
* - Resolved an issue caused by a change made to the Assabet's PLD * - Resolved an issue caused by a change made to the Assabet's PLD
* earlier this year which broke the framebuffer driver for newer * earlier this year which broke the framebuffer driver for newer
* Phase 4 Assabets. Some other parameters were changed to optimize * Phase 4 Assabets. Some other parameters were changed to optimize
* for the Sharp display. * for the Sharp display.
* *
...@@ -102,7 +102,7 @@ ...@@ -102,7 +102,7 @@
* 2000/11/23: Eric Peng <ericpeng@coventive.com> * 2000/11/23: Eric Peng <ericpeng@coventive.com>
* - Freebird add * - Freebird add
* *
* 2001/02/07: Jamey Hicks <jamey.hicks@compaq.com> * 2001/02/07: Jamey Hicks <jamey.hicks@compaq.com>
* Cliff Brake <cbrake@accelent.com> * Cliff Brake <cbrake@accelent.com>
* - Added PM callback * - Added PM callback
* *
...@@ -500,7 +500,7 @@ sa1100fb_set_cmap(struct fb_cmap *cmap, int kspc, int con, ...@@ -500,7 +500,7 @@ sa1100fb_set_cmap(struct fb_cmap *cmap, int kspc, int con,
* the shortest recovery time * the shortest recovery time
* Suspend * Suspend
* This refers to a level of power management in which substantial power * This refers to a level of power management in which substantial power
* reduction is achieved by the display. The display can have a longer * reduction is achieved by the display. The display can have a longer
* recovery time from this state than from the Stand-by state * recovery time from this state than from the Stand-by state
* Off * Off
* This indicates that the display is consuming the lowest level of power * This indicates that the display is consuming the lowest level of power
...@@ -522,9 +522,9 @@ sa1100fb_set_cmap(struct fb_cmap *cmap, int kspc, int con, ...@@ -522,9 +522,9 @@ sa1100fb_set_cmap(struct fb_cmap *cmap, int kspc, int con,
*/ */
/* /*
* sa1100fb_blank(): * sa1100fb_blank():
* Blank the display by setting all palette values to zero. Note, the * Blank the display by setting all palette values to zero. Note, the
* 12 and 16 bpp modes don't really use the palette, so this will not * 12 and 16 bpp modes don't really use the palette, so this will not
* blank the display in all modes. * blank the display in all modes.
*/ */
static int sa1100fb_blank(int blank, struct fb_info *info) static int sa1100fb_blank(int blank, struct fb_info *info)
{ {
...@@ -603,8 +603,8 @@ static inline unsigned int get_pcd(struct sa1100fb_info *fbi, ...@@ -603,8 +603,8 @@ static inline unsigned int get_pcd(struct sa1100fb_info *fbi,
/* /*
* sa1100fb_activate_var(): * sa1100fb_activate_var():
* Configures LCD Controller based on entries in var parameter. Settings are * Configures LCD Controller based on entries in var parameter. Settings are
* only written to the controller if changes were made. * only written to the controller if changes were made.
*/ */
static int sa1100fb_activate_var(struct fb_var_screeninfo *var, struct sa1100fb_info *fbi) static int sa1100fb_activate_var(struct fb_var_screeninfo *var, struct sa1100fb_info *fbi)
{ {
...@@ -747,7 +747,7 @@ static void sa1100fb_setup_gpio(struct sa1100fb_info *fbi) ...@@ -747,7 +747,7 @@ static void sa1100fb_setup_gpio(struct sa1100fb_info *fbi)
* *
* SA1110 spec update nr. 25 says we can and should * SA1110 spec update nr. 25 says we can and should
* clear LDD15 to 12 for 4 or 8bpp modes with active * clear LDD15 to 12 for 4 or 8bpp modes with active
* panels. * panels.
*/ */
if ((fbi->reg_lccr0 & LCCR0_CMS) == LCCR0_Color && if ((fbi->reg_lccr0 & LCCR0_CMS) == LCCR0_Color &&
(fbi->reg_lccr0 & (LCCR0_Dual|LCCR0_Act)) != 0) { (fbi->reg_lccr0 & (LCCR0_Dual|LCCR0_Act)) != 0) {
...@@ -1020,9 +1020,9 @@ static int sa1100fb_resume(struct platform_device *dev) ...@@ -1020,9 +1020,9 @@ static int sa1100fb_resume(struct platform_device *dev)
/* /*
* sa1100fb_map_video_memory(): * sa1100fb_map_video_memory():
* Allocates the DRAM memory for the frame buffer. This buffer is * Allocates the DRAM memory for the frame buffer. This buffer is
* remapped into a non-cached, non-buffered, memory region to * remapped into a non-cached, non-buffered, memory region to
* allow palette and pixel writes to occur without flushing the * allow palette and pixel writes to occur without flushing the
* cache. Once this area is remapped, all virtual memory * cache. Once this area is remapped, all virtual memory
* access to the video memory should occur at the new region. * access to the video memory should occur at the new region.
*/ */
......
This diff is collapsed.
/* /*
* valkyriefb.c -- frame buffer device for the PowerMac 'valkyrie' display * valkyriefb.c -- frame buffer device for the PowerMac 'valkyrie' display
* *
* Created 8 August 1998 by * Created 8 August 1998 by
* Martin Costabel <costabel@wanadoo.fr> and Kevin Schoedel * Martin Costabel <costabel@wanadoo.fr> and Kevin Schoedel
* *
* Vmode-switching changes and vmode 15/17 modifications created 29 August * Vmode-switching changes and vmode 15/17 modifications created 29 August
...@@ -77,13 +77,13 @@ struct fb_info_valkyrie { ...@@ -77,13 +77,13 @@ struct fb_info_valkyrie {
struct fb_par_valkyrie par; struct fb_par_valkyrie par;
struct cmap_regs __iomem *cmap_regs; struct cmap_regs __iomem *cmap_regs;
unsigned long cmap_regs_phys; unsigned long cmap_regs_phys;
struct valkyrie_regs __iomem *valkyrie_regs; struct valkyrie_regs __iomem *valkyrie_regs;
unsigned long valkyrie_regs_phys; unsigned long valkyrie_regs_phys;
__u8 __iomem *frame_buffer; __u8 __iomem *frame_buffer;
unsigned long frame_buffer_phys; unsigned long frame_buffer_phys;
int sense; int sense;
unsigned long total_vram; unsigned long total_vram;
...@@ -244,7 +244,7 @@ static inline int valkyrie_vram_reqd(int video_mode, int color_mode) ...@@ -244,7 +244,7 @@ static inline int valkyrie_vram_reqd(int video_mode, int color_mode)
{ {
int pitch; int pitch;
struct valkyrie_regvals *init = valkyrie_reg_init[video_mode-1]; struct valkyrie_regvals *init = valkyrie_reg_init[video_mode-1];
if ((pitch = init->pitch[color_mode]) == 0) if ((pitch = init->pitch[color_mode]) == 0)
pitch = 2 * init->pitch[0]; pitch = 2 * init->pitch[0];
return init->vres * pitch; return init->vres * pitch;
...@@ -467,7 +467,7 @@ static int valkyrie_var_to_par(struct fb_var_screeninfo *var, ...@@ -467,7 +467,7 @@ static int valkyrie_var_to_par(struct fb_var_screeninfo *var,
printk(KERN_ERR "valkyriefb: vmode %d not valid.\n", vmode); printk(KERN_ERR "valkyriefb: vmode %d not valid.\n", vmode);
return -EINVAL; return -EINVAL;
} }
if (cmode != CMODE_8 && cmode != CMODE_16) { if (cmode != CMODE_8 && cmode != CMODE_16) {
printk(KERN_ERR "valkyriefb: cmode %d not valid.\n", cmode); printk(KERN_ERR "valkyriefb: cmode %d not valid.\n", cmode);
return -EINVAL; return -EINVAL;
...@@ -516,7 +516,7 @@ static void valkyrie_init_fix(struct fb_fix_screeninfo *fix, struct fb_info_valk ...@@ -516,7 +516,7 @@ static void valkyrie_init_fix(struct fb_fix_screeninfo *fix, struct fb_info_valk
fix->ywrapstep = 0; fix->ywrapstep = 0;
fix->ypanstep = 0; fix->ypanstep = 0;
fix->xpanstep = 0; fix->xpanstep = 0;
} }
/* Fix must already be inited above */ /* Fix must already be inited above */
......
...@@ -111,7 +111,7 @@ static u_long get_line_length(int xres_virtual, int bpp) ...@@ -111,7 +111,7 @@ static u_long get_line_length(int xres_virtual, int bpp)
* First part, xxxfb_check_var, must not write anything * First part, xxxfb_check_var, must not write anything
* to hardware, it should only verify and adjust var. * to hardware, it should only verify and adjust var.
* This means it doesn't alter par but it does use hardware * This means it doesn't alter par but it does use hardware
* data from it to check this var. * data from it to check this var.
*/ */
static int vfb_check_var(struct fb_var_screeninfo *var, static int vfb_check_var(struct fb_var_screeninfo *var,
...@@ -169,7 +169,7 @@ static int vfb_check_var(struct fb_var_screeninfo *var, ...@@ -169,7 +169,7 @@ static int vfb_check_var(struct fb_var_screeninfo *var,
/* /*
* Now that we checked it we alter var. The reason being is that the video * Now that we checked it we alter var. The reason being is that the video
* mode passed in might not work but slight changes to it might make it * mode passed in might not work but slight changes to it might make it
* work. This way we let the user know what is acceptable. * work. This way we let the user know what is acceptable.
*/ */
switch (var->bits_per_pixel) { switch (var->bits_per_pixel) {
...@@ -235,8 +235,8 @@ static int vfb_check_var(struct fb_var_screeninfo *var, ...@@ -235,8 +235,8 @@ static int vfb_check_var(struct fb_var_screeninfo *var,
} }
/* This routine actually sets the video mode. It's in here where we /* This routine actually sets the video mode. It's in here where we
* the hardware state info->par and fix which can be affected by the * the hardware state info->par and fix which can be affected by the
* change in par. For this driver it doesn't do much. * change in par. For this driver it doesn't do much.
*/ */
static int vfb_set_par(struct fb_info *info) static int vfb_set_par(struct fb_info *info)
{ {
...@@ -379,7 +379,7 @@ static int vfb_pan_display(struct fb_var_screeninfo *var, ...@@ -379,7 +379,7 @@ static int vfb_pan_display(struct fb_var_screeninfo *var,
} }
/* /*
* Most drivers don't need their own mmap function * Most drivers don't need their own mmap function
*/ */
static int vfb_mmap(struct fb_info *info, static int vfb_mmap(struct fb_info *info,
......
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