aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/video')
-rw-r--r--drivers/video/Kconfig8
-rw-r--r--drivers/video/backlight/locomolcd.c4
-rw-r--r--drivers/video/backlight/progear_bl.c4
-rw-r--r--drivers/video/bw2.c18
-rw-r--r--drivers/video/cg14.c5
-rw-r--r--drivers/video/cg3.c26
-rw-r--r--drivers/video/ffb.c84
-rw-r--r--drivers/video/riva/fbdev.c4
-rw-r--r--drivers/video/s3fb.c3
-rw-r--r--drivers/video/savage/savagefb_driver.c18
-rw-r--r--drivers/video/sstfb.c1
11 files changed, 112 insertions, 63 deletions
diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig
index 7f5a59836818..8372ace4a0d9 100644
--- a/drivers/video/Kconfig
+++ b/drivers/video/Kconfig
@@ -139,7 +139,7 @@ config FB_TILEBLITTING
139 This is particularly important to one driver, matroxfb. If 139 This is particularly important to one driver, matroxfb. If
140 unsure, say N. 140 unsure, say N.
141 141
142comment "Frambuffer hardware drivers" 142comment "Frame buffer hardware drivers"
143 depends on FB 143 depends on FB
144 144
145config FB_CIRRUS 145config FB_CIRRUS
@@ -1320,7 +1320,7 @@ config FB_AU1100
1320 1320
1321config FB_AU1200 1321config FB_AU1200
1322 bool "Au1200 LCD Driver" 1322 bool "Au1200 LCD Driver"
1323 depends on FB && MIPS && SOC_AU1200 1323 depends on (FB = y) && MIPS && SOC_AU1200
1324 select FB_CFB_FILLRECT 1324 select FB_CFB_FILLRECT
1325 select FB_CFB_COPYAREA 1325 select FB_CFB_COPYAREA
1326 select FB_CFB_IMAGEBLIT 1326 select FB_CFB_IMAGEBLIT
@@ -1470,7 +1470,7 @@ config FB_G364
1470 1470
1471config FB_68328 1471config FB_68328
1472 bool "Motorola 68328 native frame buffer support" 1472 bool "Motorola 68328 native frame buffer support"
1473 depends on FB && (M68328 || M68EZ328 || M68VZ328) 1473 depends on (FB = y) && (M68328 || M68EZ328 || M68VZ328)
1474 select FB_CFB_FILLRECT 1474 select FB_CFB_FILLRECT
1475 select FB_CFB_COPYAREA 1475 select FB_CFB_COPYAREA
1476 select FB_CFB_IMAGEBLIT 1476 select FB_CFB_IMAGEBLIT
@@ -1616,7 +1616,7 @@ config FB_IBM_GXT4500
1616 1616
1617config FB_PS3 1617config FB_PS3
1618 bool "PS3 GPU framebuffer driver" 1618 bool "PS3 GPU framebuffer driver"
1619 depends on FB && PS3_PS3AV 1619 depends on (FB = y) && PS3_PS3AV
1620 select FB_CFB_FILLRECT 1620 select FB_CFB_FILLRECT
1621 select FB_CFB_COPYAREA 1621 select FB_CFB_COPYAREA
1622 select FB_CFB_IMAGEBLIT 1622 select FB_CFB_IMAGEBLIT
diff --git a/drivers/video/backlight/locomolcd.c b/drivers/video/backlight/locomolcd.c
index d1312477813e..6b488b8a7eee 100644
--- a/drivers/video/backlight/locomolcd.c
+++ b/drivers/video/backlight/locomolcd.c
@@ -199,8 +199,8 @@ static int locomolcd_remove(struct locomo_dev *dev)
199{ 199{
200 unsigned long flags; 200 unsigned long flags;
201 201
202 locomobl_data.brightness = 0; 202 locomolcd_bl_device->props.brightness = 0;
203 locomobl_data.power = 0; 203 locomolcd_bl_device->props.power = 0;
204 locomolcd_set_intensity(locomolcd_bl_device); 204 locomolcd_set_intensity(locomolcd_bl_device);
205 205
206 backlight_device_unregister(locomolcd_bl_device); 206 backlight_device_unregister(locomolcd_bl_device);
diff --git a/drivers/video/backlight/progear_bl.c b/drivers/video/backlight/progear_bl.c
index 702269357861..836ab4df0ef2 100644
--- a/drivers/video/backlight/progear_bl.c
+++ b/drivers/video/backlight/progear_bl.c
@@ -65,13 +65,13 @@ static int progearbl_probe(struct platform_device *pdev)
65 u8 temp; 65 u8 temp;
66 struct backlight_device *progear_backlight_device; 66 struct backlight_device *progear_backlight_device;
67 67
68 pmu_dev = pci_get_device(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M7101, 0); 68 pmu_dev = pci_get_device(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M7101, NULL);
69 if (!pmu_dev) { 69 if (!pmu_dev) {
70 printk("ALI M7101 PMU not found.\n"); 70 printk("ALI M7101 PMU not found.\n");
71 return -ENODEV; 71 return -ENODEV;
72 } 72 }
73 73
74 sb_dev = pci_get_device(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M1533, 0); 74 sb_dev = pci_get_device(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M1533, NULL);
75 if (!sb_dev) { 75 if (!sb_dev) {
76 printk("ALI 1533 SB not found.\n"); 76 printk("ALI 1533 SB not found.\n");
77 pci_dev_put(pmu_dev); 77 pci_dev_put(pmu_dev);
diff --git a/drivers/video/bw2.c b/drivers/video/bw2.c
index 9bb6257d6918..b0b2e40bbd9f 100644
--- a/drivers/video/bw2.c
+++ b/drivers/video/bw2.c
@@ -186,8 +186,7 @@ static int bw2_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg)
186 * Initialisation 186 * Initialisation
187 */ 187 */
188 188
189static void 189static void __devinit bw2_init_fix(struct fb_info *info, int linebytes)
190bw2_init_fix(struct fb_info *info, int linebytes)
191{ 190{
192 strlcpy(info->fix.id, "bwtwo", sizeof(info->fix.id)); 191 strlcpy(info->fix.id, "bwtwo", sizeof(info->fix.id));
193 192
@@ -199,43 +198,44 @@ bw2_init_fix(struct fb_info *info, int linebytes)
199 info->fix.accel = FB_ACCEL_SUN_BWTWO; 198 info->fix.accel = FB_ACCEL_SUN_BWTWO;
200} 199}
201 200
202static u8 bw2regs_1600[] __initdata = { 201static u8 bw2regs_1600[] __devinitdata = {
203 0x14, 0x8b, 0x15, 0x28, 0x16, 0x03, 0x17, 0x13, 202 0x14, 0x8b, 0x15, 0x28, 0x16, 0x03, 0x17, 0x13,
204 0x18, 0x7b, 0x19, 0x05, 0x1a, 0x34, 0x1b, 0x2e, 203 0x18, 0x7b, 0x19, 0x05, 0x1a, 0x34, 0x1b, 0x2e,
205 0x1c, 0x00, 0x1d, 0x0a, 0x1e, 0xff, 0x1f, 0x01, 204 0x1c, 0x00, 0x1d, 0x0a, 0x1e, 0xff, 0x1f, 0x01,
206 0x10, 0x21, 0 205 0x10, 0x21, 0
207}; 206};
208 207
209static u8 bw2regs_ecl[] __initdata = { 208static u8 bw2regs_ecl[] __devinitdata = {
210 0x14, 0x65, 0x15, 0x1e, 0x16, 0x04, 0x17, 0x0c, 209 0x14, 0x65, 0x15, 0x1e, 0x16, 0x04, 0x17, 0x0c,
211 0x18, 0x5e, 0x19, 0x03, 0x1a, 0xa7, 0x1b, 0x23, 210 0x18, 0x5e, 0x19, 0x03, 0x1a, 0xa7, 0x1b, 0x23,
212 0x1c, 0x00, 0x1d, 0x08, 0x1e, 0xff, 0x1f, 0x01, 211 0x1c, 0x00, 0x1d, 0x08, 0x1e, 0xff, 0x1f, 0x01,
213 0x10, 0x20, 0 212 0x10, 0x20, 0
214}; 213};
215 214
216static u8 bw2regs_analog[] __initdata = { 215static u8 bw2regs_analog[] __devinitdata = {
217 0x14, 0xbb, 0x15, 0x2b, 0x16, 0x03, 0x17, 0x13, 216 0x14, 0xbb, 0x15, 0x2b, 0x16, 0x03, 0x17, 0x13,
218 0x18, 0xb0, 0x19, 0x03, 0x1a, 0xa6, 0x1b, 0x22, 217 0x18, 0xb0, 0x19, 0x03, 0x1a, 0xa6, 0x1b, 0x22,
219 0x1c, 0x01, 0x1d, 0x05, 0x1e, 0xff, 0x1f, 0x01, 218 0x1c, 0x01, 0x1d, 0x05, 0x1e, 0xff, 0x1f, 0x01,
220 0x10, 0x20, 0 219 0x10, 0x20, 0
221}; 220};
222 221
223static u8 bw2regs_76hz[] __initdata = { 222static u8 bw2regs_76hz[] __devinitdata = {
224 0x14, 0xb7, 0x15, 0x27, 0x16, 0x03, 0x17, 0x0f, 223 0x14, 0xb7, 0x15, 0x27, 0x16, 0x03, 0x17, 0x0f,
225 0x18, 0xae, 0x19, 0x03, 0x1a, 0xae, 0x1b, 0x2a, 224 0x18, 0xae, 0x19, 0x03, 0x1a, 0xae, 0x1b, 0x2a,
226 0x1c, 0x01, 0x1d, 0x09, 0x1e, 0xff, 0x1f, 0x01, 225 0x1c, 0x01, 0x1d, 0x09, 0x1e, 0xff, 0x1f, 0x01,
227 0x10, 0x24, 0 226 0x10, 0x24, 0
228}; 227};
229 228
230static u8 bw2regs_66hz[] __initdata = { 229static u8 bw2regs_66hz[] __devinitdata = {
231 0x14, 0xbb, 0x15, 0x2b, 0x16, 0x04, 0x17, 0x14, 230 0x14, 0xbb, 0x15, 0x2b, 0x16, 0x04, 0x17, 0x14,
232 0x18, 0xae, 0x19, 0x03, 0x1a, 0xa8, 0x1b, 0x24, 231 0x18, 0xae, 0x19, 0x03, 0x1a, 0xa8, 0x1b, 0x24,
233 0x1c, 0x01, 0x1d, 0x05, 0x1e, 0xff, 0x1f, 0x01, 232 0x1c, 0x01, 0x1d, 0x05, 0x1e, 0xff, 0x1f, 0x01,
234 0x10, 0x20, 0 233 0x10, 0x20, 0
235}; 234};
236 235
237static void bw2_do_default_mode(struct bw2_par *par, struct fb_info *info, 236static void __devinit bw2_do_default_mode(struct bw2_par *par,
238 int *linebytes) 237 struct fb_info *info,
238 int *linebytes)
239{ 239{
240 u8 status, mon; 240 u8 status, mon;
241 u8 *p; 241 u8 *p;
diff --git a/drivers/video/cg14.c b/drivers/video/cg14.c
index ec6a51a5822d..b071bb632b97 100644
--- a/drivers/video/cg14.c
+++ b/drivers/video/cg14.c
@@ -354,7 +354,8 @@ static int cg14_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg)
354 * Initialisation 354 * Initialisation
355 */ 355 */
356 356
357static void cg14_init_fix(struct fb_info *info, int linebytes, struct device_node *dp) 357static void __devinit cg14_init_fix(struct fb_info *info, int linebytes,
358 struct device_node *dp)
358{ 359{
359 const char *name = dp->name; 360 const char *name = dp->name;
360 361
@@ -368,7 +369,7 @@ static void cg14_init_fix(struct fb_info *info, int linebytes, struct device_nod
368 info->fix.accel = FB_ACCEL_SUN_CG14; 369 info->fix.accel = FB_ACCEL_SUN_CG14;
369} 370}
370 371
371static struct sbus_mmap_map __cg14_mmap_map[CG14_MMAP_ENTRIES] __initdata = { 372static struct sbus_mmap_map __cg14_mmap_map[CG14_MMAP_ENTRIES] __devinitdata = {
372 { 373 {
373 .voff = CG14_REGS, 374 .voff = CG14_REGS,
374 .poff = 0x80000000, 375 .poff = 0x80000000,
diff --git a/drivers/video/cg3.c b/drivers/video/cg3.c
index ada6f7e3a891..767c850f8eb7 100644
--- a/drivers/video/cg3.c
+++ b/drivers/video/cg3.c
@@ -186,8 +186,7 @@ static int cg3_setcolreg(unsigned regno,
186 * @blank_mode: the blank mode we want. 186 * @blank_mode: the blank mode we want.
187 * @info: frame buffer structure that represents a single frame buffer 187 * @info: frame buffer structure that represents a single frame buffer
188 */ 188 */
189static int 189static int cg3_blank(int blank, struct fb_info *info)
190cg3_blank(int blank, struct fb_info *info)
191{ 190{
192 struct cg3_par *par = (struct cg3_par *) info->par; 191 struct cg3_par *par = (struct cg3_par *) info->par;
193 struct cg3_regs __iomem *regs = par->regs; 192 struct cg3_regs __iomem *regs = par->regs;
@@ -251,8 +250,8 @@ static int cg3_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg)
251 * Initialisation 250 * Initialisation
252 */ 251 */
253 252
254static void 253static void __devinit cg3_init_fix(struct fb_info *info, int linebytes,
255cg3_init_fix(struct fb_info *info, int linebytes, struct device_node *dp) 254 struct device_node *dp)
256{ 255{
257 strlcpy(info->fix.id, dp->name, sizeof(info->fix.id)); 256 strlcpy(info->fix.id, dp->name, sizeof(info->fix.id));
258 257
@@ -264,8 +263,8 @@ cg3_init_fix(struct fb_info *info, int linebytes, struct device_node *dp)
264 info->fix.accel = FB_ACCEL_SUN_CGTHREE; 263 info->fix.accel = FB_ACCEL_SUN_CGTHREE;
265} 264}
266 265
267static void cg3_rdi_maybe_fixup_var(struct fb_var_screeninfo *var, 266static void __devinit cg3_rdi_maybe_fixup_var(struct fb_var_screeninfo *var,
268 struct device_node *dp) 267 struct device_node *dp)
269{ 268{
270 char *params; 269 char *params;
271 char *p; 270 char *p;
@@ -287,36 +286,36 @@ static void cg3_rdi_maybe_fixup_var(struct fb_var_screeninfo *var,
287 } 286 }
288} 287}
289 288
290static u8 cg3regvals_66hz[] __initdata = { /* 1152 x 900, 66 Hz */ 289static u8 cg3regvals_66hz[] __devinitdata = { /* 1152 x 900, 66 Hz */
291 0x14, 0xbb, 0x15, 0x2b, 0x16, 0x04, 0x17, 0x14, 290 0x14, 0xbb, 0x15, 0x2b, 0x16, 0x04, 0x17, 0x14,
292 0x18, 0xae, 0x19, 0x03, 0x1a, 0xa8, 0x1b, 0x24, 291 0x18, 0xae, 0x19, 0x03, 0x1a, 0xa8, 0x1b, 0x24,
293 0x1c, 0x01, 0x1d, 0x05, 0x1e, 0xff, 0x1f, 0x01, 292 0x1c, 0x01, 0x1d, 0x05, 0x1e, 0xff, 0x1f, 0x01,
294 0x10, 0x20, 0 293 0x10, 0x20, 0
295}; 294};
296 295
297static u8 cg3regvals_76hz[] __initdata = { /* 1152 x 900, 76 Hz */ 296static u8 cg3regvals_76hz[] __devinitdata = { /* 1152 x 900, 76 Hz */
298 0x14, 0xb7, 0x15, 0x27, 0x16, 0x03, 0x17, 0x0f, 297 0x14, 0xb7, 0x15, 0x27, 0x16, 0x03, 0x17, 0x0f,
299 0x18, 0xae, 0x19, 0x03, 0x1a, 0xae, 0x1b, 0x2a, 298 0x18, 0xae, 0x19, 0x03, 0x1a, 0xae, 0x1b, 0x2a,
300 0x1c, 0x01, 0x1d, 0x09, 0x1e, 0xff, 0x1f, 0x01, 299 0x1c, 0x01, 0x1d, 0x09, 0x1e, 0xff, 0x1f, 0x01,
301 0x10, 0x24, 0 300 0x10, 0x24, 0
302}; 301};
303 302
304static u8 cg3regvals_rdi[] __initdata = { /* 640 x 480, cgRDI */ 303static u8 cg3regvals_rdi[] __devinitdata = { /* 640 x 480, cgRDI */
305 0x14, 0x70, 0x15, 0x20, 0x16, 0x08, 0x17, 0x10, 304 0x14, 0x70, 0x15, 0x20, 0x16, 0x08, 0x17, 0x10,
306 0x18, 0x06, 0x19, 0x02, 0x1a, 0x31, 0x1b, 0x51, 305 0x18, 0x06, 0x19, 0x02, 0x1a, 0x31, 0x1b, 0x51,
307 0x1c, 0x06, 0x1d, 0x0c, 0x1e, 0xff, 0x1f, 0x01, 306 0x1c, 0x06, 0x1d, 0x0c, 0x1e, 0xff, 0x1f, 0x01,
308 0x10, 0x22, 0 307 0x10, 0x22, 0
309}; 308};
310 309
311static u8 *cg3_regvals[] __initdata = { 310static u8 *cg3_regvals[] __devinitdata = {
312 cg3regvals_66hz, cg3regvals_76hz, cg3regvals_rdi 311 cg3regvals_66hz, cg3regvals_76hz, cg3regvals_rdi
313}; 312};
314 313
315static u_char cg3_dacvals[] __initdata = { 314static u_char cg3_dacvals[] __devinitdata = {
316 4, 0xff, 5, 0x00, 6, 0x70, 7, 0x00, 0 315 4, 0xff, 5, 0x00, 6, 0x70, 7, 0x00, 0
317}; 316};
318 317
319static void cg3_do_default_mode(struct cg3_par *par) 318static void __devinit cg3_do_default_mode(struct cg3_par *par)
320{ 319{
321 enum cg3_type type; 320 enum cg3_type type;
322 u8 *p; 321 u8 *p;
@@ -433,7 +432,8 @@ static int __devinit cg3_init_one(struct of_device *op)
433 return 0; 432 return 0;
434} 433}
435 434
436static int __devinit cg3_probe(struct of_device *dev, const struct of_device_id *match) 435static int __devinit cg3_probe(struct of_device *dev,
436 const struct of_device_id *match)
437{ 437{
438 struct of_device *op = to_of_device(&dev->dev); 438 struct of_device *op = to_of_device(&dev->dev);
439 439
diff --git a/drivers/video/ffb.c b/drivers/video/ffb.c
index 15854aec3180..1d4e8354b561 100644
--- a/drivers/video/ffb.c
+++ b/drivers/video/ffb.c
@@ -336,14 +336,30 @@ struct ffb_dac {
336 u32 value2; 336 u32 value2;
337}; 337};
338 338
339#define FFB_DAC_UCTRL 0x1001 /* User Control */
340#define FFB_DAC_UCTRL_MANREV 0x00000f00 /* 4-bit Manufacturing Revision */
341#define FFB_DAC_UCTRL_MANREV_SHIFT 8
342#define FFB_DAC_TGEN 0x6000 /* Timing Generator */
343#define FFB_DAC_TGEN_VIDE 0x00000001 /* Video Enable */
344#define FFB_DAC_DID 0x8000 /* Device Identification */
345#define FFB_DAC_DID_PNUM 0x0ffff000 /* Device Part Number */
346#define FFB_DAC_DID_PNUM_SHIFT 12
347#define FFB_DAC_DID_REV 0xf0000000 /* Device Revision */
348#define FFB_DAC_DID_REV_SHIFT 28
349
350#define FFB_DAC_CUR_CTRL 0x100
351#define FFB_DAC_CUR_CTRL_P0 0x00000001
352#define FFB_DAC_CUR_CTRL_P1 0x00000002
353
339struct ffb_par { 354struct ffb_par {
340 spinlock_t lock; 355 spinlock_t lock;
341 struct ffb_fbc __iomem *fbc; 356 struct ffb_fbc __iomem *fbc;
342 struct ffb_dac __iomem *dac; 357 struct ffb_dac __iomem *dac;
343 358
344 u32 flags; 359 u32 flags;
345#define FFB_FLAG_AFB 0x00000001 360#define FFB_FLAG_AFB 0x00000001 /* AFB m3 or m6 */
346#define FFB_FLAG_BLANKED 0x00000002 361#define FFB_FLAG_BLANKED 0x00000002 /* screen is blanked */
362#define FFB_FLAG_INVCURSOR 0x00000004 /* DAC has inverted cursor logic */
347 363
348 u32 fg_cache __attribute__((aligned (8))); 364 u32 fg_cache __attribute__((aligned (8)));
349 u32 bg_cache; 365 u32 bg_cache;
@@ -354,7 +370,6 @@ struct ffb_par {
354 unsigned long physbase; 370 unsigned long physbase;
355 unsigned long fbsize; 371 unsigned long fbsize;
356 372
357 int dac_rev;
358 int board_type; 373 int board_type;
359}; 374};
360 375
@@ -426,11 +441,12 @@ static void ffb_switch_from_graph(struct ffb_par *par)
426 FFBWait(par); 441 FFBWait(par);
427 442
428 /* Disable cursor. */ 443 /* Disable cursor. */
429 upa_writel(0x100, &dac->type2); 444 upa_writel(FFB_DAC_CUR_CTRL, &dac->type2);
430 if (par->dac_rev <= 2) 445 if (par->flags & FFB_FLAG_INVCURSOR)
431 upa_writel(0, &dac->value2); 446 upa_writel(0, &dac->value2);
432 else 447 else
433 upa_writel(3, &dac->value2); 448 upa_writel((FFB_DAC_CUR_CTRL_P0 |
449 FFB_DAC_CUR_CTRL_P1), &dac->value2);
434 450
435 spin_unlock_irqrestore(&par->lock, flags); 451 spin_unlock_irqrestore(&par->lock, flags);
436} 452}
@@ -664,18 +680,18 @@ ffb_blank(int blank, struct fb_info *info)
664 struct ffb_par *par = (struct ffb_par *) info->par; 680 struct ffb_par *par = (struct ffb_par *) info->par;
665 struct ffb_dac __iomem *dac = par->dac; 681 struct ffb_dac __iomem *dac = par->dac;
666 unsigned long flags; 682 unsigned long flags;
667 u32 tmp; 683 u32 val;
684 int i;
668 685
669 spin_lock_irqsave(&par->lock, flags); 686 spin_lock_irqsave(&par->lock, flags);
670 687
671 FFBWait(par); 688 FFBWait(par);
672 689
690 upa_writel(FFB_DAC_TGEN, &dac->type);
691 val = upa_readl(&dac->value);
673 switch (blank) { 692 switch (blank) {
674 case FB_BLANK_UNBLANK: /* Unblanking */ 693 case FB_BLANK_UNBLANK: /* Unblanking */
675 upa_writel(0x6000, &dac->type); 694 val |= FFB_DAC_TGEN_VIDE;
676 tmp = (upa_readl(&dac->value) | 0x1);
677 upa_writel(0x6000, &dac->type);
678 upa_writel(tmp, &dac->value);
679 par->flags &= ~FFB_FLAG_BLANKED; 695 par->flags &= ~FFB_FLAG_BLANKED;
680 break; 696 break;
681 697
@@ -683,13 +699,16 @@ ffb_blank(int blank, struct fb_info *info)
683 case FB_BLANK_VSYNC_SUSPEND: /* VESA blank (vsync off) */ 699 case FB_BLANK_VSYNC_SUSPEND: /* VESA blank (vsync off) */
684 case FB_BLANK_HSYNC_SUSPEND: /* VESA blank (hsync off) */ 700 case FB_BLANK_HSYNC_SUSPEND: /* VESA blank (hsync off) */
685 case FB_BLANK_POWERDOWN: /* Poweroff */ 701 case FB_BLANK_POWERDOWN: /* Poweroff */
686 upa_writel(0x6000, &dac->type); 702 val &= ~FFB_DAC_TGEN_VIDE;
687 tmp = (upa_readl(&dac->value) & ~0x1);
688 upa_writel(0x6000, &dac->type);
689 upa_writel(tmp, &dac->value);
690 par->flags |= FFB_FLAG_BLANKED; 703 par->flags |= FFB_FLAG_BLANKED;
691 break; 704 break;
692 } 705 }
706 upa_writel(FFB_DAC_TGEN, &dac->type);
707 upa_writel(val, &dac->value);
708 for (i = 0; i < 10; i++) {
709 upa_writel(FFB_DAC_TGEN, &dac->type);
710 upa_readl(&dac->value);
711 }
693 712
694 spin_unlock_irqrestore(&par->lock, flags); 713 spin_unlock_irqrestore(&par->lock, flags);
695 714
@@ -894,6 +913,7 @@ static int ffb_init_one(struct of_device *op)
894 struct ffb_dac __iomem *dac; 913 struct ffb_dac __iomem *dac;
895 struct all_info *all; 914 struct all_info *all;
896 int err; 915 int err;
916 u32 dac_pnum, dac_rev, dac_mrev;
897 917
898 all = kzalloc(sizeof(*all), GFP_KERNEL); 918 all = kzalloc(sizeof(*all), GFP_KERNEL);
899 if (!all) 919 if (!all)
@@ -948,17 +968,31 @@ static int ffb_init_one(struct of_device *op)
948 if ((upa_readl(&fbc->ucsr) & FFB_UCSR_ALL_ERRORS) != 0) 968 if ((upa_readl(&fbc->ucsr) & FFB_UCSR_ALL_ERRORS) != 0)
949 upa_writel(FFB_UCSR_ALL_ERRORS, &fbc->ucsr); 969 upa_writel(FFB_UCSR_ALL_ERRORS, &fbc->ucsr);
950 970
951 ffb_switch_from_graph(&all->par);
952
953 dac = all->par.dac; 971 dac = all->par.dac;
954 upa_writel(0x8000, &dac->type); 972 upa_writel(FFB_DAC_DID, &dac->type);
955 all->par.dac_rev = upa_readl(&dac->value) >> 0x1c; 973 dac_pnum = upa_readl(&dac->value);
974 dac_rev = (dac_pnum & FFB_DAC_DID_REV) >> FFB_DAC_DID_REV_SHIFT;
975 dac_pnum = (dac_pnum & FFB_DAC_DID_PNUM) >> FFB_DAC_DID_PNUM_SHIFT;
976
977 upa_writel(FFB_DAC_UCTRL, &dac->type);
978 dac_mrev = upa_readl(&dac->value);
979 dac_mrev = (dac_mrev & FFB_DAC_UCTRL_MANREV) >>
980 FFB_DAC_UCTRL_MANREV_SHIFT;
956 981
957 /* Elite3D has different DAC revision numbering, and no DAC revisions 982 /* Elite3D has different DAC revision numbering, and no DAC revisions
958 * have the reversed meaning of cursor enable. 983 * have the reversed meaning of cursor enable. Otherwise, Pacifica 1
984 * ramdacs with manufacturing revision less than 3 have inverted
985 * cursor logic. We identify Pacifica 1 as not Pacifica 2, the
986 * latter having a part number value of 0x236e.
959 */ 987 */
960 if (all->par.flags & FFB_FLAG_AFB) 988 if ((all->par.flags & FFB_FLAG_AFB) || dac_pnum == 0x236e) {
961 all->par.dac_rev = 10; 989 all->par.flags &= ~FFB_FLAG_INVCURSOR;
990 } else {
991 if (dac_mrev < 3)
992 all->par.flags |= FFB_FLAG_INVCURSOR;
993 }
994
995 ffb_switch_from_graph(&all->par);
962 996
963 /* Unblank it just to be sure. When there are multiple 997 /* Unblank it just to be sure. When there are multiple
964 * FFB/AFB cards in the system, or it is not the OBP 998 * FFB/AFB cards in the system, or it is not the OBP
@@ -993,10 +1027,12 @@ static int ffb_init_one(struct of_device *op)
993 1027
994 dev_set_drvdata(&op->dev, all); 1028 dev_set_drvdata(&op->dev, all);
995 1029
996 printk("%s: %s at %016lx, type %d, DAC revision %d\n", 1030 printk("%s: %s at %016lx, type %d, "
1031 "DAC pnum[%x] rev[%d] manuf_rev[%d]\n",
997 dp->full_name, 1032 dp->full_name,
998 ((all->par.flags & FFB_FLAG_AFB) ? "AFB" : "FFB"), 1033 ((all->par.flags & FFB_FLAG_AFB) ? "AFB" : "FFB"),
999 all->par.physbase, all->par.board_type, all->par.dac_rev); 1034 all->par.physbase, all->par.board_type,
1035 dac_pnum, dac_rev, dac_mrev);
1000 1036
1001 return 0; 1037 return 0;
1002} 1038}
diff --git a/drivers/video/riva/fbdev.c b/drivers/video/riva/fbdev.c
index 1d1c7c624d7f..d7ece8d17a2c 100644
--- a/drivers/video/riva/fbdev.c
+++ b/drivers/video/riva/fbdev.c
@@ -285,8 +285,6 @@ static const struct riva_regs reg_template = {
285#define MAX_LEVEL 0x534 285#define MAX_LEVEL 0x534
286#define LEVEL_STEP ((MAX_LEVEL - MIN_LEVEL) / FB_BACKLIGHT_MAX) 286#define LEVEL_STEP ((MAX_LEVEL - MIN_LEVEL) / FB_BACKLIGHT_MAX)
287 287
288static struct backlight_properties riva_bl_data;
289
290static int riva_bl_get_level_brightness(struct riva_par *par, 288static int riva_bl_get_level_brightness(struct riva_par *par,
291 int level) 289 int level)
292{ 290{
@@ -372,7 +370,7 @@ static void riva_bl_init(struct riva_par *par)
372 FB_BACKLIGHT_MAX); 370 FB_BACKLIGHT_MAX);
373 371
374 bd->props.max_brightness = FB_BACKLIGHT_LEVELS - 1; 372 bd->props.max_brightness = FB_BACKLIGHT_LEVELS - 1;
375 bd->props.brightness = riva_bl_data.max_brightness; 373 bd->props.brightness = bd->props.max_brightness;
376 bd->props.power = FB_BLANK_UNBLANK; 374 bd->props.power = FB_BLANK_UNBLANK;
377 backlight_update_status(bd); 375 backlight_update_status(bd);
378 376
diff --git a/drivers/video/s3fb.c b/drivers/video/s3fb.c
index 98919a6975f0..3091b20124b4 100644
--- a/drivers/video/s3fb.c
+++ b/drivers/video/s3fb.c
@@ -1000,11 +1000,12 @@ err_enable_device:
1000static void __devexit s3_pci_remove(struct pci_dev *dev) 1000static void __devexit s3_pci_remove(struct pci_dev *dev)
1001{ 1001{
1002 struct fb_info *info = pci_get_drvdata(dev); 1002 struct fb_info *info = pci_get_drvdata(dev);
1003 struct s3fb_info *par = info->par;
1004 1003
1005 if (info) { 1004 if (info) {
1006 1005
1007#ifdef CONFIG_MTRR 1006#ifdef CONFIG_MTRR
1007 struct s3fb_info *par = info->par;
1008
1008 if (par->mtrr_reg >= 0) { 1009 if (par->mtrr_reg >= 0) {
1009 mtrr_del(par->mtrr_reg, 0, 0); 1010 mtrr_del(par->mtrr_reg, 0, 0);
1010 par->mtrr_reg = -1; 1011 par->mtrr_reg = -1;
diff --git a/drivers/video/savage/savagefb_driver.c b/drivers/video/savage/savagefb_driver.c
index 4afa30522fdb..0166ec2ccf32 100644
--- a/drivers/video/savage/savagefb_driver.c
+++ b/drivers/video/savage/savagefb_driver.c
@@ -384,6 +384,19 @@ SavageSetup2DEngine(struct savagefb_par *par)
384 BCI_SEND(0); 384 BCI_SEND(0);
385 BCI_SEND(BCI_CMD_SETREG | (1 << 16) | BCI_GBD2); 385 BCI_SEND(BCI_CMD_SETREG | (1 << 16) | BCI_GBD2);
386 BCI_SEND(GlobalBitmapDescriptor); 386 BCI_SEND(GlobalBitmapDescriptor);
387
388 /*
389 * I don't know why, sending this twice fixes the intial black screen,
390 * prevents X from crashing at least in Toshiba laptops with SavageIX.
391 * --Tony
392 */
393 par->bci_ptr = 0;
394 par->SavageWaitFifo(par, 4);
395
396 BCI_SEND(BCI_CMD_SETREG | (1 << 16) | BCI_GBD1);
397 BCI_SEND(0);
398 BCI_SEND(BCI_CMD_SETREG | (1 << 16) | BCI_GBD2);
399 BCI_SEND(GlobalBitmapDescriptor);
387} 400}
388 401
389static void savagefb_set_clip(struct fb_info *info) 402static void savagefb_set_clip(struct fb_info *info)
@@ -496,7 +509,7 @@ static int common_calc_clock(long freq, int min_m, int min_n1, int max_n1,
496#ifdef SAVAGEFB_DEBUG 509#ifdef SAVAGEFB_DEBUG
497/* This function is used to debug, it prints out the contents of s3 regs */ 510/* This function is used to debug, it prints out the contents of s3 regs */
498 511
499static void SavagePrintRegs(void) 512static void SavagePrintRegs(struct savagefb_par *par)
500{ 513{
501 unsigned char i; 514 unsigned char i;
502 int vgaCRIndex = 0x3d4; 515 int vgaCRIndex = 0x3d4;
@@ -1525,7 +1538,7 @@ static int savagefb_set_par(struct fb_info *info)
1525 savagefb_set_fix(info); 1538 savagefb_set_fix(info);
1526 savagefb_set_clip(info); 1539 savagefb_set_clip(info);
1527 1540
1528 SavagePrintRegs(); 1541 SavagePrintRegs(par);
1529 return 0; 1542 return 0;
1530} 1543}
1531 1544
@@ -2155,7 +2168,6 @@ static int __devinit savagefb_probe(struct pci_dev* dev,
2155 int video_len; 2168 int video_len;
2156 2169
2157 DBG("savagefb_probe"); 2170 DBG("savagefb_probe");
2158 SavagePrintRegs();
2159 2171
2160 info = framebuffer_alloc(sizeof(struct savagefb_par), &dev->dev); 2172 info = framebuffer_alloc(sizeof(struct savagefb_par), &dev->dev);
2161 if (!info) 2173 if (!info)
diff --git a/drivers/video/sstfb.c b/drivers/video/sstfb.c
index 59cd1e750f30..62fa5500361d 100644
--- a/drivers/video/sstfb.c
+++ b/drivers/video/sstfb.c
@@ -257,6 +257,7 @@ static void __sst_dac_write(u8 __iomem *vbase, u8 reg, u8 val)
257 r_dprintk("sst_dac_write(%#x, %#x)\n", reg, val); 257 r_dprintk("sst_dac_write(%#x, %#x)\n", reg, val);
258 reg &= 0x07; 258 reg &= 0x07;
259 __sst_write(vbase, DAC_DATA,(((u32)reg << 8)) | (u32)val); 259 __sst_write(vbase, DAC_DATA,(((u32)reg << 8)) | (u32)val);
260 __sst_wait_idle(vbase);
260} 261}
261 262
262/* indexed access to ti/att dacs */ 263/* indexed access to ti/att dacs */