aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorKrzysztof Helt <krzysztof.h1@wp.pl>2008-07-24 00:30:51 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-07-24 13:47:34 -0400
commitea8ee55c12f77cbbb6e067f91e0cd794baa692ab (patch)
treeb8e56b625cb06974cfc4aca1214320555482a705 /drivers
parente09ed099d0169ac3a22b17cfeece0fa54a9e43eb (diff)
tridentfb: move global pseudo palette into structure
This patch moves pseudo palette int tridentfb_par structure and removes global default_var. Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl> Cc: "Antonino A. Daplas" <adaplas@pol.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/video/tridentfb.c21
1 files changed, 7 insertions, 14 deletions
diff --git a/drivers/video/tridentfb.c b/drivers/video/tridentfb.c
index cb37e10734b6..0f6e4054c996 100644
--- a/drivers/video/tridentfb.c
+++ b/drivers/video/tridentfb.c
@@ -28,16 +28,12 @@
28 28
29struct tridentfb_par { 29struct tridentfb_par {
30 void __iomem *io_virt; /* iospace virtual memory address */ 30 void __iomem *io_virt; /* iospace virtual memory address */
31 u32 pseudo_pal[16];
31}; 32};
32 33
33static unsigned char eng_oper; /* engine operation... */ 34static unsigned char eng_oper; /* engine operation... */
34static struct fb_ops tridentfb_ops; 35static struct fb_ops tridentfb_ops;
35 36
36/* FIXME:kmalloc these 3 instead */
37static u32 pseudo_pal[16];
38
39static struct fb_var_screeninfo default_var;
40
41static struct fb_fix_screeninfo tridentfb_fix = { 37static struct fb_fix_screeninfo tridentfb_fix = {
42 .id = "Trident", 38 .id = "Trident",
43 .type = FB_TYPE_PACKED_PIXELS, 39 .type = FB_TYPE_PACKED_PIXELS,
@@ -1340,9 +1336,7 @@ static int __devinit trident_pci_probe(struct pci_dev *dev,
1340#ifdef CONFIG_FB_TRIDENT_ACCEL 1336#ifdef CONFIG_FB_TRIDENT_ACCEL
1341 info->flags |= FBINFO_HWACCEL_COPYAREA | FBINFO_HWACCEL_FILLRECT; 1337 info->flags |= FBINFO_HWACCEL_COPYAREA | FBINFO_HWACCEL_FILLRECT;
1342#endif 1338#endif
1343 info->pseudo_palette = pseudo_pal; 1339 if (!fb_find_mode(&info->var, info,
1344
1345 if (!fb_find_mode(&default_var, info,
1346 mode_option, NULL, 0, NULL, bpp)) { 1340 mode_option, NULL, 0, NULL, bpp)) {
1347 err = -EINVAL; 1341 err = -EINVAL;
1348 goto out_unmap2; 1342 goto out_unmap2;
@@ -1352,11 +1346,10 @@ static int __devinit trident_pci_probe(struct pci_dev *dev,
1352 goto out_unmap2; 1346 goto out_unmap2;
1353 1347
1354 if (defaultaccel && acc) 1348 if (defaultaccel && acc)
1355 default_var.accel_flags |= FB_ACCELF_TEXT; 1349 info->var.accel_flags |= FB_ACCELF_TEXT;
1356 else 1350 else
1357 default_var.accel_flags &= ~FB_ACCELF_TEXT; 1351 info->var.accel_flags &= ~FB_ACCELF_TEXT;
1358 default_var.activate |= FB_ACTIVATE_NOW; 1352 info->var.activate |= FB_ACTIVATE_NOW;
1359 info->var = default_var;
1360 info->device = &dev->dev; 1353 info->device = &dev->dev;
1361 if (register_framebuffer(info) < 0) { 1354 if (register_framebuffer(info) < 0) {
1362 printk(KERN_ERR "tridentfb: could not register Trident framebuffer\n"); 1355 printk(KERN_ERR "tridentfb: could not register Trident framebuffer\n");
@@ -1365,8 +1358,8 @@ static int __devinit trident_pci_probe(struct pci_dev *dev,
1365 goto out_unmap2; 1358 goto out_unmap2;
1366 } 1359 }
1367 output("fb%d: %s frame buffer device %dx%d-%dbpp\n", 1360 output("fb%d: %s frame buffer device %dx%d-%dbpp\n",
1368 info->node, info->fix.id, default_var.xres, 1361 info->node, info->fix.id, info->var.xres,
1369 default_var.yres, default_var.bits_per_pixel); 1362 info->var.yres, info->var.bits_per_pixel);
1370 1363
1371 pci_set_drvdata(dev, info); 1364 pci_set_drvdata(dev, info);
1372 return 0; 1365 return 0;