aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/video')
-rw-r--r--drivers/video/Kconfig2
-rw-r--r--drivers/video/aty/aty128fb.c5
-rw-r--r--drivers/video/aty/atyfb_base.c5
-rw-r--r--drivers/video/imacfb.c49
-rw-r--r--drivers/video/matrox/g450_pll.c8
-rw-r--r--drivers/video/nvidia/nv_backlight.c4
-rw-r--r--drivers/video/riva/fbdev.c5
7 files changed, 68 insertions, 10 deletions
diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig
index c40b9b8b1e7e..702eb933cf88 100644
--- a/drivers/video/Kconfig
+++ b/drivers/video/Kconfig
@@ -554,7 +554,7 @@ config FB_VESA
554 554
555config FB_IMAC 555config FB_IMAC
556 bool "Intel-based Macintosh Framebuffer Support" 556 bool "Intel-based Macintosh Framebuffer Support"
557 depends on (FB = y) && X86 557 depends on (FB = y) && X86 && EFI
558 select FB_CFB_FILLRECT 558 select FB_CFB_FILLRECT
559 select FB_CFB_COPYAREA 559 select FB_CFB_COPYAREA
560 select FB_CFB_IMAGEBLIT 560 select FB_CFB_IMAGEBLIT
diff --git a/drivers/video/aty/aty128fb.c b/drivers/video/aty/aty128fb.c
index 3e827e04a2aa..106d428b72c9 100644
--- a/drivers/video/aty/aty128fb.c
+++ b/drivers/video/aty/aty128fb.c
@@ -1800,6 +1800,9 @@ static struct backlight_properties aty128_bl_data = {
1800 1800
1801static void aty128_bl_set_power(struct fb_info *info, int power) 1801static void aty128_bl_set_power(struct fb_info *info, int power)
1802{ 1802{
1803 if (info->bl_dev == NULL)
1804 return;
1805
1803 mutex_lock(&info->bl_mutex); 1806 mutex_lock(&info->bl_mutex);
1804 up(&info->bl_dev->sem); 1807 up(&info->bl_dev->sem);
1805 info->bl_dev->props->power = power; 1808 info->bl_dev->props->power = power;
@@ -1828,7 +1831,7 @@ static void aty128_bl_init(struct aty128fb_par *par)
1828 bd = backlight_device_register(name, par, &aty128_bl_data); 1831 bd = backlight_device_register(name, par, &aty128_bl_data);
1829 if (IS_ERR(bd)) { 1832 if (IS_ERR(bd)) {
1830 info->bl_dev = NULL; 1833 info->bl_dev = NULL;
1831 printk("aty128: Backlight registration failed\n"); 1834 printk(KERN_WARNING "aty128: Backlight registration failed\n");
1832 goto error; 1835 goto error;
1833 } 1836 }
1834 1837
diff --git a/drivers/video/aty/atyfb_base.c b/drivers/video/aty/atyfb_base.c
index 053ff63365b7..510e4ea296ed 100644
--- a/drivers/video/aty/atyfb_base.c
+++ b/drivers/video/aty/atyfb_base.c
@@ -2199,6 +2199,9 @@ static struct backlight_properties aty_bl_data = {
2199 2199
2200static void aty_bl_set_power(struct fb_info *info, int power) 2200static void aty_bl_set_power(struct fb_info *info, int power)
2201{ 2201{
2202 if (info->bl_dev == NULL)
2203 return;
2204
2202 mutex_lock(&info->bl_mutex); 2205 mutex_lock(&info->bl_mutex);
2203 up(&info->bl_dev->sem); 2206 up(&info->bl_dev->sem);
2204 info->bl_dev->props->power = power; 2207 info->bl_dev->props->power = power;
@@ -2223,7 +2226,7 @@ static void aty_bl_init(struct atyfb_par *par)
2223 bd = backlight_device_register(name, par, &aty_bl_data); 2226 bd = backlight_device_register(name, par, &aty_bl_data);
2224 if (IS_ERR(bd)) { 2227 if (IS_ERR(bd)) {
2225 info->bl_dev = NULL; 2228 info->bl_dev = NULL;
2226 printk("aty: Backlight registration failed\n"); 2229 printk(KERN_WARNING "aty: Backlight registration failed\n");
2227 goto error; 2230 goto error;
2228 } 2231 }
2229 2232
diff --git a/drivers/video/imacfb.c b/drivers/video/imacfb.c
index ff233b84dec4..18ea4a549105 100644
--- a/drivers/video/imacfb.c
+++ b/drivers/video/imacfb.c
@@ -18,6 +18,8 @@
18#include <linux/screen_info.h> 18#include <linux/screen_info.h>
19#include <linux/slab.h> 19#include <linux/slab.h>
20#include <linux/string.h> 20#include <linux/string.h>
21#include <linux/dmi.h>
22#include <linux/efi.h>
21 23
22#include <asm/io.h> 24#include <asm/io.h>
23 25
@@ -28,7 +30,7 @@ typedef enum _MAC_TYPE {
28 M_I20, 30 M_I20,
29 M_MINI, 31 M_MINI,
30 M_MACBOOK, 32 M_MACBOOK,
31 M_NEW 33 M_UNKNOWN
32} MAC_TYPE; 34} MAC_TYPE;
33 35
34/* --------------------------------------------------------------------- */ 36/* --------------------------------------------------------------------- */
@@ -52,10 +54,36 @@ static struct fb_fix_screeninfo imacfb_fix __initdata = {
52}; 54};
53 55
54static int inverse; 56static int inverse;
55static int model = M_NEW; 57static int model = M_UNKNOWN;
56static int manual_height; 58static int manual_height;
57static int manual_width; 59static int manual_width;
58 60
61static int set_system(struct dmi_system_id *id)
62{
63 printk(KERN_INFO "imacfb: %s detected - set system to %ld\n",
64 id->ident, (long)id->driver_data);
65
66 model = (long)id->driver_data;
67
68 return 0;
69}
70
71static struct dmi_system_id __initdata dmi_system_table[] = {
72 { set_system, "iMac4,1", {
73 DMI_MATCH(DMI_BIOS_VENDOR,"Apple Computer, Inc."),
74 DMI_MATCH(DMI_PRODUCT_NAME,"iMac4,1") }, (void*)M_I17},
75 { set_system, "MacBookPro1,1", {
76 DMI_MATCH(DMI_BIOS_VENDOR,"Apple Computer, Inc."),
77 DMI_MATCH(DMI_PRODUCT_NAME,"MacBookPro1,1") }, (void*)M_I17},
78 { set_system, "MacBook1,1", {
79 DMI_MATCH(DMI_BIOS_VENDOR,"Apple Computer, Inc."),
80 DMI_MATCH(DMI_PRODUCT_NAME,"MacBook1,1")}, (void *)M_MACBOOK},
81 { set_system, "Macmini1,1", {
82 DMI_MATCH(DMI_BIOS_VENDOR,"Apple Computer, Inc."),
83 DMI_MATCH(DMI_PRODUCT_NAME,"Macmini1,1")}, (void *)M_MINI},
84 {},
85};
86
59#define DEFAULT_FB_MEM 1024*1024*16 87#define DEFAULT_FB_MEM 1024*1024*16
60 88
61/* --------------------------------------------------------------------- */ 89/* --------------------------------------------------------------------- */
@@ -149,7 +177,6 @@ static int __init imacfb_probe(struct platform_device *dev)
149 screen_info.lfb_linelength = 1472 * 4; 177 screen_info.lfb_linelength = 1472 * 4;
150 screen_info.lfb_base = 0x80010000; 178 screen_info.lfb_base = 0x80010000;
151 break; 179 break;
152 case M_NEW:
153 case M_I20: 180 case M_I20:
154 screen_info.lfb_width = 1680; 181 screen_info.lfb_width = 1680;
155 screen_info.lfb_height = 1050; 182 screen_info.lfb_height = 1050;
@@ -207,6 +234,10 @@ static int __init imacfb_probe(struct platform_device *dev)
207 size_remap = size_total; 234 size_remap = size_total;
208 imacfb_fix.smem_len = size_remap; 235 imacfb_fix.smem_len = size_remap;
209 236
237#ifndef __i386__
238 screen_info.imacpm_seg = 0;
239#endif
240
210 if (!request_mem_region(imacfb_fix.smem_start, size_total, "imacfb")) { 241 if (!request_mem_region(imacfb_fix.smem_start, size_total, "imacfb")) {
211 printk(KERN_WARNING 242 printk(KERN_WARNING
212 "imacfb: cannot reserve video memory at 0x%lx\n", 243 "imacfb: cannot reserve video memory at 0x%lx\n",
@@ -324,8 +355,16 @@ static int __init imacfb_init(void)
324 int ret; 355 int ret;
325 char *option = NULL; 356 char *option = NULL;
326 357
327 /* ignore error return of fb_get_options */ 358 if (!efi_enabled)
328 fb_get_options("imacfb", &option); 359 return -ENODEV;
360 if (!dmi_check_system(dmi_system_table))
361 return -ENODEV;
362 if (model == M_UNKNOWN)
363 return -ENODEV;
364
365 if (fb_get_options("imacfb", &option))
366 return -ENODEV;
367
329 imacfb_setup(option); 368 imacfb_setup(option);
330 ret = platform_driver_register(&imacfb_driver); 369 ret = platform_driver_register(&imacfb_driver);
331 370
diff --git a/drivers/video/matrox/g450_pll.c b/drivers/video/matrox/g450_pll.c
index 440272ad10e7..7c76e079ca7d 100644
--- a/drivers/video/matrox/g450_pll.c
+++ b/drivers/video/matrox/g450_pll.c
@@ -331,7 +331,15 @@ static int __g450_setclk(WPMINFO unsigned int fout, unsigned int pll,
331 tmp |= M1064_XPIXCLKCTRL_PLL_UP; 331 tmp |= M1064_XPIXCLKCTRL_PLL_UP;
332 } 332 }
333 matroxfb_DAC_out(PMINFO M1064_XPIXCLKCTRL, tmp); 333 matroxfb_DAC_out(PMINFO M1064_XPIXCLKCTRL, tmp);
334#ifdef __powerpc__
335 /* This is necessary to avoid jitter on PowerPC
336 * (OpenFirmware) systems, but apparently
337 * introduces jitter, at least on a x86-64
338 * using DVI.
339 * A simple workaround is disable for non-PPC.
340 */
334 matroxfb_DAC_out(PMINFO M1064_XDVICLKCTRL, 0); 341 matroxfb_DAC_out(PMINFO M1064_XDVICLKCTRL, 0);
342#endif /* __powerpc__ */
335 matroxfb_DAC_out(PMINFO M1064_XPWRCTRL, xpwrctrl); 343 matroxfb_DAC_out(PMINFO M1064_XPWRCTRL, xpwrctrl);
336 344
337 matroxfb_DAC_unlock_irqrestore(flags); 345 matroxfb_DAC_unlock_irqrestore(flags);
diff --git a/drivers/video/nvidia/nv_backlight.c b/drivers/video/nvidia/nv_backlight.c
index b45f577094ac..14c37c42191c 100644
--- a/drivers/video/nvidia/nv_backlight.c
+++ b/drivers/video/nvidia/nv_backlight.c
@@ -112,6 +112,8 @@ static struct backlight_properties nvidia_bl_data = {
112 112
113void nvidia_bl_set_power(struct fb_info *info, int power) 113void nvidia_bl_set_power(struct fb_info *info, int power)
114{ 114{
115 if (info->bl_dev == NULL)
116 return;
115 mutex_lock(&info->bl_mutex); 117 mutex_lock(&info->bl_mutex);
116 up(&info->bl_dev->sem); 118 up(&info->bl_dev->sem);
117 info->bl_dev->props->power = power; 119 info->bl_dev->props->power = power;
@@ -140,7 +142,7 @@ void nvidia_bl_init(struct nvidia_par *par)
140 bd = backlight_device_register(name, par, &nvidia_bl_data); 142 bd = backlight_device_register(name, par, &nvidia_bl_data);
141 if (IS_ERR(bd)) { 143 if (IS_ERR(bd)) {
142 info->bl_dev = NULL; 144 info->bl_dev = NULL;
143 printk("nvidia: Backlight registration failed\n"); 145 printk(KERN_WARNING "nvidia: Backlight registration failed\n");
144 goto error; 146 goto error;
145 } 147 }
146 148
diff --git a/drivers/video/riva/fbdev.c b/drivers/video/riva/fbdev.c
index 9823ba939e11..511c362d3b0d 100644
--- a/drivers/video/riva/fbdev.c
+++ b/drivers/video/riva/fbdev.c
@@ -354,6 +354,9 @@ static struct backlight_properties riva_bl_data = {
354 354
355static void riva_bl_set_power(struct fb_info *info, int power) 355static void riva_bl_set_power(struct fb_info *info, int power)
356{ 356{
357 if (info->bl_dev == NULL)
358 return;
359
357 mutex_lock(&info->bl_mutex); 360 mutex_lock(&info->bl_mutex);
358 up(&info->bl_dev->sem); 361 up(&info->bl_dev->sem);
359 info->bl_dev->props->power = power; 362 info->bl_dev->props->power = power;
@@ -382,7 +385,7 @@ static void riva_bl_init(struct riva_par *par)
382 bd = backlight_device_register(name, par, &riva_bl_data); 385 bd = backlight_device_register(name, par, &riva_bl_data);
383 if (IS_ERR(bd)) { 386 if (IS_ERR(bd)) {
384 info->bl_dev = NULL; 387 info->bl_dev = NULL;
385 printk("riva: Backlight registration failed\n"); 388 printk(KERN_WARNING "riva: Backlight registration failed\n");
386 goto error; 389 goto error;
387 } 390 }
388 391