History

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()

Linus Torvalds committed 3 years ago

Commit adfbf652 parents 046206b 0bdf1ad18 files · +202 −192Browse files

Unified · Split

18 files
  1. drivers/video/fbdev/68328fb.c +6 −6
  2. drivers/video/fbdev/arcfb.c +9 −6
  3. drivers/video/fbdev/atmel_lcdfb.c +1 −1
  4. drivers/video/fbdev/cg14.c +1 −1
  5. drivers/video/fbdev/controlfb.c +17 −17
  6. drivers/video/fbdev/core/modedb.c +5 −0
  7. drivers/video/fbdev/g364fb.c +3 −3
  8. drivers/video/fbdev/hgafb.c +18 −18
  9. drivers/video/fbdev/hpfb.c +4 −4
  10. drivers/video/fbdev/imsttfb.c +8 −7
  11. drivers/video/fbdev/macfb.c +5 −5
  12. drivers/video/fbdev/maxinefb.c +1 −1
  13. drivers/video/fbdev/p9100.c +2 −2
  14. drivers/video/fbdev/platinumfb.c +15 −15
  15. drivers/video/fbdev/sa1100fb.c +16 −16
  16. drivers/video/fbdev/stifb.c +79 −78
  17. drivers/video/fbdev/valkyriefb.c +7 −7
  18. drivers/video/fbdev/vfb.c +5 −5
drivers/video/fbdev/68328fb.c+6−6
@@ -124,7 +124,7 @@ static u_long get_line_length(int xres_virtual, int bpp) · 123 unmodified lines
124 * First part, xxxfb_check_var, must not write anything124 * First part, xxxfb_check_var, must not write anything
125 * to hardware, it should only verify and adjust var.125 * to hardware, it should only verify and adjust var.
126 * This means it doesn't alter par but it does use hardware126 * This means it doesn't alter par but it does use hardware
127 * data from it to check this var. 127 * data from it to check this var.
128 */128 */
129 129
130static int mc68x328fb_check_var(struct fb_var_screeninfo *var,130static int mc68x328fb_check_var(struct fb_var_screeninfo *var,
@@ -182,7 +182,7 @@ static int mc68x328fb_check_var(struct fb_var_screeninfo *var, · 51 unmodified lines
182 182
183 /*183 /*
184 * Now that we checked it we alter var. The reason being is that the video184 * Now that we checked it we alter var. The reason being is that the video
185 * mode passed in might not work but slight changes to it might make it 185 * mode passed in might not work but slight changes to it might make it
186 * work. This way we let the user know what is acceptable.186 * work. This way we let the user know what is acceptable.
187 */187 */
188 switch (var->bits_per_pixel) {188 switch (var->bits_per_pixel) {
@@ -257,8 +257,8 @@ static int mc68x328fb_check_var(struct fb_var_screeninfo *var, · 68 unmodified lines
257}257}
258 258
259/* This routine actually sets the video mode. It's in here where we259/* This routine actually sets the video mode. It's in here where we
260 * the hardware state info->par and fix which can be affected by the 260 * the hardware state info->par and fix which can be affected by the
261 * change in par. For this driver it doesn't do much. 261 * change in par. For this driver it doesn't do much.
262 */262 */
263static int mc68x328fb_set_par(struct fb_info *info)263static int mc68x328fb_set_par(struct fb_info *info)
264{264{
@@ -295,7 +295,7 @@ static int mc68x328fb_setcolreg(u_int regno, u_int red, u_int green, u_int blue, · 30 unmodified lines
295 * {hardwarespecific} contains width of RAMDAC295 * {hardwarespecific} contains width of RAMDAC
296 * cmap[X] is programmed to (X << red.offset) | (X << green.offset) | (X << blue.offset)296 * cmap[X] is programmed to (X << red.offset) | (X << green.offset) | (X << blue.offset)
297 * RAMDAC[X] is programmed to (red, green, blue)297 * RAMDAC[X] is programmed to (red, green, blue)
298 * 298 *
299 * Pseudocolor:299 * Pseudocolor:
300 * uses offset = 0 && length = RAMDAC register width.300 * uses offset = 0 && length = RAMDAC register width.
301 * var->{color}.offset is 0301 * var->{color}.offset is 0
@@ -384,7 +384,7 @@ static int mc68x328fb_pan_display(struct fb_var_screeninfo *var, · 82 unmodified lines
384}384}
385 385
386 /*386 /*
387 * Most drivers don't need their own mmap function 387 * Most drivers don't need their own mmap function
388 */388 */
389 389
390static int mc68x328fb_mmap(struct fb_info *info, struct vm_area_struct *vma)390static int mc68x328fb_mmap(struct fb_info *info, struct vm_area_struct *vma)
drivers/video/fbdev/arcfb.c+9−6
@@ -523,7 +523,7 @@ static int arcfb_probe(struct platform_device *dev) · 522 unmodified lines
523 523
524 info = framebuffer_alloc(sizeof(struct arcfb_par), &dev->dev);524 info = framebuffer_alloc(sizeof(struct arcfb_par), &dev->dev);
525 if (!info)525 if (!info)
526 goto err;526 goto err_fb_alloc;
527 527
528 info->screen_base = (char __iomem *)videomemory;528 info->screen_base = (char __iomem *)videomemory;
529 info->fbops = &arcfb_ops;529 info->fbops = &arcfb_ops;
@@ -535,7 +535,7 @@ static int arcfb_probe(struct platform_device *dev) · 5 unmodified lines
535 535
536 if (!dio_addr || !cio_addr || !c2io_addr) {536 if (!dio_addr || !cio_addr || !c2io_addr) {
537 printk(KERN_WARNING "no IO addresses supplied\n");537 printk(KERN_WARNING "no IO addresses supplied\n");
538 goto err1;538 goto err_addr;
539 }539 }
540 par->dio_addr = dio_addr;540 par->dio_addr = dio_addr;
541 par->cio_addr = cio_addr;541 par->cio_addr = cio_addr;
@@ -551,12 +551,12 @@ static int arcfb_probe(struct platform_device *dev) · 9 unmodified lines
551 printk(KERN_INFO551 printk(KERN_INFO
552 "arcfb: Failed req IRQ %d\n", par->irq);552 "arcfb: Failed req IRQ %d\n", par->irq);
553 retval = -EBUSY;553 retval = -EBUSY;
554 goto err1;554 goto err_addr;
555 }555 }
556 }556 }
557 retval = register_framebuffer(info);557 retval = register_framebuffer(info);
558 if (retval < 0)558 if (retval < 0)
559 goto err1;559 goto err_register_fb;
560 platform_set_drvdata(dev, info);560 platform_set_drvdata(dev, info);
561 fb_info(info, "Arc frame buffer device, using %dK of video memory\n",561 fb_info(info, "Arc frame buffer device, using %dK of video memory\n",
562 videomemorysize >> 10);562 videomemorysize >> 10);
@@ -580,9 +580,12 @@ static int arcfb_probe(struct platform_device *dev) · 17 unmodified lines
580 }580 }
581 581
582 return 0;582 return 0;
583err1:583
584err_register_fb:
585 free_irq(par->irq, info);
586err_addr:
584 framebuffer_release(info);587 framebuffer_release(info);
585err:588err_fb_alloc:
586 vfree(videomemory);589 vfree(videomemory);
587 return retval;590 return retval;
588}591}
drivers/video/fbdev/atmel_lcdfb.c+1−1
@@ -317,7 +317,7 @@ static inline void atmel_lcdfb_free_video_memory(struct atmel_lcdfb_info *sinfo) · 316 unmodified lines
317/**317/**
318 * atmel_lcdfb_alloc_video_memory - Allocate framebuffer memory318 * atmel_lcdfb_alloc_video_memory - Allocate framebuffer memory
319 * @sinfo: the frame buffer to allocate memory for319 * @sinfo: the frame buffer to allocate memory for
320 * 320 *
321 * This function is called only from the atmel_lcdfb_probe()321 * This function is called only from the atmel_lcdfb_probe()
322 * so no locking by fb_info->mm_lock around smem_len setting is needed.322 * so no locking by fb_info->mm_lock around smem_len setting is needed.
323 */323 */
drivers/video/fbdev/cg14.c+1−1
@@ -512,7 +512,7 @@ static int cg14_probe(struct platform_device *op) · 511 unmodified lines
512 is_8mb = (resource_size(&op->resource[1]) == (8 * 1024 * 1024));512 is_8mb = (resource_size(&op->resource[1]) == (8 * 1024 * 1024));
513 513
514 BUILD_BUG_ON(sizeof(par->mmap_map) != sizeof(__cg14_mmap_map));514 BUILD_BUG_ON(sizeof(par->mmap_map) != sizeof(__cg14_mmap_map));
515 515
516 memcpy(&par->mmap_map, &__cg14_mmap_map, sizeof(par->mmap_map));516 memcpy(&par->mmap_map, &__cg14_mmap_map, sizeof(par->mmap_map));
517 517
518 for (i = 0; i < CG14_MMAP_ENTRIES; i++) {518 for (i = 0; i < CG14_MMAP_ENTRIES; i++) {
drivers/video/fbdev/controlfb.c+17−17
@@ -113,14 +113,14 @@ struct fb_info_control { · 112 unmodified lines
113 struct fb_info info;113 struct fb_info info;
114 struct fb_par_control par;114 struct fb_par_control par;
115 u32 pseudo_palette[16];115 u32 pseudo_palette[16];
116 116
117 struct cmap_regs __iomem *cmap_regs;117 struct cmap_regs __iomem *cmap_regs;
118 unsigned long cmap_regs_phys;118 unsigned long cmap_regs_phys;
119 119
120 struct control_regs __iomem *control_regs;120 struct control_regs __iomem *control_regs;
121 unsigned long control_regs_phys;121 unsigned long control_regs_phys;
122 unsigned long control_regs_size;122 unsigned long control_regs_size;
123 123
124 __u8 __iomem *frame_buffer;124 __u8 __iomem *frame_buffer;
125 unsigned long frame_buffer_phys;125 unsigned long frame_buffer_phys;
126 unsigned long fb_orig_base;126 unsigned long fb_orig_base;
@@ -196,7 +196,7 @@ static void set_control_clock(unsigned char *params) · 69 unmodified lines
196 while (!req.complete)196 while (!req.complete)
197 cuda_poll();197 cuda_poll();
198 }198 }
199#endif 199#endif
200}200}
201 201
202/*202/*
@@ -233,19 +233,19 @@ static void control_set_hardware(struct fb_info_control *p, struct fb_par_contro · 30 unmodified lines
233 if (p->par.xoffset != par->xoffset ||233 if (p->par.xoffset != par->xoffset ||
234 p->par.yoffset != par->yoffset)234 p->par.yoffset != par->yoffset)
235 set_screen_start(par->xoffset, par->yoffset, p);235 set_screen_start(par->xoffset, par->yoffset, p);
236 236
237 return;237 return;
238 }238 }
239 239
240 p->par = *par;240 p->par = *par;
241 cmode = p->par.cmode;241 cmode = p->par.cmode;
242 r = &par->regvals;242 r = &par->regvals;
243 243
244 /* Turn off display */244 /* Turn off display */
245 out_le32(CNTRL_REG(p,ctrl), 0x400 | par->ctrl);245 out_le32(CNTRL_REG(p,ctrl), 0x400 | par->ctrl);
246 246
247 set_control_clock(r->clock_params);247 set_control_clock(r->clock_params);
248 248
249 RADACAL_WRITE(0x20, r->radacal_ctrl);249 RADACAL_WRITE(0x20, r->radacal_ctrl);
250 RADACAL_WRITE(0x21, p->control_use_bank2 ? 0 : 1);250 RADACAL_WRITE(0x21, p->control_use_bank2 ? 0 : 1);
251 RADACAL_WRITE(0x10, 0);251 RADACAL_WRITE(0x10, 0);
@@ -254,7 +254,7 @@ static void control_set_hardware(struct fb_info_control *p, struct fb_par_contro · 2 unmodified lines
254 rp = &p->control_regs->vswin;254 rp = &p->control_regs->vswin;
255 for (i = 0; i < 16; ++i, ++rp)255 for (i = 0; i < 16; ++i, ++rp)
256 out_le32(&rp->r, r->regs[i]);256 out_le32(&rp->r, r->regs[i]);
257 257
258 out_le32(CNTRL_REG(p,pitch), par->pitch);258 out_le32(CNTRL_REG(p,pitch), par->pitch);
259 out_le32(CNTRL_REG(p,mode), r->mode);259 out_le32(CNTRL_REG(p,mode), r->mode);
260 out_le32(CNTRL_REG(p,vram_attr), p->vram_attr);260 out_le32(CNTRL_REG(p,vram_attr), p->vram_attr);
@@ -366,7 +366,7 @@ static int read_control_sense(struct fb_info_control *p) · 105 unmodified lines
366 sense |= (in_le32(CNTRL_REG(p,mon_sense)) & 0x180) >> 7;366 sense |= (in_le32(CNTRL_REG(p,mon_sense)) & 0x180) >> 7;
367 367
368 out_le32(CNTRL_REG(p,mon_sense), 077); /* turn off drivers */368 out_le32(CNTRL_REG(p,mon_sense), 077); /* turn off drivers */
369 369
370 return sense;370 return sense;
371}371}
372 372
@@ -558,9 +558,9 @@ static int control_var_to_par(struct fb_var_screeninfo *var, · 185 unmodified lines
558static void control_par_to_var(struct fb_par_control *par, struct fb_var_screeninfo *var)558static void control_par_to_var(struct fb_par_control *par, struct fb_var_screeninfo *var)
559{559{
560 struct control_regints *rv;560 struct control_regints *rv;
561 561
562 rv = (struct control_regints *) par->regvals.regs;562 rv = (struct control_regints *) par->regvals.regs;
563 563
564 memset(var, 0, sizeof(*var));564 memset(var, 0, sizeof(*var));
565 var->xres = par->xres;565 var->xres = par->xres;
566 var->yres = par->yres;566 var->yres = par->yres;
@@ -568,7 +568,7 @@ static void control_par_to_var(struct fb_par_control *par, struct fb_var_screeni · 1 unmodified line
568 var->yres_virtual = par->vyres;568 var->yres_virtual = par->vyres;
569 var->xoffset = par->xoffset;569 var->xoffset = par->xoffset;
570 var->yoffset = par->yoffset;570 var->yoffset = par->yoffset;
571 571
572 switch(par->cmode) {572 switch(par->cmode) {
573 default:573 default:
574 case CMODE_8:574 case CMODE_8:
@@ -634,7 +634,7 @@ static int controlfb_check_var (struct fb_var_screeninfo *var, struct fb_info *i · 59 unmodified lines
634 634
635 err = control_var_to_par(var, &par, info);635 err = control_var_to_par(var, &par, info);
636 if (err)636 if (err)
637 return err; 637 return err;
638 control_par_to_var(&par, var);638 control_par_to_var(&par, var);
639 639
640 return 0;640 return 0;
@@ -655,7 +655,7 @@ static int controlfb_set_par (struct fb_info *info) · 14 unmodified lines
655 " control_var_to_par: %d.\n", err);655 " control_var_to_par: %d.\n", err);
656 return err;656 return err;
657 }657 }
658 658
659 control_set_hardware(p, &par);659 control_set_hardware(p, &par);
660 660
661 info->fix.visual = (p->par.cmode == CMODE_8) ?661 info->fix.visual = (p->par.cmode == CMODE_8) ?
@@ -840,7 +840,7 @@ static int __init init_control(struct fb_info_control *p) · 178 unmodified lines
840 int full, sense, vmode, cmode, vyres;840 int full, sense, vmode, cmode, vyres;
841 struct fb_var_screeninfo var;841 struct fb_var_screeninfo var;
842 int rc;842 int rc;
843 843
844 printk(KERN_INFO "controlfb: ");844 printk(KERN_INFO "controlfb: ");
845 845
846 full = p->total_vram == 0x400000;846 full = p->total_vram == 0x400000;
drivers/video/fbdev/core/modedb.c+5−0
@@ -257,6 +257,11 @@ static const struct fb_videomode modedb[] = { · 256 unmodified lines
257 { NULL, 72, 480, 300, 33386, 40, 24, 11, 19, 80, 3, 0,257 { NULL, 72, 480, 300, 33386, 40, 24, 11, 19, 80, 3, 0,
258 FB_VMODE_DOUBLE },258 FB_VMODE_DOUBLE },
259 259
260 /* 1920x1080 @ 60 Hz, 67.3 kHz hsync */
261 { NULL, 60, 1920, 1080, 6734, 148, 88, 36, 4, 44, 5, 0,
262 FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
263 FB_VMODE_NONINTERLACED },
264
260 /* 1920x1200 @ 60 Hz, 74.5 Khz hsync */265 /* 1920x1200 @ 60 Hz, 74.5 Khz hsync */
261 { NULL, 60, 1920, 1200, 5177, 128, 336, 1, 38, 208, 3,266 { NULL, 60, 1920, 1200, 5177, 128, 336, 1, 38, 208, 3,
262 FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,267 FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
drivers/video/fbdev/g364fb.c+3−3
@@ -6,7 +6,7 @@ · 5 unmodified lines
6 *6 *
7 * This driver is based on tgafb.c7 * This driver is based on tgafb.c
8 *8 *
9 * Copyright (C) 1997 Geert Uytterhoeven 9 * Copyright (C) 1997 Geert Uytterhoeven
10 * Copyright (C) 1995 Jay Estabrook10 * Copyright (C) 1995 Jay Estabrook
11 *11 *
12 * This file is subject to the terms and conditions of the GNU General Public12 * This file is subject to the terms and conditions of the GNU General Public
@@ -28,7 +28,7 @@ · 15 unmodified lines
28#include <asm/io.h>28#include <asm/io.h>
29#include <asm/jazz.h>29#include <asm/jazz.h>
30 30
31/* 31/*
32 * Various defines for the G36432 * Various defines for the G364
33 */33 */
34#define G364_MEM_BASE 0xe440000034#define G364_MEM_BASE 0xe4400000
@@ -125,7 +125,7 @@ static const struct fb_ops g364fb_ops = { · 90 unmodified lines
125 *125 *
126 * This call looks only at xoffset, yoffset and the FB_VMODE_YWRAP flag126 * This call looks only at xoffset, yoffset and the FB_VMODE_YWRAP flag
127 */127 */
128static int g364fb_pan_display(struct fb_var_screeninfo *var, 128static int g364fb_pan_display(struct fb_var_screeninfo *var,
129 struct fb_info *info)129 struct fb_info *info)
130{130{
131 if (var->xoffset ||131 if (var->xoffset ||
drivers/video/fbdev/hgafb.c+18−18
@@ -1,6 +1,6 @@
1/*1/*
2 * linux/drivers/video/hgafb.c -- Hercules graphics adaptor frame buffer device2 * linux/drivers/video/hgafb.c -- Hercules graphics adaptor frame buffer device
3 * 3 *
4 * Created 25 Nov 1999 by Ferenc Bakonyi (fero@drama.obuda.kando.hu)4 * Created 25 Nov 1999 by Ferenc Bakonyi (fero@drama.obuda.kando.hu)
5 * Based on skeletonfb.c by Geert Uytterhoeven and5 * Based on skeletonfb.c by Geert Uytterhoeven and
6 * mdacon.c by Andrew Apted6 * mdacon.c by Andrew Apted
@@ -8,14 +8,14 @@ · 1 unmodified line
8 * History:8 * History:
9 *9 *
10 * - Revision 0.1.8 (23 Oct 2002): Ported to new framebuffer api.10 * - Revision 0.1.8 (23 Oct 2002): Ported to new framebuffer api.
11 * 11 *
12 * - Revision 0.1.7 (23 Jan 2001): fix crash resulting from MDA only cards 12 * - Revision 0.1.7 (23 Jan 2001): fix crash resulting from MDA only cards
13 * being detected as Hercules. (Paul G.)13 * being detected as Hercules. (Paul G.)
14 * - Revision 0.1.6 (17 Aug 2000): new style structs14 * - Revision 0.1.6 (17 Aug 2000): new style structs
15 * documentation15 * documentation
16 * - Revision 0.1.5 (13 Mar 2000): spinlocks instead of saveflags();cli();etc16 * - Revision 0.1.5 (13 Mar 2000): spinlocks instead of saveflags();cli();etc
17 * minor fixes17 * minor fixes
18 * - Revision 0.1.4 (24 Jan 2000): fixed a bug in hga_card_detect() for 18 * - Revision 0.1.4 (24 Jan 2000): fixed a bug in hga_card_detect() for
19 * HGA-only systems19 * HGA-only systems
20 * - Revision 0.1.3 (22 Jan 2000): modified for the new fb_info structure20 * - Revision 0.1.3 (22 Jan 2000): modified for the new fb_info structure
21 * screen is cleared after rmmod21 * screen is cleared after rmmod
@@ -143,7 +143,7 @@ static bool nologo = 0; · 121 unmodified lines
143 143
144static void write_hga_b(unsigned int val, unsigned char reg)144static void write_hga_b(unsigned int val, unsigned char reg)
145{145{
146 outb_p(reg, HGA_INDEX_PORT); 146 outb_p(reg, HGA_INDEX_PORT);
147 outb_p(val, HGA_VALUE_PORT);147 outb_p(val, HGA_VALUE_PORT);
148}148}
149 149
@@ -155,7 +155,7 @@ static void write_hga_w(unsigned int val, unsigned char reg) · 5 unmodified lines
155 155
156static int test_hga_b(unsigned char val, unsigned char reg)156static int test_hga_b(unsigned char val, unsigned char reg)
157{157{
158 outb_p(reg, HGA_INDEX_PORT); 158 outb_p(reg, HGA_INDEX_PORT);
159 outb (val, HGA_VALUE_PORT);159 outb (val, HGA_VALUE_PORT);
160 udelay(20); val = (inb_p(HGA_VALUE_PORT) == val);160 udelay(20); val = (inb_p(HGA_VALUE_PORT) == val);
161 return val;161 return val;
@@ -244,7 +244,7 @@ static void hga_show_logo(struct fb_info *info) · 82 unmodified lines
244 void __iomem *dest = hga_vram;244 void __iomem *dest = hga_vram;
245 char *logo = linux_logo_bw;245 char *logo = linux_logo_bw;
246 int x, y;246 int x, y;
247 247
248 for (y = 134; y < 134 + 80 ; y++) * this needs some cleanup *248 for (y = 134; y < 134 + 80 ; y++) * this needs some cleanup *
249 for (x = 0; x < 10 ; x++)249 for (x = 0; x < 10 ; x++)
250 writeb(~*(logo++),(dest + HGA_ROWADDR(y) + x + 40));250 writeb(~*(logo++),(dest + HGA_ROWADDR(y) + x + 40));
@@ -255,7 +255,7 @@ static void hga_pan(unsigned int xoffset, unsigned int yoffset) · 4 unmodified lines
255{255{
256 unsigned int base;256 unsigned int base;
257 unsigned long flags;257 unsigned long flags;
258 258
259 base = (yoffset / 8) * 90 + xoffset;259 base = (yoffset / 8) * 90 + xoffset;
260 spin_lock_irqsave(&hga_reg_lock, flags);260 spin_lock_irqsave(&hga_reg_lock, flags);
261 write_hga_w(base, 0x0c); /* start address */261 write_hga_w(base, 0x0c); /* start address */
@@ -310,7 +310,7 @@ static int hga_card_detect(void) · 48 unmodified lines
310 /* Ok, there is definitely a card registering at the correct310 /* Ok, there is definitely a card registering at the correct
311 * memory location, so now we do an I/O port test.311 * memory location, so now we do an I/O port test.
312 */312 */
313 313
314 if (!test_hga_b(0x66, 0x0f)) /* cursor low register */314 if (!test_hga_b(0x66, 0x0f)) /* cursor low register */
315 goto error;315 goto error;
316 316
@@ -321,7 +321,7 @@ static int hga_card_detect(void) · 4 unmodified lines
321 * bit of the status register is changing. This test lasts for321 * bit of the status register is changing. This test lasts for
322 * approximately 1/10th of a second.322 * approximately 1/10th of a second.
323 */323 */
324 324
325 p_save = q_save = inb_p(HGA_STATUS_PORT) & HGA_STATUS_VSYNC;325 p_save = q_save = inb_p(HGA_STATUS_PORT) & HGA_STATUS_VSYNC;
326 326
327 for (count=0; count < 50000 && p_save == q_save; count++) {327 for (count=0; count < 50000 && p_save == q_save; count++) {
@@ -329,7 +329,7 @@ static int hga_card_detect(void) · 1 unmodified line
329 udelay(2);329 udelay(2);
330 }330 }
331 331
332 if (p_save == q_save) 332 if (p_save == q_save)
333 goto error;333 goto error;
334 334
335 switch (inb_p(HGA_STATUS_PORT) & 0x70) {335 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, · 79 unmodified lines
415 * @info:pointer to fb_info object containing info for current hga board415 * @info:pointer to fb_info object containing info for current hga board
416 *416 *
417 * This function looks only at xoffset, yoffset and the %FB_VMODE_YWRAP417 * This function looks only at xoffset, yoffset and the %FB_VMODE_YWRAP
418 * flag in @var. If input parameters are correct it calls hga_pan() to 418 * flag in @var. If input parameters are correct it calls hga_pan() to
419 * program the hardware. @info->var is updated to the new values.419 * program the hardware. @info->var is updated to the new values.
420 * A zero is returned on success and %-EINVAL for failure.420 * A zero is returned on success and %-EINVAL for failure.
421 */421 */
@@ -442,9 +442,9 @@ static int hgafb_pan_display(struct fb_var_screeninfo *var, · 20 unmodified lines
442 * hgafb_blank - (un)blank the screen442 * hgafb_blank - (un)blank the screen
443 * @blank_mode:blanking method to use443 * @blank_mode:blanking method to use
444 * @info:unused444 * @info:unused
445 * 445 *
446 * Blank the screen if blank_mode != 0, else unblank. 446 * Blank the screen if blank_mode != 0, else unblank.
447 * Implements VESA suspend and powerdown modes on hardware that supports 447 * Implements VESA suspend and powerdown modes on hardware that supports
448 * disabling hsync/vsync:448 * disabling hsync/vsync:
449 * @blank_mode == 2 means suspend vsync,449 * @blank_mode == 2 means suspend vsync,
450 * @blank_mode == 3 means suspend hsync,450 * @blank_mode == 3 means suspend hsync,
@@ -539,15 +539,15 @@ static const struct fb_ops hgafb_ops = { · 88 unmodified lines
539 .fb_copyarea = hgafb_copyarea,539 .fb_copyarea = hgafb_copyarea,
540 .fb_imageblit = hgafb_imageblit,540 .fb_imageblit = hgafb_imageblit,
541};541};
542 542
543/* ------------------------------------------------------------------------- *543/* ------------------------------------------------------------------------- *
544 *544 *
545 * Functions in fb_info545 * Functions in fb_info
546 * 546 *
547 * ------------------------------------------------------------------------- */547 * ------------------------------------------------------------------------- */
548 548
549/* ------------------------------------------------------------------------- */549/* ------------------------------------------------------------------------- */
550 550
551 /*551 /*
552 * Initialization552 * Initialization
553 */553 */
drivers/video/fbdev/hpfb.c+4−4
@@ -92,7 +92,7 @@ static int hpfb_setcolreg(unsigned regno, unsigned red, unsigned green, · 91 unmodified lines
92 92
93 if (regno >= info->cmap.len)93 if (regno >= info->cmap.len)
94 return 1;94 return 1;
95 95
96 while (in_be16(fb_regs + 0x6002) & 0x4) udelay(1);96 while (in_be16(fb_regs + 0x6002) & 0x4) udelay(1);
97 97
98 out_be16(fb_regs + 0x60ba, 0xff);98 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) · 44 unmodified lines
143 out_8(fb_regs + WMOVE, fb_bitmask);143 out_8(fb_regs + WMOVE, fb_bitmask);
144}144}
145 145
146static void hpfb_copyarea(struct fb_info *info, const struct fb_copyarea *area) 146static void hpfb_copyarea(struct fb_info *info, const struct fb_copyarea *area)
147{147{
148 topcat_blit(area->sx, area->sy, area->dx, area->dy, area->width, area->height, RR_COPY);148 topcat_blit(area->sx, area->sy, area->dx, area->dy, area->width, area->height, RR_COPY);
149}149}
@@ -315,7 +315,7 @@ unmap_screen_base: · 165 unmodified lines
315 return ret;315 return ret;
316}316}
317 317
318/* 318/*
319 * Check that the secondary ID indicates that we have some hope of working with this319 * Check that the secondary ID indicates that we have some hope of working with this
320 * framebuffer. The catseye boards are pretty much like topcats and we can muddle through.320 * framebuffer. The catseye boards are pretty much like topcats and we can muddle through.
321 */321 */
@@ -323,7 +323,7 @@ unmap_screen_base: · 1 unmodified line
323#define topcat_sid_ok(x) (((x) == DIO_ID2_LRCATSEYE) || ((x) == DIO_ID2_HRCCATSEYE) \323#define topcat_sid_ok(x) (((x) == DIO_ID2_LRCATSEYE) || ((x) == DIO_ID2_HRCCATSEYE) \
324 || ((x) == DIO_ID2_HRMCATSEYE) || ((x) == DIO_ID2_TOPCAT))324 || ((x) == DIO_ID2_HRMCATSEYE) || ((x) == DIO_ID2_TOPCAT))
325 325
326/* 326/*
327 * Initialise the framebuffer327 * Initialise the framebuffer
328 */328 */
329static int hpfb_dio_probe(struct dio_dev *d, const struct dio_device_id *ent)329static int hpfb_dio_probe(struct dio_dev *d, const struct dio_device_id *ent)
drivers/video/fbdev/imsttfb.c+8−7
@@ -1347,7 +1347,7 @@ static const struct fb_ops imsttfb_ops = { · 1346 unmodified lines
1347 .fb_ioctl = imsttfb_ioctl,1347 .fb_ioctl = imsttfb_ioctl,
1348};1348};
1349 1349
1350static void init_imstt(struct fb_info *info)1350static int init_imstt(struct fb_info *info)
1351{1351{
1352 struct imstt_par *par = info->par;1352 struct imstt_par *par = info->par;
1353 __u32 i, tmp, *ip, *end;1353 __u32 i, tmp, *ip, *end;
@@ -1420,7 +1420,7 @@ static void init_imstt(struct fb_info *info) · 66 unmodified lines
1420 || !(compute_imstt_regvals(par, info->var.xres, info->var.yres))) {1420 || !(compute_imstt_regvals(par, info->var.xres, info->var.yres))) {
1421 printk("imsttfb: %ux%ux%u not supported\n", info->var.xres, info->var.yres, info->var.bits_per_pixel);1421 printk("imsttfb: %ux%ux%u not supported\n", info->var.xres, info->var.yres, info->var.bits_per_pixel);
1422 framebuffer_release(info);1422 framebuffer_release(info);
1423 return;1423 return -ENODEV;
1424 }1424 }
1425 1425
1426 sprintf(info->fix.id, "IMS TT (%s)", par->ramdac == IBM ? "IBM" : "TVP");1426 sprintf(info->fix.id, "IMS TT (%s)", par->ramdac == IBM ? "IBM" : "TVP");
@@ -1456,12 +1456,13 @@ static void init_imstt(struct fb_info *info) · 29 unmodified lines
1456 1456
1457 if (register_framebuffer(info) < 0) {1457 if (register_framebuffer(info) < 0) {
1458 framebuffer_release(info);1458 framebuffer_release(info);
1459 return;1459 return -ENODEV;
1460 }1460 }
1461 1461
1462 tmp = (read_reg_le32(par->dc_regs, SSTATUS) & 0x0f00) >> 8;1462 tmp = (read_reg_le32(par->dc_regs, SSTATUS) & 0x0f00) >> 8;
1463 fb_info(info, "%s frame buffer; %uMB vram; chip version %u\n",1463 fb_info(info, "%s frame buffer; %uMB vram; chip version %u\n",
1464 info->fix.id, info->fix.smem_len >> 20, tmp);1464 info->fix.id, info->fix.smem_len >> 20, tmp);
1465 return 0;
1465}1466}
1466 1467
1467static int imsttfb_probe(struct pci_dev *pdev, const struct pci_device_id *ent)1468static 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) · 61 unmodified lines
1529 if (!par->cmap_regs)1530 if (!par->cmap_regs)
1530 goto error;1531 goto error;
1531 info->pseudo_palette = par->palette;1532 info->pseudo_palette = par->palette;
1532 init_imstt(info);1533 ret = init_imstt(info);
1533 1534 if (!ret)
1534 pci_set_drvdata(pdev, info);1535 pci_set_drvdata(pdev, info);
1535 return 0;1536 return ret;
1536 1537
1537error:1538error:
1538 if (par->dc_regs)1539 if (par->dc_regs)
drivers/video/fbdev/macfb.c+5−5
@@ -339,7 +339,7 @@ static int civic_setpalette(unsigned int regno, unsigned int red, · 338 unmodified lines
339{339{
340 unsigned long flags;340 unsigned long flags;
341 int clut_status;341 int clut_status;
342 342
343 local_irq_save(flags);343 local_irq_save(flags);
344 344
345 /* Set the register address */345 /* Set the register address */
@@ -439,7 +439,7 @@ static int macfb_setcolreg(unsigned regno, unsigned red, unsigned green, · 93 unmodified lines
439 * (according to the entries in the `var' structure).439 * (according to the entries in the `var' structure).
440 * Return non-zero for invalid regno.440 * Return non-zero for invalid regno.
441 */441 */
442 442
443 if (regno >= fb_info->cmap.len)443 if (regno >= fb_info->cmap.len)
444 return 1;444 return 1;
445 445
@@ -548,7 +548,7 @@ static int __init macfb_init(void) · 102 unmodified lines
548 return -ENODEV;548 return -ENODEV;
549 macfb_setup(option);549 macfb_setup(option);
550 550
551 if (!MACH_IS_MAC) 551 if (!MACH_IS_MAC)
552 return -ENODEV;552 return -ENODEV;
553 553
554 if (mac_bi_data.id == MAC_MODEL_Q630 ||554 if (mac_bi_data.id == MAC_MODEL_Q630 ||
@@ -644,7 +644,7 @@ static int __init macfb_init(void) · 89 unmodified lines
644 err = -EINVAL;644 err = -EINVAL;
645 goto fail_unmap;645 goto fail_unmap;
646 }646 }
647 647
648 /*648 /*
649 * We take a wild guess that if the video physical address is649 * We take a wild guess that if the video physical address is
650 * in nubus slot space, that the nubus card is driving video.650 * in nubus slot space, that the nubus card is driving video.
@@ -774,7 +774,7 @@ static int __init macfb_init(void) · 123 unmodified lines
774 civic_cmap_regs = ioremap(CIVIC_BASE, 0x1000);774 civic_cmap_regs = ioremap(CIVIC_BASE, 0x1000);
775 break;775 break;
776 776
777 777
778 /*778 /*
779 * Assorted weirdos779 * Assorted weirdos
780 * We think this may be like the LC II780 * We think this may be like the LC II
drivers/video/fbdev/maxinefb.c+1−1
@@ -138,7 +138,7 @@ int __init maxinefb_init(void) · 137 unmodified lines
138 *(volatile unsigned char *)fboff = 0x0;138 *(volatile unsigned char *)fboff = 0x0;
139 139
140 maxinefb_fix.smem_start = fb_start;140 maxinefb_fix.smem_start = fb_start;
141 141
142 /* erase hardware cursor */142 /* erase hardware cursor */
143 for (i = 0; i < 512; i++) {143 for (i = 0; i < 512; i++) {
144 maxinefb_ims332_write_register(IMS332_REG_CURSOR_RAM + i,144 maxinefb_ims332_write_register(IMS332_REG_CURSOR_RAM + i,
drivers/video/fbdev/p9100.c+2−2
@@ -65,7 +65,7 @@ static const struct fb_ops p9100_ops = { · 64 unmodified lines
65#define P9100_FB_OFF 0x0UL65#define P9100_FB_OFF 0x0UL
66 66
67/* 3 bits: 2=8bpp 3=16bpp 5=32bpp 7=24bpp */67/* 3 bits: 2=8bpp 3=16bpp 5=32bpp 7=24bpp */
68#define SYS_CONFIG_PIXELSIZE_SHIFT 26 68#define SYS_CONFIG_PIXELSIZE_SHIFT 26
69 69
70#define SCREENPAINT_TIMECTL1_ENABLE_VIDEO 0x20 /* 0 = off, 1 = on */70#define SCREENPAINT_TIMECTL1_ENABLE_VIDEO 0x20 /* 0 = off, 1 = on */
71 71
@@ -110,7 +110,7 @@ struct p9100_regs { · 38 unmodified lines
110 u32 vram_xxx[25];110 u32 vram_xxx[25];
111 111
112 /* Registers for IBM RGB528 Palette */112 /* Registers for IBM RGB528 Palette */
113 u32 ramdac_cmap_wridx; 113 u32 ramdac_cmap_wridx;
114 u32 ramdac_palette_data;114 u32 ramdac_palette_data;
115 u32 ramdac_pixel_mask;115 u32 ramdac_pixel_mask;
116 u32 ramdac_palette_rdaddr;116 u32 ramdac_palette_rdaddr;
drivers/video/fbdev/platinumfb.c+15−15
@@ -52,17 +52,17 @@ struct fb_info_platinum { · 51 unmodified lines
52 __u8 red, green, blue;52 __u8 red, green, blue;
53 } palette[256];53 } palette[256];
54 u32 pseudo_palette[16];54 u32 pseudo_palette[16];
55 55
56 volatile struct cmap_regs __iomem *cmap_regs;56 volatile struct cmap_regs __iomem *cmap_regs;
57 unsigned long cmap_regs_phys;57 unsigned long cmap_regs_phys;
58 58
59 volatile struct platinum_regs __iomem *platinum_regs;59 volatile struct platinum_regs __iomem *platinum_regs;
60 unsigned long platinum_regs_phys;60 unsigned long platinum_regs_phys;
61 61
62 __u8 __iomem *frame_buffer;62 __u8 __iomem *frame_buffer;
63 volatile __u8 __iomem *base_frame_buffer;63 volatile __u8 __iomem *base_frame_buffer;
64 unsigned long frame_buffer_phys;64 unsigned long frame_buffer_phys;
65 65
66 unsigned long total_vram;66 unsigned long total_vram;
67 int clktype;67 int clktype;
68 int dactype;68 int dactype;
@@ -133,7 +133,7 @@ static int platinumfb_set_par (struct fb_info *info) · 64 unmodified lines
133 platinum_set_hardware(pinfo);133 platinum_set_hardware(pinfo);
134 134
135 init = platinum_reg_init[pinfo->vmode-1];135 init = platinum_reg_init[pinfo->vmode-1];
136 136
137 if ((pinfo->vmode == VMODE_832_624_75) && (pinfo->cmode > CMODE_8))137 if ((pinfo->vmode == VMODE_832_624_75) && (pinfo->cmode > CMODE_8))
138 offset = 0x10;138 offset = 0x10;
139 139
@@ -214,7 +214,7 @@ static int platinumfb_setcolreg(u_int regno, u_int red, u_int green, u_int blue, · 74 unmodified lines
214 break;214 break;
215 }215 }
216 }216 }
217 217
218 return 0;218 return 0;
219}219}
220 220
@@ -269,7 +269,7 @@ static void platinum_set_hardware(struct fb_info_platinum *pinfo) · 48 unmodified lines
269 struct platinum_regvals *init;269 struct platinum_regvals *init;
270 int i;270 int i;
271 int vmode, cmode;271 int vmode, cmode;
272 272
273 vmode = pinfo->vmode;273 vmode = pinfo->vmode;
274 cmode = pinfo->cmode;274 cmode = pinfo->cmode;
275 275
@@ -436,7 +436,7 @@ static int read_platinum_sense(struct fb_info_platinum *info) · 160 unmodified lines
436 * This routine takes a user-supplied var, and picks the best vmode/cmode from it.436 * This routine takes a user-supplied var, and picks the best vmode/cmode from it.
437 * It also updates the var structure to the actual mode data obtained437 * It also updates the var structure to the actual mode data obtained
438 */438 */
439static int platinum_var_to_par(struct fb_var_screeninfo *var, 439static int platinum_var_to_par(struct fb_var_screeninfo *var,
440 struct fb_info_platinum *pinfo,440 struct fb_info_platinum *pinfo,
441 int check_only)441 int check_only)
442{442{
@@ -478,12 +478,12 @@ static int platinum_var_to_par(struct fb_var_screeninfo *var, · 35 unmodified lines
478 pinfo->yoffset = 0;478 pinfo->yoffset = 0;
479 pinfo->vxres = pinfo->xres;479 pinfo->vxres = pinfo->xres;
480 pinfo->vyres = pinfo->yres;480 pinfo->vyres = pinfo->yres;
481 481
482 return 0;482 return 0;
483}483}
484 484
485 485
486/* 486/*
487 * Parse user specified options (`video=platinumfb:')487 * Parse user specified options (`video=platinumfb:')
488 */488 */
489static int __init platinumfb_setup(char *options)489static int __init platinumfb_setup(char *options)
@@ -624,7 +624,7 @@ static int platinumfb_probe(struct platform_device* odev) · 134 unmodified lines
624 break;624 break;
625 }625 }
626 dev_set_drvdata(&odev->dev, info);626 dev_set_drvdata(&odev->dev, info);
627 627
628 rc = platinum_init_fb(info);628 rc = platinum_init_fb(info);
629 if (rc != 0) {629 if (rc != 0) {
630 iounmap(pinfo->frame_buffer);630 iounmap(pinfo->frame_buffer);
@@ -640,9 +640,9 @@ static void platinumfb_remove(struct platform_device* odev) · 9 unmodified lines
640{640{
641 struct fb_info *info = dev_get_drvdata(&odev->dev);641 struct fb_info *info = dev_get_drvdata(&odev->dev);
642 struct fb_info_platinum *pinfo = info->par;642 struct fb_info_platinum *pinfo = info->par;
643 643
644 unregister_framebuffer (info);644 unregister_framebuffer (info);
645 645
646 /* Unmap frame buffer and registers */646 /* Unmap frame buffer and registers */
647 iounmap(pinfo->frame_buffer);647 iounmap(pinfo->frame_buffer);
648 iounmap(pinfo->platinum_regs);648 iounmap(pinfo->platinum_regs);
@@ -656,7 +656,7 @@ static void platinumfb_remove(struct platform_device* odev) · 7 unmodified lines
656 framebuffer_release(info);656 framebuffer_release(info);
657}657}
658 658
659static struct of_device_id platinumfb_match[] = 659static struct of_device_id platinumfb_match[] =
660{660{
661 {661 {
662 .name = "platinum",662 .name = "platinum",
@@ -664,7 +664,7 @@ static struct of_device_id platinumfb_match[] = · 1 unmodified line
664 {},664 {},
665};665};
666 666
667static struct platform_driver platinum_driver = 667static struct platform_driver platinum_driver =
668{668{
669 .driver = {669 .driver = {
670 .name = "platinumfb",670 .name = "platinumfb",
drivers/video/fbdev/sa1100fb.c+16−16
@@ -57,14 +57,14 @@ · 56 unmodified lines
57 * - Driver appears to be working for Brutus 320x200x8bpp mode. Other57 * - Driver appears to be working for Brutus 320x200x8bpp mode. Other
58 * resolutions are working, but only the 8bpp mode is supported.58 * resolutions are working, but only the 8bpp mode is supported.
59 * Changes need to be made to the palette encode and decode routines59 * Changes need to be made to the palette encode and decode routines
60 * to support 4 and 16 bpp modes. 60 * to support 4 and 16 bpp modes.
61 * Driver is not designed to be a module. The FrameBuffer is statically61 * Driver is not designed to be a module. The FrameBuffer is statically
62 * allocated since dynamic allocation of a 300k buffer cannot be 62 * allocated since dynamic allocation of a 300k buffer cannot be
63 * guaranteed. 63 * guaranteed.
64 *64 *
65 * 1999/06/17:65 * 1999/06/17:
66 * - FrameBuffer memory is now allocated at run-time when the66 * - FrameBuffer memory is now allocated at run-time when the
67 * driver is initialized. 67 * driver is initialized.
68 *68 *
69 * 2000/04/10: Nicolas Pitre <nico@fluxnic.net>69 * 2000/04/10: Nicolas Pitre <nico@fluxnic.net>
70 * - Big cleanup for dynamic selection of machine type at run time.70 * - Big cleanup for dynamic selection of machine type at run time.
@@ -74,8 +74,8 @@ · 3 unmodified lines
74 *74 *
75 * 2000/08/07: Tak-Shing Chan <tchan.rd@idthk.com>75 * 2000/08/07: Tak-Shing Chan <tchan.rd@idthk.com>
76 * Jeff Sutherland <jsutherland@accelent.com>76 * Jeff Sutherland <jsutherland@accelent.com>
77 * - Resolved an issue caused by a change made to the Assabet's PLD 77 * - Resolved an issue caused by a change made to the Assabet's PLD
78 * earlier this year which broke the framebuffer driver for newer 78 * earlier this year which broke the framebuffer driver for newer
79 * Phase 4 Assabets. Some other parameters were changed to optimize79 * Phase 4 Assabets. Some other parameters were changed to optimize
80 * for the Sharp display.80 * for the Sharp display.
81 *81 *
@@ -102,7 +102,7 @@ · 20 unmodified lines
102 * 2000/11/23: Eric Peng <ericpeng@coventive.com>102 * 2000/11/23: Eric Peng <ericpeng@coventive.com>
103 * - Freebird add103 * - Freebird add
104 *104 *
105 * 2001/02/07: Jamey Hicks <jamey.hicks@compaq.com> 105 * 2001/02/07: Jamey Hicks <jamey.hicks@compaq.com>
106 * Cliff Brake <cbrake@accelent.com>106 * Cliff Brake <cbrake@accelent.com>
107 * - Added PM callback107 * - Added PM callback
108 *108 *
@@ -500,7 +500,7 @@ sa1100fb_set_cmap(struct fb_cmap *cmap, int kspc, int con, · 391 unmodified lines
500 * the shortest recovery time500 * the shortest recovery time
501 * Suspend501 * Suspend
502 * This refers to a level of power management in which substantial power502 * This refers to a level of power management in which substantial power
503 * reduction is achieved by the display. The display can have a longer 503 * reduction is achieved by the display. The display can have a longer
504 * recovery time from this state than from the Stand-by state504 * recovery time from this state than from the Stand-by state
505 * Off505 * Off
506 * This indicates that the display is consuming the lowest level of power506 * 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, · 15 unmodified lines
522 */522 */
523/*523/*
524 * sa1100fb_blank():524 * sa1100fb_blank():
525 * Blank the display by setting all palette values to zero. Note, the 525 * Blank the display by setting all palette values to zero. Note, the
526 * 12 and 16 bpp modes don't really use the palette, so this will not526 * 12 and 16 bpp modes don't really use the palette, so this will not
527 * blank the display in all modes. 527 * blank the display in all modes.
528 */528 */
529static int sa1100fb_blank(int blank, struct fb_info *info)529static int sa1100fb_blank(int blank, struct fb_info *info)
530{530{
@@ -603,8 +603,8 @@ static inline unsigned int get_pcd(struct sa1100fb_info *fbi, · 72 unmodified lines
603 603
604/*604/*
605 * sa1100fb_activate_var():605 * sa1100fb_activate_var():
606 * Configures LCD Controller based on entries in var parameter. Settings are 606 * Configures LCD Controller based on entries in var parameter. Settings are
607 * only written to the controller if changes were made. 607 * only written to the controller if changes were made.
608 */608 */
609static int sa1100fb_activate_var(struct fb_var_screeninfo *var, struct sa1100fb_info *fbi)609static int sa1100fb_activate_var(struct fb_var_screeninfo *var, struct sa1100fb_info *fbi)
610{610{
@@ -747,7 +747,7 @@ static void sa1100fb_setup_gpio(struct sa1100fb_info *fbi) · 136 unmodified lines
747 *747 *
748 * SA1110 spec update nr. 25 says we can and should748 * SA1110 spec update nr. 25 says we can and should
749 * clear LDD15 to 12 for 4 or 8bpp modes with active749 * clear LDD15 to 12 for 4 or 8bpp modes with active
750 * panels. 750 * panels.
751 */751 */
752 if ((fbi->reg_lccr0 & LCCR0_CMS) == LCCR0_Color &&752 if ((fbi->reg_lccr0 & LCCR0_CMS) == LCCR0_Color &&
753 (fbi->reg_lccr0 & (LCCR0_Dual|LCCR0_Act)) != 0) {753 (fbi->reg_lccr0 & (LCCR0_Dual|LCCR0_Act)) != 0) {
@@ -1020,9 +1020,9 @@ static int sa1100fb_resume(struct platform_device *dev) · 266 unmodified lines
1020 1020
1021/*1021/*
1022 * sa1100fb_map_video_memory():1022 * sa1100fb_map_video_memory():
1023 * Allocates the DRAM memory for the frame buffer. This buffer is 1023 * Allocates the DRAM memory for the frame buffer. This buffer is
1024 * remapped into a non-cached, non-buffered, memory region to 1024 * remapped into a non-cached, non-buffered, memory region to
1025 * allow palette and pixel writes to occur without flushing the 1025 * allow palette and pixel writes to occur without flushing the
1026 * cache. Once this area is remapped, all virtual memory1026 * cache. Once this area is remapped, all virtual memory
1027 * access to the video memory should occur at the new region.1027 * access to the video memory should occur at the new region.
1028 */1028 */
drivers/video/fbdev/stifb.c+79−78
@@ -1,11 +1,11 @@
1/*1/*
2 * linux/drivers/video/stifb.c - 2 * linux/drivers/video/stifb.c -
3 * Low level Frame buffer driver for HP workstations with 3 * Low level Frame buffer driver for HP workstations with
4 * STI (standard text interface) video firmware.4 * STI (standard text interface) video firmware.
5 *5 *
6 * Copyright (C) 2001-2006 Helge Deller <deller@gmx.de>6 * Copyright (C) 2001-2006 Helge Deller <deller@gmx.de>
7 * Portions Copyright (C) 2001 Thomas Bogendoerfer <tsbogend@alpha.franken.de>7 * Portions Copyright (C) 2001 Thomas Bogendoerfer <tsbogend@alpha.franken.de>
8 * 8 *
9 * Based on:9 * Based on:
10 * - linux/drivers/video/artistfb.c -- Artist frame buffer driver10 * - linux/drivers/video/artistfb.c -- Artist frame buffer driver
11 * Copyright (C) 2000 Philipp Rumpf <prumpf@tux.org>11 * Copyright (C) 2000 Philipp Rumpf <prumpf@tux.org>
@@ -14,7 +14,7 @@ · 2 unmodified lines
14 * - HP Xhp cfb-based X11 window driver for XFree8614 * - HP Xhp cfb-based X11 window driver for XFree86
15 * (c)Copyright 1992 Hewlett-Packard Co.15 * (c)Copyright 1992 Hewlett-Packard Co.
16 *16 *
17 * 17 *
18 * The following graphics display devices (NGLE family) are supported by this driver:18 * The following graphics display devices (NGLE family) are supported by this driver:
19 *19 *
20 * HPA4070A known as "HCRX", a 1280x1024 color device with 8 planes20 * HPA4070A known as "HCRX", a 1280x1024 color device with 8 planes
@@ -30,7 +30,7 @@ · 9 unmodified lines
30 * supports 1280x1024 color displays with 8 planes.30 * supports 1280x1024 color displays with 8 planes.
31 * HP710G same as HP710C, 1280x1024 grayscale only31 * HP710G same as HP710C, 1280x1024 grayscale only
32 * HP710L same as HP710C, 1024x768 color only32 * HP710L same as HP710C, 1024x768 color only
33 * HP712 internal graphics support on HP9000s712 SPU, supports 640x480, 33 * HP712 internal graphics support on HP9000s712 SPU, supports 640x480,
34 * 1024x768 or 1280x1024 color displays on 8 planes (Artist)34 * 1024x768 or 1280x1024 color displays on 8 planes (Artist)
35 *35 *
36 * This file is subject to the terms and conditions of the GNU General Public36 * This file is subject to the terms and conditions of the GNU General Public
@@ -92,7 +92,7 @@ typedef struct { · 55 unmodified lines
92 __s32 misc_video_end;92 __s32 misc_video_end;
93} video_setup_t;93} video_setup_t;
94 94
95typedef struct { 95typedef struct {
96 __s16 sizeof_ngle_data;96 __s16 sizeof_ngle_data;
97 __s16 x_size_visible; /* visible screen dim in pixels */97 __s16 x_size_visible; /* visible screen dim in pixels */
98 __s16 y_size_visible;98 __s16 y_size_visible;
@@ -177,10 +177,10 @@ static int __initdata stifb_bpp_pref[MAX_STI_ROMS]; · 78 unmodified lines
177#endif /* DEBUG_STIFB_REGS */177#endif /* DEBUG_STIFB_REGS */
178 178
179 179
180#define ENABLE 1 /* for enabling/disabling screen */ 180#define ENABLE 1 /* for enabling/disabling screen */
181#define DISABLE 0181#define DISABLE 0
182 182
183#define NGLE_LOCK(fb_info) do { } while (0) 183#define NGLE_LOCK(fb_info) do { } while (0)
184#define NGLE_UNLOCK(fb_info) do { } while (0)184#define NGLE_UNLOCK(fb_info) do { } while (0)
185 185
186static void186static void
@@ -198,9 +198,9 @@ SETUP_HW(struct stifb_info *fb) · 11 unmodified lines
198 198
199static void199static void
200SETUP_FB(struct stifb_info *fb)200SETUP_FB(struct stifb_info *fb)
201{ 201{
202 unsigned int reg10_value = 0;202 unsigned int reg10_value = 0;
203 203
204 SETUP_HW(fb);204 SETUP_HW(fb);
205 switch (fb->id)205 switch (fb->id)
206 {206 {
@@ -210,15 +210,15 @@ SETUP_FB(struct stifb_info *fb) · 3 unmodified lines
210 reg10_value = 0x13601000;210 reg10_value = 0x13601000;
211 break;211 break;
212 case S9000_ID_A1439A:212 case S9000_ID_A1439A:
213 if (fb->info.var.bits_per_pixel == 32) 213 if (fb->info.var.bits_per_pixel == 32)
214 reg10_value = 0xBBA0A000;214 reg10_value = 0xBBA0A000;
215 else 215 else
216 reg10_value = 0x13601000;216 reg10_value = 0x13601000;
217 break;217 break;
218 case S9000_ID_HCRX:218 case S9000_ID_HCRX:
219 if (fb->info.var.bits_per_pixel == 32)219 if (fb->info.var.bits_per_pixel == 32)
220 reg10_value = 0xBBA0A000;220 reg10_value = 0xBBA0A000;
221 else 221 else
222 reg10_value = 0x13602000;222 reg10_value = 0x13602000;
223 break;223 break;
224 case S9000_ID_TIMBER:224 case S9000_ID_TIMBER:
@@ -243,7 +243,7 @@ START_IMAGE_COLORMAP_ACCESS(struct stifb_info *fb) · 18 unmodified lines
243}243}
244 244
245static void245static void
246WRITE_IMAGE_COLOR(struct stifb_info *fb, int index, int color) 246WRITE_IMAGE_COLOR(struct stifb_info *fb, int index, int color)
247{247{
248 SETUP_HW(fb);248 SETUP_HW(fb);
249 WRITE_WORD(((0x100+index)<<2), fb, REG_3);249 WRITE_WORD(((0x100+index)<<2), fb, REG_3);
@@ -251,30 +251,30 @@ WRITE_IMAGE_COLOR(struct stifb_info *fb, int index, int color) · 1 unmodified line
251}251}
252 252
253static void253static void
254FINISH_IMAGE_COLORMAP_ACCESS(struct stifb_info *fb) 254FINISH_IMAGE_COLORMAP_ACCESS(struct stifb_info *fb)
255{ 255{
256 WRITE_WORD(0x400, fb, REG_2);256 WRITE_WORD(0x400, fb, REG_2);
257 if (fb->info.var.bits_per_pixel == 32) {257 if (fb->info.var.bits_per_pixel == 32) {
258 WRITE_WORD(0x83000100, fb, REG_1);258 WRITE_WORD(0x83000100, fb, REG_1);
259 } else {259 } else {
260 if (fb->id == S9000_ID_ARTIST || fb->id == CRT_ID_VISUALIZE_EG)260 if (fb->id == S9000_ID_ARTIST || fb->id == CRT_ID_VISUALIZE_EG)
261 WRITE_WORD(0x80000100, fb, REG_26);261 WRITE_WORD(0x80000100, fb, REG_26);
262 else 262 else
263 WRITE_WORD(0x80000100, fb, REG_1);263 WRITE_WORD(0x80000100, fb, REG_1);
264 }264 }
265 SETUP_FB(fb);265 SETUP_FB(fb);
266}266}
267 267
268static void268static void
269SETUP_RAMDAC(struct stifb_info *fb) 269SETUP_RAMDAC(struct stifb_info *fb)
270{270{
271 SETUP_HW(fb);271 SETUP_HW(fb);
272 WRITE_WORD(0x04000000, fb, 0x1020);272 WRITE_WORD(0x04000000, fb, 0x1020);
273 WRITE_WORD(0xff000000, fb, 0x1028);273 WRITE_WORD(0xff000000, fb, 0x1028);
274}274}
275 275
276static void 276static void
277CRX24_SETUP_RAMDAC(struct stifb_info *fb) 277CRX24_SETUP_RAMDAC(struct stifb_info *fb)
278{278{
279 SETUP_HW(fb);279 SETUP_HW(fb);
280 WRITE_WORD(0x04000000, fb, 0x1000);280 WRITE_WORD(0x04000000, fb, 0x1000);
@@ -286,14 +286,14 @@ CRX24_SETUP_RAMDAC(struct stifb_info *fb) · 5 unmodified lines
286}286}
287 287
288#if 0288#if 0
289static void 289static void
290HCRX_SETUP_RAMDAC(struct stifb_info *fb)290HCRX_SETUP_RAMDAC(struct stifb_info *fb)
291{291{
292 WRITE_WORD(0xffffffff, fb, REG_32);292 WRITE_WORD(0xffffffff, fb, REG_32);
293}293}
294#endif294#endif
295 295
296static void 296static void
297CRX24_SET_OVLY_MASK(struct stifb_info *fb)297CRX24_SET_OVLY_MASK(struct stifb_info *fb)
298{298{
299 SETUP_HW(fb);299 SETUP_HW(fb);
@@ -314,7 +314,7 @@ ENABLE_DISABLE_DISPLAY(struct stifb_info *fb, int enable) · 14 unmodified lines
314 WRITE_WORD(value, fb, 0x1038);314 WRITE_WORD(value, fb, 0x1038);
315}315}
316 316
317static void 317static void
318CRX24_ENABLE_DISABLE_DISPLAY(struct stifb_info *fb, int enable)318CRX24_ENABLE_DISABLE_DISPLAY(struct stifb_info *fb, int enable)
319{319{
320 unsigned int value = enable ? 0x10000000 : 0x30000000;320 unsigned int value = enable ? 0x10000000 : 0x30000000;
@@ -325,11 +325,11 @@ CRX24_ENABLE_DISABLE_DISPLAY(struct stifb_info *fb, int enable) · 4 unmodified lines
325}325}
326 326
327static void327static void
328ARTIST_ENABLE_DISABLE_DISPLAY(struct stifb_info *fb, int enable) 328ARTIST_ENABLE_DISABLE_DISPLAY(struct stifb_info *fb, int enable)
329{329{
330 u32 DregsMiscVideo = REG_21;330 u32 DregsMiscVideo = REG_21;
331 u32 DregsMiscCtl = REG_27;331 u32 DregsMiscCtl = REG_27;
332 332
333 SETUP_HW(fb);333 SETUP_HW(fb);
334 if (enable) {334 if (enable) {
335 WRITE_WORD(READ_WORD(fb, DregsMiscVideo) | 0x0A000000, fb, DregsMiscVideo);335 WRITE_WORD(READ_WORD(fb, DregsMiscVideo) | 0x0A000000, fb, DregsMiscVideo);
@@ -344,7 +344,7 @@ ARTIST_ENABLE_DISABLE_DISPLAY(struct stifb_info *fb, int enable) · 8 unmodified lines
344 (READ_BYTE(fb, REG_16b3) - 1)344 (READ_BYTE(fb, REG_16b3) - 1)
345 345
346#define HYPER_CONFIG_PLANES_24 0x00000100346#define HYPER_CONFIG_PLANES_24 0x00000100
347 347
348#define IS_24_DEVICE(fb) \348#define IS_24_DEVICE(fb) \
349 (fb->deviceSpecificConfig & HYPER_CONFIG_PLANES_24)349 (fb->deviceSpecificConfig & HYPER_CONFIG_PLANES_24)
350 350
@@ -470,15 +470,15 @@ SETUP_ATTR_ACCESS(struct stifb_info *fb, unsigned BufferNumber) · 119 unmodified lines
470}470}
471 471
472static void472static void
473SET_ATTR_SIZE(struct stifb_info *fb, int width, int height) 473SET_ATTR_SIZE(struct stifb_info *fb, int width, int height)
474{474{
475 /* REG_6 seems to have special values when run on a 475 /* REG_6 seems to have special values when run on a
476 RDI precisionbook parisc laptop (INTERNAL_EG_DX1024 or476 RDI precisionbook parisc laptop (INTERNAL_EG_DX1024 or
477 INTERNAL_EG_X1024). The values are:477 INTERNAL_EG_X1024). The values are:
478 0x2f0: internal (LCD) & external display enabled478 0x2f0: internal (LCD) & external display enabled
479 0x2a0: external display only479 0x2a0: external display only
480 0x000: zero on standard artist graphic cards480 0x000: zero on standard artist graphic cards
481 */ 481 */
482 WRITE_WORD(0x00000000, fb, REG_6);482 WRITE_WORD(0x00000000, fb, REG_6);
483 WRITE_WORD((width<<16) | height, fb, REG_9);483 WRITE_WORD((width<<16) | height, fb, REG_9);
484 WRITE_WORD(0x05000000, fb, REG_6);484 WRITE_WORD(0x05000000, fb, REG_6);
@@ -486,7 +486,7 @@ SET_ATTR_SIZE(struct stifb_info *fb, int width, int height) · 1 unmodified line
486}486}
487 487
488static void488static void
489FINISH_ATTR_ACCESS(struct stifb_info *fb) 489FINISH_ATTR_ACCESS(struct stifb_info *fb)
490{490{
491 SETUP_HW(fb);491 SETUP_HW(fb);
492 WRITE_WORD(0x00000000, fb, REG_12);492 WRITE_WORD(0x00000000, fb, REG_12);
@@ -499,7 +499,7 @@ elkSetupPlanes(struct stifb_info *fb) · 6 unmodified lines
499 SETUP_FB(fb);499 SETUP_FB(fb);
500}500}
501 501
502static void 502static void
503ngleSetupAttrPlanes(struct stifb_info *fb, int BufferNumber)503ngleSetupAttrPlanes(struct stifb_info *fb, int BufferNumber)
504{504{
505 SETUP_ATTR_ACCESS(fb, BufferNumber);505 SETUP_ATTR_ACCESS(fb, BufferNumber);
@@ -519,7 +519,7 @@ rattlerSetupPlanes(struct stifb_info *fb) · 13 unmodified lines
519 * read mask register for overlay planes, not image planes).519 * read mask register for overlay planes, not image planes).
520 */520 */
521 CRX24_SETUP_RAMDAC(fb);521 CRX24_SETUP_RAMDAC(fb);
522 522
523 /* change fb->id temporarily to fool SETUP_FB() */523 /* change fb->id temporarily to fool SETUP_FB() */
524 saved_id = fb->id;524 saved_id = fb->id;
525 fb->id = CRX24_OVERLAY_PLANES;525 fb->id = CRX24_OVERLAY_PLANES;
@@ -565,7 +565,7 @@ setNgleLutBltCtl(struct stifb_info *fb, int offsetWithinLut, int length) · 39 unmodified lines
565 lutBltCtl.all = 0x80000000;565 lutBltCtl.all = 0x80000000;
566 lutBltCtl.fields.length = length;566 lutBltCtl.fields.length = length;
567 567
568 switch (fb->id) 568 switch (fb->id)
569 {569 {
570 case S9000_ID_A1439A: /* CRX24 */570 case S9000_ID_A1439A: /* CRX24 */
571 if (fb->var.bits_per_pixel == 8) {571 if (fb->var.bits_per_pixel == 8) {
@@ -576,12 +576,12 @@ setNgleLutBltCtl(struct stifb_info *fb, int offsetWithinLut, int length) · 4 unmodified lines
576 lutBltCtl.fields.lutOffset = 0 * 256;576 lutBltCtl.fields.lutOffset = 0 * 256;
577 }577 }
578 break;578 break;
579 579
580 case S9000_ID_ARTIST:580 case S9000_ID_ARTIST:
581 lutBltCtl.fields.lutType = NGLE_CMAP_INDEXED0_TYPE;581 lutBltCtl.fields.lutType = NGLE_CMAP_INDEXED0_TYPE;
582 lutBltCtl.fields.lutOffset = 0 * 256;582 lutBltCtl.fields.lutOffset = 0 * 256;
583 break;583 break;
584 584
585 default:585 default:
586 lutBltCtl.fields.lutType = NGLE_CMAP_INDEXED0_TYPE;586 lutBltCtl.fields.lutType = NGLE_CMAP_INDEXED0_TYPE;
587 lutBltCtl.fields.lutOffset = 0;587 lutBltCtl.fields.lutOffset = 0;
@@ -596,7 +596,7 @@ setNgleLutBltCtl(struct stifb_info *fb, int offsetWithinLut, int length) · 8 unmodified lines
596#endif596#endif
597 597
598static NgleLutBltCtl598static NgleLutBltCtl
599setHyperLutBltCtl(struct stifb_info *fb, int offsetWithinLut, int length) 599setHyperLutBltCtl(struct stifb_info *fb, int offsetWithinLut, int length)
600{600{
601 NgleLutBltCtl lutBltCtl;601 NgleLutBltCtl lutBltCtl;
602 602
@@ -633,7 +633,7 @@ static void hyperUndoITE(struct stifb_info *fb) · 30 unmodified lines
633 633
634 /* Hardware setup for full-depth write to "magic" location */634 /* Hardware setup for full-depth write to "magic" location */
635 GET_FIFO_SLOTS(fb, nFreeFifoSlots, 7);635 GET_FIFO_SLOTS(fb, nFreeFifoSlots, 7);
636 NGLE_QUICK_SET_DST_BM_ACCESS(fb, 636 NGLE_QUICK_SET_DST_BM_ACCESS(fb,
637 BA(IndexedDcd, Otc04, Ots08, AddrLong,637 BA(IndexedDcd, Otc04, Ots08, AddrLong,
638 BAJustPoint(0), BINovly, BAIndexBase(0)));638 BAJustPoint(0), BINovly, BAIndexBase(0)));
639 NGLE_QUICK_SET_IMAGE_BITMAP_OP(fb,639 NGLE_QUICK_SET_IMAGE_BITMAP_OP(fb,
@@ -653,13 +653,13 @@ static void hyperUndoITE(struct stifb_info *fb) · 13 unmodified lines
653 NGLE_UNLOCK(fb);653 NGLE_UNLOCK(fb);
654}654}
655 655
656static void 656static void
657ngleDepth8_ClearImagePlanes(struct stifb_info *fb)657ngleDepth8_ClearImagePlanes(struct stifb_info *fb)
658{658{
659 /* FIXME! */659 /* FIXME! */
660}660}
661 661
662static void 662static void
663ngleDepth24_ClearImagePlanes(struct stifb_info *fb)663ngleDepth24_ClearImagePlanes(struct stifb_info *fb)
664{664{
665 /* FIXME! */665 /* FIXME! */
@@ -675,7 +675,7 @@ ngleResetAttrPlanes(struct stifb_info *fb, unsigned int ctlPlaneReg) · 9 unmodified lines
675 NGLE_LOCK(fb);675 NGLE_LOCK(fb);
676 676
677 GET_FIFO_SLOTS(fb, nFreeFifoSlots, 4);677 GET_FIFO_SLOTS(fb, nFreeFifoSlots, 4);
678 NGLE_QUICK_SET_DST_BM_ACCESS(fb, 678 NGLE_QUICK_SET_DST_BM_ACCESS(fb,
679 BA(IndexedDcd, Otc32, OtsIndirect,679 BA(IndexedDcd, Otc32, OtsIndirect,
680 AddrLong, BAJustPoint(0),680 AddrLong, BAJustPoint(0),
681 BINattr, BAIndexBase(0)));681 BINattr, BAIndexBase(0)));
@@ -713,22 +713,22 @@ ngleResetAttrPlanes(struct stifb_info *fb, unsigned int ctlPlaneReg) · 31 unmodified lines
713 /**** Finally, set the Control Plane Register back to zero: ****/713 /**** Finally, set the Control Plane Register back to zero: ****/
714 GET_FIFO_SLOTS(fb, nFreeFifoSlots, 1);714 GET_FIFO_SLOTS(fb, nFreeFifoSlots, 1);
715 NGLE_QUICK_SET_CTL_PLN_REG(fb, 0);715 NGLE_QUICK_SET_CTL_PLN_REG(fb, 0);
716 716
717 NGLE_UNLOCK(fb);717 NGLE_UNLOCK(fb);
718}718}
719 719
720static void720static void
721ngleClearOverlayPlanes(struct stifb_info *fb, int mask, int data)721ngleClearOverlayPlanes(struct stifb_info *fb, int mask, int data)
722{722{
723 int nFreeFifoSlots = 0;723 int nFreeFifoSlots = 0;
724 u32 packed_dst;724 u32 packed_dst;
725 u32 packed_len;725 u32 packed_len;
726 726
727 NGLE_LOCK(fb);727 NGLE_LOCK(fb);
728 728
729 /* Hardware setup */729 /* Hardware setup */
730 GET_FIFO_SLOTS(fb, nFreeFifoSlots, 8);730 GET_FIFO_SLOTS(fb, nFreeFifoSlots, 8);
731 NGLE_QUICK_SET_DST_BM_ACCESS(fb, 731 NGLE_QUICK_SET_DST_BM_ACCESS(fb,
732 BA(IndexedDcd, Otc04, Ots08, AddrLong,732 BA(IndexedDcd, Otc04, Ots08, AddrLong,
733 BAJustPoint(0), BINovly, BAIndexBase(0)));733 BAJustPoint(0), BINovly, BAIndexBase(0)));
734 734
@@ -736,23 +736,23 @@ ngleClearOverlayPlanes(struct stifb_info *fb, int mask, int data) · 1 unmodified line
736 736
737 NGLE_REALLY_SET_IMAGE_FG_COLOR(fb, data);737 NGLE_REALLY_SET_IMAGE_FG_COLOR(fb, data);
738 NGLE_REALLY_SET_IMAGE_PLANEMASK(fb, mask);738 NGLE_REALLY_SET_IMAGE_PLANEMASK(fb, mask);
739 739
740 packed_dst = 0;740 packed_dst = 0;
741 packed_len = (fb->info.var.xres << 16) | fb->info.var.yres;741 packed_len = (fb->info.var.xres << 16) | fb->info.var.yres;
742 NGLE_SET_DSTXY(fb, packed_dst);742 NGLE_SET_DSTXY(fb, packed_dst);
743 743
744 /* Write zeroes to overlay planes */ 744 /* Write zeroes to overlay planes */
745 NGLE_QUICK_SET_IMAGE_BITMAP_OP(fb,745 NGLE_QUICK_SET_IMAGE_BITMAP_OP(fb,
746 IBOvals(RopSrc, MaskAddrOffset(0),746 IBOvals(RopSrc, MaskAddrOffset(0),
747 BitmapExtent08, StaticReg(0),747 BitmapExtent08, StaticReg(0),
748 DataDynamic, MaskOtc, BGx(0), FGx(0)));748 DataDynamic, MaskOtc, BGx(0), FGx(0)));
749 749
750 SET_LENXY_START_RECFILL(fb, packed_len);750 SET_LENXY_START_RECFILL(fb, packed_len);
751 751
752 NGLE_UNLOCK(fb);752 NGLE_UNLOCK(fb);
753}753}
754 754
755static void 755static void
756hyperResetPlanes(struct stifb_info *fb, int enable)756hyperResetPlanes(struct stifb_info *fb, int enable)
757{757{
758 unsigned int controlPlaneReg;758 unsigned int controlPlaneReg;
@@ -783,7 +783,7 @@ hyperResetPlanes(struct stifb_info *fb, int enable) · 24 unmodified lines
783 ngleClearOverlayPlanes(fb, 0xff, 255);783 ngleClearOverlayPlanes(fb, 0xff, 255);
784 784
785 /**************************************************785 /**************************************************
786 ** Also need to counteract ITE settings 786 ** Also need to counteract ITE settings
787 **************************************************/787 **************************************************/
788 hyperUndoITE(fb);788 hyperUndoITE(fb);
789 break;789 break;
@@ -803,13 +803,13 @@ hyperResetPlanes(struct stifb_info *fb, int enable) · 13 unmodified lines
803 ngleResetAttrPlanes(fb, controlPlaneReg);803 ngleResetAttrPlanes(fb, controlPlaneReg);
804 break;804 break;
805 }805 }
806 806
807 NGLE_UNLOCK(fb);807 NGLE_UNLOCK(fb);
808}808}
809 809
810/* Return pointer to in-memory structure holding ELK device-dependent ROM values. */810/* Return pointer to in-memory structure holding ELK device-dependent ROM values. */
811 811
812static void 812static void
813ngleGetDeviceRomData(struct stifb_info *fb)813ngleGetDeviceRomData(struct stifb_info *fb)
814{814{
815#if 0815#if 0
@@ -821,7 +821,7 @@ XXX: FIXME: !!! · 5 unmodified lines
821 char *pCard8;821 char *pCard8;
822 int i;822 int i;
823 char *mapOrigin = NULL;823 char *mapOrigin = NULL;
824 824
825 int romTableIdx;825 int romTableIdx;
826 826
827 pPackedDevRomData = fb->ngle_rom;827 pPackedDevRomData = fb->ngle_rom;
@@ -888,7 +888,7 @@ SETUP_HCRX(struct stifb_info *fb) · 60 unmodified lines
888 888
889 /* Initialize Hyperbowl registers */889 /* Initialize Hyperbowl registers */
890 GET_FIFO_SLOTS(fb, nFreeFifoSlots, 7);890 GET_FIFO_SLOTS(fb, nFreeFifoSlots, 7);
891 891
892 if (IS_24_DEVICE(fb)) {892 if (IS_24_DEVICE(fb)) {
893 hyperbowl = (fb->info.var.bits_per_pixel == 32) ?893 hyperbowl = (fb->info.var.bits_per_pixel == 32) ?
894 HYPERBOWL_MODE01_8_24_LUT0_TRANSPARENT_LUT1_OPAQUE :894 HYPERBOWL_MODE01_8_24_LUT0_TRANSPARENT_LUT1_OPAQUE :
@@ -897,9 +897,9 @@ SETUP_HCRX(struct stifb_info *fb) · 2 unmodified lines
897 /* First write to Hyperbowl must happen twice (bug) */897 /* First write to Hyperbowl must happen twice (bug) */
898 WRITE_WORD(hyperbowl, fb, REG_40);898 WRITE_WORD(hyperbowl, fb, REG_40);
899 WRITE_WORD(hyperbowl, fb, REG_40);899 WRITE_WORD(hyperbowl, fb, REG_40);
900 900
901 WRITE_WORD(HYPERBOWL_MODE2_8_24, fb, REG_39);901 WRITE_WORD(HYPERBOWL_MODE2_8_24, fb, REG_39);
902 902
903 WRITE_WORD(0x014c0148, fb, REG_42); /* Set lut 0 to be the direct color */903 WRITE_WORD(0x014c0148, fb, REG_42); /* Set lut 0 to be the direct color */
904 WRITE_WORD(0x404c4048, fb, REG_43);904 WRITE_WORD(0x404c4048, fb, REG_43);
905 WRITE_WORD(0x034c0348, fb, REG_44);905 WRITE_WORD(0x034c0348, fb, REG_44);
@@ -990,7 +990,7 @@ stifb_setcolreg(u_int regno, u_int red, u_int green, · 84 unmodified lines
990 0, /* Offset w/i LUT */990 0, /* Offset w/i LUT */
991 256); /* Load entire LUT */991 256); /* Load entire LUT */
992 NGLE_BINC_SET_SRCADDR(fb,992 NGLE_BINC_SET_SRCADDR(fb,
993 NGLE_LONG_FB_ADDRESS(0, 0x100, 0)); 993 NGLE_LONG_FB_ADDRESS(0, 0x100, 0));
994 /* 0x100 is same as used in WRITE_IMAGE_COLOR() */994 /* 0x100 is same as used in WRITE_IMAGE_COLOR() */
995 START_COLORMAPLOAD(fb, lutBltCtl.all);995 START_COLORMAPLOAD(fb, lutBltCtl.all);
996 SETUP_FB(fb);996 SETUP_FB(fb);
@@ -1028,7 +1028,7 @@ stifb_blank(int blank_mode, struct fb_info *info) · 31 unmodified lines
1028 ENABLE_DISABLE_DISPLAY(fb, enable);1028 ENABLE_DISABLE_DISPLAY(fb, enable);
1029 break;1029 break;
1030 }1030 }
1031 1031
1032 SETUP_FB(fb);1032 SETUP_FB(fb);
1033 return 0;1033 return 0;
1034}1034}
@@ -1114,15 +1114,15 @@ stifb_init_display(struct stifb_info *fb) · 79 unmodified lines
1114 1114
1115 /* HCRX specific initialization */1115 /* HCRX specific initialization */
1116 SETUP_HCRX(fb);1116 SETUP_HCRX(fb);
1117 1117
1118 /*1118 /*
1119 if (id == S9000_ID_HCRX)1119 if (id == S9000_ID_HCRX)
1120 hyperInitSprite(fb);1120 hyperInitSprite(fb);
1121 else1121 else
1122 ngleInitSprite(fb);1122 ngleInitSprite(fb);
1123 */1123 */
1124 1124
1125 /* Initialize the image planes. */ 1125 /* Initialize the image planes. */
1126 switch (id) {1126 switch (id) {
1127 case S9000_ID_HCRX:1127 case S9000_ID_HCRX:
1128 hyperResetPlanes(fb, ENABLE);1128 hyperResetPlanes(fb, ENABLE);
@@ -1194,7 +1194,7 @@ static int __init stifb_init_fb(struct sti_struct *sti, int bpp_pref) · 65 unmodified lines
1194 fb = kzalloc(sizeof(*fb), GFP_ATOMIC);1194 fb = kzalloc(sizeof(*fb), GFP_ATOMIC);
1195 if (!fb)1195 if (!fb)
1196 return -ENOMEM;1196 return -ENOMEM;
1197 1197
1198 info = &fb->info;1198 info = &fb->info;
1199 1199
1200 /* set struct to a known state */1200 /* set struct to a known state */
@@ -1235,7 +1235,7 @@ static int __init stifb_init_fb(struct sti_struct *sti, int bpp_pref) · 34 unmodified lines
1235 dev_name, fb->id);1235 dev_name, fb->id);
1236 goto out_err0;1236 goto out_err0;
1237 }1237 }
1238 1238
1239 /* default to 8 bpp on most graphic chips */1239 /* default to 8 bpp on most graphic chips */
1240 bpp = 8;1240 bpp = 8;
1241 xres = sti_onscreen_x(fb->sti);1241 xres = sti_onscreen_x(fb->sti);
@@ -1256,7 +1256,7 @@ static int __init stifb_init_fb(struct sti_struct *sti, int bpp_pref) · 14 unmodified lines
1256 fb->id = S9000_ID_A1659A;1256 fb->id = S9000_ID_A1659A;
1257 break;1257 break;
1258 case S9000_ID_TIMBER: /* HP9000/710 Any (may be a grayscale device) */1258 case S9000_ID_TIMBER: /* HP9000/710 Any (may be a grayscale device) */
1259 if (strstr(dev_name, "GRAYSCALE") || 1259 if (strstr(dev_name, "GRAYSCALE") ||
1260 strstr(dev_name, "Grayscale") ||1260 strstr(dev_name, "Grayscale") ||
1261 strstr(dev_name, "grayscale"))1261 strstr(dev_name, "grayscale"))
1262 var->grayscale = 1;1262 var->grayscale = 1;
@@ -1295,16 +1295,16 @@ static int __init stifb_init_fb(struct sti_struct *sti, int bpp_pref) · 32 unmodified lines
1295 case CRT_ID_VISUALIZE_EG:1295 case CRT_ID_VISUALIZE_EG:
1296 case S9000_ID_ARTIST: /* Artist */1296 case S9000_ID_ARTIST: /* Artist */
1297 break;1297 break;
1298 default: 1298 default:
1299#ifdef FALLBACK_TO_1BPP1299#ifdef FALLBACK_TO_1BPP
1300 printk(KERN_WARNING 1300 printk(KERN_WARNING
1301 "stifb: Unsupported graphics card (id=0x%08x) "1301 "stifb: Unsupported graphics card (id=0x%08x) "
1302 "- now trying 1bpp mode instead\n",1302 "- now trying 1bpp mode instead\n",
1303 fb->id);1303 fb->id);
1304 bpp = 1; /* default to 1 bpp */1304 bpp = 1; /* default to 1 bpp */
1305 break;1305 break;
1306#else1306#else
1307 printk(KERN_WARNING 1307 printk(KERN_WARNING
1308 "stifb: Unsupported graphics card (id=0x%08x) "1308 "stifb: Unsupported graphics card (id=0x%08x) "
1309 "- skipping.\n",1309 "- skipping.\n",
1310 fb->id);1310 fb->id);
@@ -1320,11 +1320,11 @@ static int __init stifb_init_fb(struct sti_struct *sti, int bpp_pref) · 9 unmodified lines
1320 fix->line_length = (fb->sti->glob_cfg->total_x * bpp) / 8;1320 fix->line_length = (fb->sti->glob_cfg->total_x * bpp) / 8;
1321 if (!fix->line_length)1321 if (!fix->line_length)
1322 fix->line_length = 2048; /* default */1322 fix->line_length = 2048; /* default */
1323 1323
1324 /* limit fbsize to max visible screen size */1324 /* limit fbsize to max visible screen size */
1325 if (fix->smem_len > yres*fix->line_length)1325 if (fix->smem_len > yres*fix->line_length)
1326 fix->smem_len = ALIGN(yres*fix->line_length, 4*1024*1024);1326 fix->smem_len = ALIGN(yres*fix->line_length, 4*1024*1024);
1327 1327
1328 fix->accel = FB_ACCEL_NONE;1328 fix->accel = FB_ACCEL_NONE;
1329 1329
1330 switch (bpp) {1330 switch (bpp) {
@@ -1350,7 +1350,7 @@ static int __init stifb_init_fb(struct sti_struct *sti, int bpp_pref) · 19 unmodified lines
1350 default:1350 default:
1351 break;1351 break;
1352 }1352 }
1353 1353
1354 var->xres = var->xres_virtual = xres;1354 var->xres = var->xres_virtual = xres;
1355 var->yres = var->yres_virtual = yres;1355 var->yres = var->yres_virtual = yres;
1356 var->bits_per_pixel = bpp;1356 var->bits_per_pixel = bpp;
@@ -1379,7 +1379,7 @@ static int __init stifb_init_fb(struct sti_struct *sti, int bpp_pref) · 22 unmodified lines
1379 fix->smem_start, fix->smem_start+fix->smem_len);1379 fix->smem_start, fix->smem_start+fix->smem_len);
1380 goto out_err2;1380 goto out_err2;
1381 }1381 }
1382 1382
1383 if (!request_mem_region(fix->mmio_start, fix->mmio_len, "stifb mmio")) {1383 if (!request_mem_region(fix->mmio_start, fix->mmio_len, "stifb mmio")) {
1384 printk(KERN_ERR "stifb: cannot reserve sti mmio region 0x%04lx-0x%04lx\n",1384 printk(KERN_ERR "stifb: cannot reserve sti mmio region 0x%04lx-0x%04lx\n",
1385 fix->mmio_start, fix->mmio_start+fix->mmio_len);1385 fix->mmio_start, fix->mmio_start+fix->mmio_len);
@@ -1393,11 +1393,11 @@ static int __init stifb_init_fb(struct sti_struct *sti, int bpp_pref) · 7 unmodified lines
1393 1393
1394 fb_info(&fb->info, "%s %dx%d-%d frame buffer device, %s, id: %04x, mmio: 0x%04lx\n",1394 fb_info(&fb->info, "%s %dx%d-%d frame buffer device, %s, id: %04x, mmio: 0x%04lx\n",
1395 fix->id,1395 fix->id,
1396 var->xres, 1396 var->xres,
1397 var->yres,1397 var->yres,
1398 var->bits_per_pixel,1398 var->bits_per_pixel,
1399 dev_name,1399 dev_name,
1400 fb->id, 1400 fb->id,
1401 fix->mmio_start);1401 fix->mmio_start);
1402 1402
1403 return 0;1403 return 0;
@@ -1413,6 +1413,7 @@ out_err1: · 9 unmodified lines
1413 iounmap(info->screen_base);1413 iounmap(info->screen_base);
1414out_err0:1414out_err0:
1415 kfree(fb);1415 kfree(fb);
1416 sti->info = NULL;
1416 return -ENXIO;1417 return -ENXIO;
1417}1418}
1418 1419
@@ -1426,7 +1427,7 @@ static int __init stifb_init(void) · 7 unmodified lines
1426 struct sti_struct *sti;1427 struct sti_struct *sti;
1427 struct sti_struct *def_sti;1428 struct sti_struct *def_sti;
1428 int i;1429 int i;
1429 1430
1430#ifndef MODULE1431#ifndef MODULE
1431 char *option = NULL;1432 char *option = NULL;
1432 1433
@@ -1438,7 +1439,7 @@ static int __init stifb_init(void) · 5 unmodified lines
1438 printk(KERN_INFO "stifb: disabled by \"stifb=off\" kernel parameter\n");1439 printk(KERN_INFO "stifb: disabled by \"stifb=off\" kernel parameter\n");
1439 return -ENXIO;1440 return -ENXIO;
1440 }1441 }
1441 1442
1442 def_sti = sti_get_rom(0);1443 def_sti = sti_get_rom(0);
1443 if (def_sti) {1444 if (def_sti) {
1444 for (i = 1; i <= MAX_STI_ROMS; i++) {1445 for (i = 1; i <= MAX_STI_ROMS; i++) {
@@ -1472,7 +1473,7 @@ stifb_cleanup(void) · 27 unmodified lines
1472{1473{
1473 struct sti_struct *sti;1474 struct sti_struct *sti;
1474 int i;1475 int i;
1475 1476
1476 for (i = 1; i <= MAX_STI_ROMS; i++) {1477 for (i = 1; i <= MAX_STI_ROMS; i++) {
1477 sti = sti_get_rom(i);1478 sti = sti_get_rom(i);
1478 if (!sti)1479 if (!sti)
@@ -1495,10 +1496,10 @@ int __init · 16 unmodified lines
1495stifb_setup(char *options)1496stifb_setup(char *options)
1496{1497{
1497 int i;1498 int i;
1498 1499
1499 if (!options || !*options)1500 if (!options || !*options)
1500 return 1;1501 return 1;
1501 1502
1502 if (strncmp(options, "off", 3) == 0) {1503 if (strncmp(options, "off", 3) == 0) {
1503 stifb_disabled = 1;1504 stifb_disabled = 1;
1504 options += 3;1505 options += 3;
drivers/video/fbdev/valkyriefb.c+7−7
@@ -1,7 +1,7 @@
1/*1/*
2 * valkyriefb.c -- frame buffer device for the PowerMac 'valkyrie' display2 * valkyriefb.c -- frame buffer device for the PowerMac 'valkyrie' display
3 *3 *
4 * Created 8 August 1998 by 4 * Created 8 August 1998 by
5 * Martin Costabel <costabel@wanadoo.fr> and Kevin Schoedel5 * Martin Costabel <costabel@wanadoo.fr> and Kevin Schoedel
6 *6 *
7 * Vmode-switching changes and vmode 15/17 modifications created 29 August7 * Vmode-switching changes and vmode 15/17 modifications created 29 August
@@ -77,13 +77,13 @@ struct fb_info_valkyrie { · 69 unmodified lines
77 struct fb_par_valkyrie par;77 struct fb_par_valkyrie par;
78 struct cmap_regs __iomem *cmap_regs;78 struct cmap_regs __iomem *cmap_regs;
79 unsigned long cmap_regs_phys;79 unsigned long cmap_regs_phys;
80 80
81 struct valkyrie_regs __iomem *valkyrie_regs;81 struct valkyrie_regs __iomem *valkyrie_regs;
82 unsigned long valkyrie_regs_phys;82 unsigned long valkyrie_regs_phys;
83 83
84 __u8 __iomem *frame_buffer;84 __u8 __iomem *frame_buffer;
85 unsigned long frame_buffer_phys;85 unsigned long frame_buffer_phys;
86 86
87 int sense;87 int sense;
88 unsigned long total_vram;88 unsigned long total_vram;
89 89
@@ -244,7 +244,7 @@ static inline int valkyrie_vram_reqd(int video_mode, int color_mode) · 154 unmodified lines
244{244{
245 int pitch;245 int pitch;
246 struct valkyrie_regvals *init = valkyrie_reg_init[video_mode-1];246 struct valkyrie_regvals *init = valkyrie_reg_init[video_mode-1];
247 247
248 if ((pitch = init->pitch[color_mode]) == 0)248 if ((pitch = init->pitch[color_mode]) == 0)
249 pitch = 2 * init->pitch[0];249 pitch = 2 * init->pitch[0];
250 return init->vres * pitch;250 return init->vres * pitch;
@@ -467,7 +467,7 @@ static int valkyrie_var_to_par(struct fb_var_screeninfo *var, · 216 unmodified lines
467 printk(KERN_ERR "valkyriefb: vmode %d not valid.\n", vmode);467 printk(KERN_ERR "valkyriefb: vmode %d not valid.\n", vmode);
468 return -EINVAL;468 return -EINVAL;
469 }469 }
470 470
471 if (cmode != CMODE_8 && cmode != CMODE_16) {471 if (cmode != CMODE_8 && cmode != CMODE_16) {
472 printk(KERN_ERR "valkyriefb: cmode %d not valid.\n", cmode);472 printk(KERN_ERR "valkyriefb: cmode %d not valid.\n", cmode);
473 return -EINVAL;473 return -EINVAL;
@@ -516,7 +516,7 @@ static void valkyrie_init_fix(struct fb_fix_screeninfo *fix, struct fb_info_valk · 42 unmodified lines
516 fix->ywrapstep = 0;516 fix->ywrapstep = 0;
517 fix->ypanstep = 0;517 fix->ypanstep = 0;
518 fix->xpanstep = 0;518 fix->xpanstep = 0;
519 519
520}520}
521 521
522/* Fix must already be inited above */522/* Fix must already be inited above */
drivers/video/fbdev/vfb.c+5−5
@@ -111,7 +111,7 @@ static u_long get_line_length(int xres_virtual, int bpp) · 110 unmodified lines
111 * First part, xxxfb_check_var, must not write anything111 * First part, xxxfb_check_var, must not write anything
112 * to hardware, it should only verify and adjust var.112 * to hardware, it should only verify and adjust var.
113 * This means it doesn't alter par but it does use hardware113 * This means it doesn't alter par but it does use hardware
114 * data from it to check this var. 114 * data from it to check this var.
115 */115 */
116 116
117static int vfb_check_var(struct fb_var_screeninfo *var,117static int vfb_check_var(struct fb_var_screeninfo *var,
@@ -169,7 +169,7 @@ static int vfb_check_var(struct fb_var_screeninfo *var, · 51 unmodified lines
169 169
170 /*170 /*
171 * Now that we checked it we alter var. The reason being is that the video171 * Now that we checked it we alter var. The reason being is that the video
172 * mode passed in might not work but slight changes to it might make it 172 * mode passed in might not work but slight changes to it might make it
173 * work. This way we let the user know what is acceptable.173 * work. This way we let the user know what is acceptable.
174 */174 */
175 switch (var->bits_per_pixel) {175 switch (var->bits_per_pixel) {
@@ -235,8 +235,8 @@ static int vfb_check_var(struct fb_var_screeninfo *var, · 59 unmodified lines
235}235}
236 236
237/* This routine actually sets the video mode. It's in here where we237/* This routine actually sets the video mode. It's in here where we
238 * the hardware state info->par and fix which can be affected by the 238 * the hardware state info->par and fix which can be affected by the
239 * change in par. For this driver it doesn't do much. 239 * change in par. For this driver it doesn't do much.
240 */240 */
241static int vfb_set_par(struct fb_info *info)241static int vfb_set_par(struct fb_info *info)
242{242{
@@ -379,7 +379,7 @@ static int vfb_pan_display(struct fb_var_screeninfo *var, · 136 unmodified lines
379}379}
380 380
381 /*381 /*
382 * Most drivers don't need their own mmap function 382 * Most drivers don't need their own mmap function
383 */383 */
384 384
385static int vfb_mmap(struct fb_info *info,385static int vfb_mmap(struct fb_info *info,