aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/video')
-rw-r--r--drivers/video/arcfb.c5
-rw-r--r--drivers/video/aty/aty128fb.c7
-rw-r--r--drivers/video/aty/radeon_monitor.c4
-rw-r--r--drivers/video/backlight/backlight.c2
-rw-r--r--drivers/video/backlight/lcd.c2
-rw-r--r--drivers/video/imsttfb.c2
-rw-r--r--drivers/video/intelfb/intelfbdrv.c50
-rw-r--r--drivers/video/kyro/STG4000VTG.c2
-rw-r--r--drivers/video/neofb.c4
-rw-r--r--drivers/video/s1d13xxxfb.c3
-rw-r--r--drivers/video/savage/savagefb_driver.c2
-rw-r--r--drivers/video/tdfxfb.c42
12 files changed, 67 insertions, 58 deletions
diff --git a/drivers/video/arcfb.c b/drivers/video/arcfb.c
index df8e5667b348..466042808daf 100644
--- a/drivers/video/arcfb.c
+++ b/drivers/video/arcfb.c
@@ -253,7 +253,7 @@ static void arcfb_lcd_update_page(struct arcfb_par *par, unsigned int upper,
253{ 253{
254 unsigned char *src; 254 unsigned char *src;
255 unsigned int xindex, yindex, chipindex, linesize; 255 unsigned int xindex, yindex, chipindex, linesize;
256 int i, count; 256 int i;
257 unsigned char val; 257 unsigned char val;
258 unsigned char bitmask, rightshift; 258 unsigned char bitmask, rightshift;
259 259
@@ -282,7 +282,6 @@ static void arcfb_lcd_update_page(struct arcfb_par *par, unsigned int upper,
282 } 282 }
283 ks108_writeb_data(par, chipindex, val); 283 ks108_writeb_data(par, chipindex, val);
284 left++; 284 left++;
285 count++;
286 if (bitmask == 0x80) { 285 if (bitmask == 0x80) {
287 bitmask = 1; 286 bitmask = 1;
288 src++; 287 src++;
@@ -460,11 +459,11 @@ static ssize_t arcfb_write(struct file *file, const char __user *buf, size_t cou
460 inode = file->f_dentry->d_inode; 459 inode = file->f_dentry->d_inode;
461 fbidx = iminor(inode); 460 fbidx = iminor(inode);
462 info = registered_fb[fbidx]; 461 info = registered_fb[fbidx];
463 par = info->par;
464 462
465 if (!info || !info->screen_base) 463 if (!info || !info->screen_base)
466 return -ENODEV; 464 return -ENODEV;
467 465
466 par = info->par;
468 xres = info->var.xres; 467 xres = info->var.xres;
469 fbmemlength = (xres * info->var.yres)/8; 468 fbmemlength = (xres * info->var.yres)/8;
470 469
diff --git a/drivers/video/aty/aty128fb.c b/drivers/video/aty/aty128fb.c
index bfc8a93b2c73..620c9a934e0e 100644
--- a/drivers/video/aty/aty128fb.c
+++ b/drivers/video/aty/aty128fb.c
@@ -1326,7 +1326,7 @@ static int aty128_var_to_pll(u32 period_in_ps, struct aty128_pll *pll,
1326 unsigned char post_dividers[] = {1,2,4,8,3,6,12}; 1326 unsigned char post_dividers[] = {1,2,4,8,3,6,12};
1327 u32 output_freq; 1327 u32 output_freq;
1328 u32 vclk; /* in .01 MHz */ 1328 u32 vclk; /* in .01 MHz */
1329 int i; 1329 int i = 0;
1330 u32 n, d; 1330 u32 n, d;
1331 1331
1332 vclk = 100000000 / period_in_ps; /* convert units to 10 kHz */ 1332 vclk = 100000000 / period_in_ps; /* convert units to 10 kHz */
@@ -1340,15 +1340,16 @@ static int aty128_var_to_pll(u32 period_in_ps, struct aty128_pll *pll,
1340 /* now, find an acceptable divider */ 1340 /* now, find an acceptable divider */
1341 for (i = 0; i < sizeof(post_dividers); i++) { 1341 for (i = 0; i < sizeof(post_dividers); i++) {
1342 output_freq = post_dividers[i] * vclk; 1342 output_freq = post_dividers[i] * vclk;
1343 if (output_freq >= c.ppll_min && output_freq <= c.ppll_max) 1343 if (output_freq >= c.ppll_min && output_freq <= c.ppll_max) {
1344 pll->post_divider = post_dividers[i];
1344 break; 1345 break;
1346 }
1345 } 1347 }
1346 1348
1347 /* calculate feedback divider */ 1349 /* calculate feedback divider */
1348 n = c.ref_divider * output_freq; 1350 n = c.ref_divider * output_freq;
1349 d = c.ref_clk; 1351 d = c.ref_clk;
1350 1352
1351 pll->post_divider = post_dividers[i];
1352 pll->feedback_divider = round_div(n, d); 1353 pll->feedback_divider = round_div(n, d);
1353 pll->vclk = vclk; 1354 pll->vclk = vclk;
1354 1355
diff --git a/drivers/video/aty/radeon_monitor.c b/drivers/video/aty/radeon_monitor.c
index 7f9838dceab5..98c05bc0de44 100644
--- a/drivers/video/aty/radeon_monitor.c
+++ b/drivers/video/aty/radeon_monitor.c
@@ -396,6 +396,10 @@ static int __devinit radeon_parse_monitor_layout(struct radeonfb_info *rinfo,
396 s1[i] = *s; 396 s1[i] = *s;
397 i++; 397 i++;
398 } 398 }
399
400 if (i > 4)
401 i = 4;
402
399 } while (*s++); 403 } while (*s++);
400 if (second) 404 if (second)
401 s2[i] = 0; 405 s2[i] = 0;
diff --git a/drivers/video/backlight/backlight.c b/drivers/video/backlight/backlight.c
index bd39bbd88d41..151fda8dded0 100644
--- a/drivers/video/backlight/backlight.c
+++ b/drivers/video/backlight/backlight.c
@@ -172,7 +172,7 @@ struct backlight_device *backlight_device_register(const char *name, void *devda
172 172
173 new_bd = kmalloc(sizeof(struct backlight_device), GFP_KERNEL); 173 new_bd = kmalloc(sizeof(struct backlight_device), GFP_KERNEL);
174 if (unlikely(!new_bd)) 174 if (unlikely(!new_bd))
175 return ERR_PTR(ENOMEM); 175 return ERR_PTR(-ENOMEM);
176 176
177 init_MUTEX(&new_bd->sem); 177 init_MUTEX(&new_bd->sem);
178 new_bd->props = bp; 178 new_bd->props = bp;
diff --git a/drivers/video/backlight/lcd.c b/drivers/video/backlight/lcd.c
index 9e32485ee7bb..86908a60c630 100644
--- a/drivers/video/backlight/lcd.c
+++ b/drivers/video/backlight/lcd.c
@@ -171,7 +171,7 @@ struct lcd_device *lcd_device_register(const char *name, void *devdata,
171 171
172 new_ld = kmalloc(sizeof(struct lcd_device), GFP_KERNEL); 172 new_ld = kmalloc(sizeof(struct lcd_device), GFP_KERNEL);
173 if (unlikely(!new_ld)) 173 if (unlikely(!new_ld))
174 return ERR_PTR(ENOMEM); 174 return ERR_PTR(-ENOMEM);
175 175
176 init_MUTEX(&new_ld->sem); 176 init_MUTEX(&new_ld->sem);
177 new_ld->props = lp; 177 new_ld->props = lp;
diff --git a/drivers/video/imsttfb.c b/drivers/video/imsttfb.c
index ad416ae47596..7db42542eb19 100644
--- a/drivers/video/imsttfb.c
+++ b/drivers/video/imsttfb.c
@@ -1510,6 +1510,8 @@ imsttfb_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
1510 default: 1510 default:
1511 printk(KERN_INFO "imsttfb: Device 0x%x unknown, " 1511 printk(KERN_INFO "imsttfb: Device 0x%x unknown, "
1512 "contact maintainer.\n", pdev->device); 1512 "contact maintainer.\n", pdev->device);
1513 release_mem_region(addr, size);
1514 framebuffer_release(info);
1513 return -ENODEV; 1515 return -ENODEV;
1514 } 1516 }
1515 1517
diff --git a/drivers/video/intelfb/intelfbdrv.c b/drivers/video/intelfb/intelfbdrv.c
index 6b8bd3cdf9c0..995b47c165a7 100644
--- a/drivers/video/intelfb/intelfbdrv.c
+++ b/drivers/video/intelfb/intelfbdrv.c
@@ -1333,33 +1333,35 @@ intelfb_setcolreg(unsigned regno, unsigned red, unsigned green,
1333 if (regno > 255) 1333 if (regno > 255)
1334 return 1; 1334 return 1;
1335 1335
1336 switch (dinfo->depth) { 1336 if (dinfo->depth == 8) {
1337 case 8: 1337 red >>= 8;
1338 { 1338 green >>= 8;
1339 red >>= 8; 1339 blue >>= 8;
1340 green >>= 8; 1340
1341 blue >>= 8; 1341 intelfbhw_setcolreg(dinfo, regno, red, green, blue,
1342 transp);
1343 }
1342 1344
1343 intelfbhw_setcolreg(dinfo, regno, red, green, blue, 1345 if (regno < 16) {
1344 transp); 1346 switch (dinfo->depth) {
1347 case 15:
1348 dinfo->pseudo_palette[regno] = ((red & 0xf800) >> 1) |
1349 ((green & 0xf800) >> 6) |
1350 ((blue & 0xf800) >> 11);
1351 break;
1352 case 16:
1353 dinfo->pseudo_palette[regno] = (red & 0xf800) |
1354 ((green & 0xfc00) >> 5) |
1355 ((blue & 0xf800) >> 11);
1356 break;
1357 case 24:
1358 dinfo->pseudo_palette[regno] = ((red & 0xff00) << 8) |
1359 (green & 0xff00) |
1360 ((blue & 0xff00) >> 8);
1361 break;
1345 } 1362 }
1346 break;
1347 case 15:
1348 dinfo->pseudo_palette[regno] = ((red & 0xf800) >> 1) |
1349 ((green & 0xf800) >> 6) |
1350 ((blue & 0xf800) >> 11);
1351 break;
1352 case 16:
1353 dinfo->pseudo_palette[regno] = (red & 0xf800) |
1354 ((green & 0xfc00) >> 5) |
1355 ((blue & 0xf800) >> 11);
1356 break;
1357 case 24:
1358 dinfo->pseudo_palette[regno] = ((red & 0xff00) << 8) |
1359 (green & 0xff00) |
1360 ((blue & 0xff00) >> 8);
1361 break;
1362 } 1363 }
1364
1363 return 0; 1365 return 0;
1364} 1366}
1365 1367
diff --git a/drivers/video/kyro/STG4000VTG.c b/drivers/video/kyro/STG4000VTG.c
index 3690b04190af..bd389709d234 100644
--- a/drivers/video/kyro/STG4000VTG.c
+++ b/drivers/video/kyro/STG4000VTG.c
@@ -17,7 +17,7 @@
17void DisableVGA(volatile STG4000REG __iomem *pSTGReg) 17void DisableVGA(volatile STG4000REG __iomem *pSTGReg)
18{ 18{
19 u32 tmp; 19 u32 tmp;
20 volatile u32 count, i; 20 volatile u32 count = 0, i;
21 21
22 /* Reset the VGA registers */ 22 /* Reset the VGA registers */
23 tmp = STG_READ_REG(SoftwareReset); 23 tmp = STG_READ_REG(SoftwareReset);
diff --git a/drivers/video/neofb.c b/drivers/video/neofb.c
index a2e201dc40f7..b961d5601bd9 100644
--- a/drivers/video/neofb.c
+++ b/drivers/video/neofb.c
@@ -486,10 +486,8 @@ static void vgaHWRestore(const struct fb_info *info,
486static inline int neo2200_sync(struct fb_info *info) 486static inline int neo2200_sync(struct fb_info *info)
487{ 487{
488 struct neofb_par *par = info->par; 488 struct neofb_par *par = info->par;
489 int waitcycles;
490 489
491 while (readl(&par->neo2200->bltStat) & 1) 490 while (readl(&par->neo2200->bltStat) & 1);
492 waitcycles++;
493 return 0; 491 return 0;
494} 492}
495 493
diff --git a/drivers/video/s1d13xxxfb.c b/drivers/video/s1d13xxxfb.c
index e5d0f92eeae3..feec47bdd479 100644
--- a/drivers/video/s1d13xxxfb.c
+++ b/drivers/video/s1d13xxxfb.c
@@ -588,6 +588,7 @@ s1d13xxxfb_probe(struct platform_device *pdev)
588 goto bail; 588 goto bail;
589 } 589 }
590 590
591 platform_set_drvdata(pdev, info);
591 default_par = info->par; 592 default_par = info->par;
592 default_par->regs = ioremap_nocache(pdev->resource[1].start, 593 default_par->regs = ioremap_nocache(pdev->resource[1].start,
593 pdev->resource[1].end - pdev->resource[1].start +1); 594 pdev->resource[1].end - pdev->resource[1].start +1);
@@ -638,8 +639,6 @@ s1d13xxxfb_probe(struct platform_device *pdev)
638 goto bail; 639 goto bail;
639 } 640 }
640 641
641 platform_set_drvdata(pdev, info);
642
643 printk(KERN_INFO "fb%d: %s frame buffer device\n", 642 printk(KERN_INFO "fb%d: %s frame buffer device\n",
644 info->node, info->fix.id); 643 info->node, info->fix.id);
645 644
diff --git a/drivers/video/savage/savagefb_driver.c b/drivers/video/savage/savagefb_driver.c
index ab727eaa7f43..10e6b3aab9ea 100644
--- a/drivers/video/savage/savagefb_driver.c
+++ b/drivers/video/savage/savagefb_driver.c
@@ -2021,8 +2021,8 @@ static int __devinit savagefb_probe (struct pci_dev* dev,
2021#if defined(CONFIG_FB_SAVAGE_I2C) 2021#if defined(CONFIG_FB_SAVAGE_I2C)
2022 savagefb_create_i2c_busses(info); 2022 savagefb_create_i2c_busses(info);
2023 savagefb_probe_i2c_connector(info, &par->edid); 2023 savagefb_probe_i2c_connector(info, &par->edid);
2024 kfree(par->edid);
2025 fb_edid_to_monspecs(par->edid, &info->monspecs); 2024 fb_edid_to_monspecs(par->edid, &info->monspecs);
2025 kfree(par->edid);
2026 fb_videomode_to_modelist(info->monspecs.modedb, 2026 fb_videomode_to_modelist(info->monspecs.modedb,
2027 info->monspecs.modedb_len, 2027 info->monspecs.modedb_len,
2028 &info->modelist); 2028 &info->modelist);
diff --git a/drivers/video/tdfxfb.c b/drivers/video/tdfxfb.c
index 3e7baf4c9fa8..5e5328d682db 100644
--- a/drivers/video/tdfxfb.c
+++ b/drivers/video/tdfxfb.c
@@ -786,28 +786,32 @@ static int tdfxfb_setcolreg(unsigned regno, unsigned red, unsigned green,
786 if (regno >= info->cmap.len || regno > 255) return 1; 786 if (regno >= info->cmap.len || regno > 255) return 1;
787 787
788 switch (info->fix.visual) { 788 switch (info->fix.visual) {
789 case FB_VISUAL_PSEUDOCOLOR: 789 case FB_VISUAL_PSEUDOCOLOR:
790 rgbcol =(((u32)red & 0xff00) << 8) | 790 rgbcol =(((u32)red & 0xff00) << 8) |
791 (((u32)green & 0xff00) << 0) | 791 (((u32)green & 0xff00) << 0) |
792 (((u32)blue & 0xff00) >> 8); 792 (((u32)blue & 0xff00) >> 8);
793 do_setpalentry(par, regno, rgbcol); 793 do_setpalentry(par, regno, rgbcol);
794 break; 794 break;
795 /* Truecolor has no hardware color palettes. */ 795 /* Truecolor has no hardware color palettes. */
796 case FB_VISUAL_TRUECOLOR: 796 case FB_VISUAL_TRUECOLOR:
797 if (regno < 16) {
797 rgbcol = (CNVT_TOHW( red, info->var.red.length) << 798 rgbcol = (CNVT_TOHW( red, info->var.red.length) <<
798 info->var.red.offset) | 799 info->var.red.offset) |
799 (CNVT_TOHW( green, info->var.green.length) << 800 (CNVT_TOHW( green, info->var.green.length) <<
800 info->var.green.offset) | 801 info->var.green.offset) |
801 (CNVT_TOHW( blue, info->var.blue.length) << 802 (CNVT_TOHW( blue, info->var.blue.length) <<
802 info->var.blue.offset) | 803 info->var.blue.offset) |
803 (CNVT_TOHW( transp, info->var.transp.length) << 804 (CNVT_TOHW( transp, info->var.transp.length) <<
804 info->var.transp.offset); 805 info->var.transp.offset);
805 par->palette[regno] = rgbcol; 806 par->palette[regno] = rgbcol;
806 break; 807 }
807 default: 808
808 DPRINTK("bad depth %u\n", info->var.bits_per_pixel); 809 break;
809 break; 810 default:
811 DPRINTK("bad depth %u\n", info->var.bits_per_pixel);
812 break;
810 } 813 }
814
811 return 0; 815 return 0;
812} 816}
813 817