diff options
| author | Finn Thain <fthain@telegraphics.com.au> | 2009-11-03 08:43:52 -0500 |
|---|---|---|
| committer | Geert Uytterhoeven <geert@linux-m68k.org> | 2010-02-27 12:31:13 -0500 |
| commit | 11e8faca2e501c25d2f98c1b9534776a9a9704c5 (patch) | |
| tree | 0f98adbc0b0880e5fc88d47a02c0c39f6f5085bd | |
| parent | d876c11a0fd40993136f5cc1e81371ccc6c21a63 (diff) | |
valkyriefb: various fixes
Valkyriefb and macfb will adopt the same card if they get the chance, so
remove valkyrie support from macfb. Also fix the "valkyriefb: can't do
832x624x8" problem reported by Raylynn Knight some time ago, by adding
vmode 13 support for CONFIG_MAC. Also add vmode 11 since that works too.
Make use of the monitor sense lines on 68k Macs too. Also some cleanups.
Signed-off-by: Finn Thain <fthain@telegraphics.com.au>
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
| -rw-r--r-- | drivers/video/macfb.c | 53 | ||||
| -rw-r--r-- | drivers/video/valkyriefb.c | 6 | ||||
| -rw-r--r-- | drivers/video/valkyriefb.h | 31 |
3 files changed, 17 insertions, 73 deletions
diff --git a/drivers/video/macfb.c b/drivers/video/macfb.c index d66887e8cbb1..a92322558ec0 100644 --- a/drivers/video/macfb.c +++ b/drivers/video/macfb.c | |||
| @@ -55,9 +55,6 @@ | |||
| 55 | static int (*macfb_setpalette) (unsigned int regno, unsigned int red, | 55 | static int (*macfb_setpalette) (unsigned int regno, unsigned int red, |
| 56 | unsigned int green, unsigned int blue, | 56 | unsigned int green, unsigned int blue, |
| 57 | struct fb_info *info) = NULL; | 57 | struct fb_info *info) = NULL; |
| 58 | static int valkyrie_setpalette (unsigned int regno, unsigned int red, | ||
| 59 | unsigned int green, unsigned int blue, | ||
| 60 | struct fb_info *info); | ||
| 61 | static int dafb_setpalette (unsigned int regno, unsigned int red, | 58 | static int dafb_setpalette (unsigned int regno, unsigned int red, |
| 62 | unsigned int green, unsigned int blue, | 59 | unsigned int green, unsigned int blue, |
| 63 | struct fb_info *fb_info); | 60 | struct fb_info *fb_info); |
| @@ -79,13 +76,6 @@ static int csc_setpalette (unsigned int regno, unsigned int red, | |||
| 79 | 76 | ||
| 80 | static struct { | 77 | static struct { |
| 81 | unsigned char addr; | 78 | unsigned char addr; |
| 82 | /* Note: word-aligned */ | ||
| 83 | char pad[3]; | ||
| 84 | unsigned char lut; | ||
| 85 | } __iomem *valkyrie_cmap_regs; | ||
| 86 | |||
| 87 | static struct { | ||
| 88 | unsigned char addr; | ||
| 89 | unsigned char lut; | 79 | unsigned char lut; |
| 90 | } __iomem *v8_brazil_cmap_regs; | 80 | } __iomem *v8_brazil_cmap_regs; |
| 91 | 81 | ||
| @@ -172,33 +162,6 @@ static u32 pseudo_palette[16]; | |||
| 172 | static int inverse = 0; | 162 | static int inverse = 0; |
| 173 | static int vidtest = 0; | 163 | static int vidtest = 0; |
| 174 | 164 | ||
| 175 | static int valkyrie_setpalette (unsigned int regno, unsigned int red, | ||
| 176 | unsigned int green, unsigned int blue, | ||
| 177 | struct fb_info *info) | ||
| 178 | { | ||
| 179 | unsigned long flags; | ||
| 180 | |||
| 181 | red >>= 8; | ||
| 182 | green >>= 8; | ||
| 183 | blue >>= 8; | ||
| 184 | |||
| 185 | local_irq_save(flags); | ||
| 186 | |||
| 187 | /* tell clut which address to fill */ | ||
| 188 | nubus_writeb(regno, &valkyrie_cmap_regs->addr); | ||
| 189 | nop(); | ||
| 190 | |||
| 191 | /* send one color channel at a time */ | ||
| 192 | nubus_writeb(red, &valkyrie_cmap_regs->lut); | ||
| 193 | nop(); | ||
| 194 | nubus_writeb(green, &valkyrie_cmap_regs->lut); | ||
| 195 | nop(); | ||
| 196 | nubus_writeb(blue, &valkyrie_cmap_regs->lut); | ||
| 197 | |||
| 198 | local_irq_restore(flags); | ||
| 199 | return 0; | ||
| 200 | } | ||
| 201 | |||
| 202 | /* Unlike the Valkyrie, the DAFB cannot set individual colormap | 165 | /* Unlike the Valkyrie, the DAFB cannot set individual colormap |
| 203 | registers. Therefore, we do what the MacOS driver does (no | 166 | registers. Therefore, we do what the MacOS driver does (no |
| 204 | kidding!) and simply set them one by one until we hit the one we | 167 | kidding!) and simply set them one by one until we hit the one we |
| @@ -614,8 +577,6 @@ static void __init macfb_setup(char *options) | |||
| 614 | 577 | ||
| 615 | static void __init iounmap_macfb(void) | 578 | static void __init iounmap_macfb(void) |
| 616 | { | 579 | { |
| 617 | if (valkyrie_cmap_regs) | ||
| 618 | iounmap(valkyrie_cmap_regs); | ||
| 619 | if (dafb_cmap_regs) | 580 | if (dafb_cmap_regs) |
| 620 | iounmap(dafb_cmap_regs); | 581 | iounmap(dafb_cmap_regs); |
| 621 | if (v8_brazil_cmap_regs) | 582 | if (v8_brazil_cmap_regs) |
| @@ -642,6 +603,10 @@ static int __init macfb_init(void) | |||
| 642 | if (!MACH_IS_MAC) | 603 | if (!MACH_IS_MAC) |
| 643 | return -ENODEV; | 604 | return -ENODEV; |
| 644 | 605 | ||
| 606 | if (mac_bi_data.id == MAC_MODEL_Q630 || | ||
| 607 | mac_bi_data.id == MAC_MODEL_P588) | ||
| 608 | return -ENODEV; /* See valkyriefb.c */ | ||
| 609 | |||
| 645 | /* There can only be one internal video controller anyway so | 610 | /* There can only be one internal video controller anyway so |
| 646 | we're not too worried about this */ | 611 | we're not too worried about this */ |
| 647 | macfb_defined.xres = mac_bi_data.dimensions & 0xFFFF; | 612 | macfb_defined.xres = mac_bi_data.dimensions & 0xFFFF; |
| @@ -784,16 +749,6 @@ static int __init macfb_init(void) | |||
| 784 | if (!video_is_nubus) | 749 | if (!video_is_nubus) |
| 785 | switch( mac_bi_data.id ) | 750 | switch( mac_bi_data.id ) |
| 786 | { | 751 | { |
| 787 | /* Valkyrie Quadras */ | ||
| 788 | case MAC_MODEL_Q630: | ||
| 789 | /* I'm not sure about this one */ | ||
| 790 | case MAC_MODEL_P588: | ||
| 791 | strcpy(macfb_fix.id, "Valkyrie"); | ||
| 792 | macfb_setpalette = valkyrie_setpalette; | ||
| 793 | macfb_defined.activate = FB_ACTIVATE_NOW; | ||
| 794 | valkyrie_cmap_regs = ioremap(DAC_BASE, 0x1000); | ||
| 795 | break; | ||
| 796 | |||
| 797 | /* DAFB Quadras */ | 752 | /* DAFB Quadras */ |
| 798 | /* Note: these first four have the v7 DAFB, which is | 753 | /* Note: these first four have the v7 DAFB, which is |
| 799 | known to be rather unlike the ones used in the | 754 | known to be rather unlike the ones used in the |
diff --git a/drivers/video/valkyriefb.c b/drivers/video/valkyriefb.c index 4bb9a0b18950..6b52bf65f0b5 100644 --- a/drivers/video/valkyriefb.c +++ b/drivers/video/valkyriefb.c | |||
| @@ -69,7 +69,7 @@ | |||
| 69 | #ifdef CONFIG_MAC | 69 | #ifdef CONFIG_MAC |
| 70 | /* We don't yet have functions to read the PRAM... perhaps we can | 70 | /* We don't yet have functions to read the PRAM... perhaps we can |
| 71 | adapt them from the PPC code? */ | 71 | adapt them from the PPC code? */ |
| 72 | static int default_vmode = VMODE_640_480_67; | 72 | static int default_vmode = VMODE_CHOOSE; |
| 73 | static int default_cmode = CMODE_8; | 73 | static int default_cmode = CMODE_8; |
| 74 | #else | 74 | #else |
| 75 | static int default_vmode = VMODE_NVRAM; | 75 | static int default_vmode = VMODE_NVRAM; |
| @@ -326,11 +326,11 @@ int __init valkyriefb_init(void) | |||
| 326 | 326 | ||
| 327 | #ifdef CONFIG_MAC | 327 | #ifdef CONFIG_MAC |
| 328 | if (!MACH_IS_MAC) | 328 | if (!MACH_IS_MAC) |
| 329 | return 0; | 329 | return -ENODEV; |
| 330 | if (!(mac_bi_data.id == MAC_MODEL_Q630 | 330 | if (!(mac_bi_data.id == MAC_MODEL_Q630 |
| 331 | /* I'm not sure about this one */ | 331 | /* I'm not sure about this one */ |
| 332 | || mac_bi_data.id == MAC_MODEL_P588)) | 332 | || mac_bi_data.id == MAC_MODEL_P588)) |
| 333 | return 0; | 333 | return -ENODEV; |
| 334 | 334 | ||
| 335 | /* Hardcoded addresses... welcome to 68k Macintosh country :-) */ | 335 | /* Hardcoded addresses... welcome to 68k Macintosh country :-) */ |
| 336 | frame_buffer_phys = 0xf9000000; | 336 | frame_buffer_phys = 0xf9000000; |
diff --git a/drivers/video/valkyriefb.h b/drivers/video/valkyriefb.h index 97aaf7bb6417..d787441e5a42 100644 --- a/drivers/video/valkyriefb.h +++ b/drivers/video/valkyriefb.h | |||
| @@ -134,15 +134,7 @@ static struct valkyrie_regvals valkyrie_reg_init_14 = { | |||
| 134 | { 1024, 0 }, | 134 | { 1024, 0 }, |
| 135 | 1024, 768 | 135 | 1024, 768 |
| 136 | }; | 136 | }; |
| 137 | 137 | #endif /* !defined CONFIG_MAC */ | |
| 138 | /* Register values for 800x600, 72Hz mode (11) */ | ||
| 139 | static struct valkyrie_regvals valkyrie_reg_init_11 = { | ||
| 140 | 13, | ||
| 141 | { 17, 27, 3 }, /* pixel clock = 49.63MHz for V=71.66Hz */ | ||
| 142 | { 800, 0 }, | ||
| 143 | 800, 600 | ||
| 144 | }; | ||
| 145 | #endif /* CONFIG_MAC */ | ||
| 146 | 138 | ||
| 147 | /* Register values for 832x624, 75Hz mode (13) */ | 139 | /* Register values for 832x624, 75Hz mode (13) */ |
| 148 | static struct valkyrie_regvals valkyrie_reg_init_13 = { | 140 | static struct valkyrie_regvals valkyrie_reg_init_13 = { |
| @@ -152,6 +144,14 @@ static struct valkyrie_regvals valkyrie_reg_init_13 = { | |||
| 152 | 832, 624 | 144 | 832, 624 |
| 153 | }; | 145 | }; |
| 154 | 146 | ||
| 147 | /* Register values for 800x600, 72Hz mode (11) */ | ||
| 148 | static struct valkyrie_regvals valkyrie_reg_init_11 = { | ||
| 149 | 13, | ||
| 150 | { 17, 27, 3 }, /* pixel clock = 49.63MHz for V=71.66Hz */ | ||
| 151 | { 800, 0 }, | ||
| 152 | 800, 600 | ||
| 153 | }; | ||
| 154 | |||
| 155 | /* Register values for 800x600, 60Hz mode (10) */ | 155 | /* Register values for 800x600, 60Hz mode (10) */ |
| 156 | static struct valkyrie_regvals valkyrie_reg_init_10 = { | 156 | static struct valkyrie_regvals valkyrie_reg_init_10 = { |
| 157 | 12, | 157 | 12, |
| @@ -188,24 +188,13 @@ static struct valkyrie_regvals *valkyrie_reg_init[VMODE_MAX] = { | |||
| 188 | NULL, | 188 | NULL, |
| 189 | NULL, | 189 | NULL, |
| 190 | &valkyrie_reg_init_10, | 190 | &valkyrie_reg_init_10, |
| 191 | #ifdef CONFIG_MAC | ||
| 192 | NULL, | ||
| 193 | NULL, | ||
| 194 | &valkyrie_reg_init_13, | ||
| 195 | NULL, | ||
| 196 | NULL, | ||
| 197 | NULL, | ||
| 198 | NULL, | ||
| 199 | #else | ||
| 200 | &valkyrie_reg_init_11, | 191 | &valkyrie_reg_init_11, |
| 201 | NULL, | 192 | NULL, |
| 202 | &valkyrie_reg_init_13, | 193 | &valkyrie_reg_init_13, |
| 194 | #ifndef CONFIG_MAC | ||
| 203 | &valkyrie_reg_init_14, | 195 | &valkyrie_reg_init_14, |
| 204 | &valkyrie_reg_init_15, | 196 | &valkyrie_reg_init_15, |
| 205 | NULL, | 197 | NULL, |
| 206 | &valkyrie_reg_init_17, | 198 | &valkyrie_reg_init_17, |
| 207 | #endif | 199 | #endif |
| 208 | NULL, | ||
| 209 | NULL, | ||
| 210 | NULL | ||
| 211 | }; | 200 | }; |
