aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/atafb.c
diff options
context:
space:
mode:
authorGeert Uytterhoeven <geert@linux-m68k.org>2008-11-18 15:13:01 -0500
committerGeert Uytterhoeven <geert@linux-m68k.org>2009-01-12 14:56:29 -0500
commit74511413dd0b8f6c9f5a47bf045eba434f4fdd2b (patch)
treea087f79bf1199d0536cc58e8ef8bdccd2e50d0fe /drivers/video/atafb.c
parent02603930da19fa447648952873e967fb9663ec18 (diff)
fbdev: atafb - Fix 16 bpp console
- 16 bpp must use the cfb_*() ops - 16 bpp needs to set up info->pseudo_palette[] (was fbcon_cfb16_cmap[] in 2.4.x) - Kill commented out 2.4.x fbcon remnants Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Diffstat (limited to 'drivers/video/atafb.c')
-rw-r--r--drivers/video/atafb.c74
1 files changed, 30 insertions, 44 deletions
diff --git a/drivers/video/atafb.c b/drivers/video/atafb.c
index b7646ad71bb3..f932c138fe1d 100644
--- a/drivers/video/atafb.c
+++ b/drivers/video/atafb.c
@@ -149,6 +149,7 @@ static struct atafb_par {
149 short mono; 149 short mono;
150 short ste_mode; 150 short ste_mode;
151 short bpp; 151 short bpp;
152 u32 pseudo_palette[16];
152 } falcon; 153 } falcon;
153#endif 154#endif
154 /* Nothing needed for external mode */ 155 /* Nothing needed for external mode */
@@ -885,10 +886,6 @@ static int vdl_prescale[4][3] = {
885/* Default hsync timing [mon_type] in picoseconds */ 886/* Default hsync timing [mon_type] in picoseconds */
886static long h_syncs[4] = { 3000000, 4875000, 4000000, 4875000 }; 887static long h_syncs[4] = { 3000000, 4875000, 4000000, 4875000 };
887 888
888#ifdef FBCON_HAS_CFB16
889static u16 fbcon_cfb16_cmap[16];
890#endif
891
892static inline int hxx_prescale(struct falcon_hw *hw) 889static inline int hxx_prescale(struct falcon_hw *hw)
893{ 890{
894 return hw->ste_mode ? 16 891 return hw->ste_mode ? 16
@@ -1736,10 +1733,10 @@ static int falcon_setcolreg(unsigned int regno, unsigned int red,
1736 (((red & 0xe000) >> 13) | ((red & 0x1000) >> 12) << 8) | 1733 (((red & 0xe000) >> 13) | ((red & 0x1000) >> 12) << 8) |
1737 (((green & 0xe000) >> 13) | ((green & 0x1000) >> 12) << 4) | 1734 (((green & 0xe000) >> 13) | ((green & 0x1000) >> 12) << 4) |
1738 ((blue & 0xe000) >> 13) | ((blue & 0x1000) >> 12); 1735 ((blue & 0xe000) >> 13) | ((blue & 0x1000) >> 12);
1739#ifdef FBCON_HAS_CFB16 1736#ifdef ATAFB_FALCON
1740 fbcon_cfb16_cmap[regno] = ((red & 0xf800) | 1737 ((u32 *)info->pseudo_palette)[regno] = ((red & 0xf800) |
1741 ((green & 0xfc00) >> 5) | 1738 ((green & 0xfc00) >> 5) |
1742 ((blue & 0xf800) >> 11)); 1739 ((blue & 0xf800) >> 11));
1743#endif 1740#endif
1744 } 1741 }
1745 return 0; 1742 return 0;
@@ -2447,42 +2444,6 @@ static void atafb_set_disp(struct fb_info *info)
2447 atafb_get_fix(&info->fix, info); 2444 atafb_get_fix(&info->fix, info);
2448 2445
2449 info->screen_base = (void *)info->fix.smem_start; 2446 info->screen_base = (void *)info->fix.smem_start;
2450
2451 switch (info->fix.type) {
2452 case FB_TYPE_INTERLEAVED_PLANES:
2453 switch (info->var.bits_per_pixel) {
2454 case 2:
2455 // display->dispsw = &fbcon_iplan2p2;
2456 break;
2457 case 4:
2458 // display->dispsw = &fbcon_iplan2p4;
2459 break;
2460 case 8:
2461 // display->dispsw = &fbcon_iplan2p8;
2462 break;
2463 }
2464 break;
2465 case FB_TYPE_PACKED_PIXELS:
2466 switch (info->var.bits_per_pixel) {
2467#ifdef FBCON_HAS_MFB
2468 case 1:
2469 // display->dispsw = &fbcon_mfb;
2470 break;
2471#endif
2472#ifdef FBCON_HAS_CFB8
2473 case 8:
2474 // display->dispsw = &fbcon_cfb8;
2475 break;
2476#endif
2477#ifdef FBCON_HAS_CFB16
2478 case 16:
2479 // display->dispsw = &fbcon_cfb16;
2480 // display->dispsw_data = fbcon_cfb16_cmap;
2481 break;
2482#endif
2483 }
2484 break;
2485 }
2486} 2447}
2487 2448
2488static int atafb_setcolreg(u_int regno, u_int red, u_int green, u_int blue, 2449static int atafb_setcolreg(u_int regno, u_int red, u_int green, u_int blue,
@@ -2553,6 +2514,13 @@ static void atafb_fillrect(struct fb_info *info, const struct fb_fillrect *rect)
2553 if (!rect->width || !rect->height) 2514 if (!rect->width || !rect->height)
2554 return; 2515 return;
2555 2516
2517#ifdef ATAFB_FALCON
2518 if (info->var.bits_per_pixel == 16) {
2519 cfb_fillrect(info, rect);
2520 return;
2521 }
2522#endif
2523
2556 /* 2524 /*
2557 * We could use hardware clipping but on many cards you get around 2525 * We could use hardware clipping but on many cards you get around
2558 * hardware clipping by writing to framebuffer directly. 2526 * hardware clipping by writing to framebuffer directly.
@@ -2587,6 +2555,13 @@ static void atafb_copyarea(struct fb_info *info, const struct fb_copyarea *area)
2587 u32 dx, dy, sx, sy, width, height; 2555 u32 dx, dy, sx, sy, width, height;
2588 int rev_copy = 0; 2556 int rev_copy = 0;
2589 2557
2558#ifdef ATAFB_FALCON
2559 if (info->var.bits_per_pixel == 16) {
2560 cfb_copyarea(info, area);
2561 return;
2562 }
2563#endif
2564
2590 /* clip the destination */ 2565 /* clip the destination */
2591 x2 = area->dx + area->width; 2566 x2 = area->dx + area->width;
2592 y2 = area->dy + area->height; 2567 y2 = area->dy + area->height;
@@ -2636,6 +2611,13 @@ static void atafb_imageblit(struct fb_info *info, const struct fb_image *image)
2636 const char *src; 2611 const char *src;
2637 u32 dx, dy, width, height, pitch; 2612 u32 dx, dy, width, height, pitch;
2638 2613
2614#ifdef ATAFB_FALCON
2615 if (info->var.bits_per_pixel == 16) {
2616 cfb_imageblit(info, image);
2617 return;
2618 }
2619#endif
2620
2639 /* 2621 /*
2640 * We could use hardware clipping but on many cards you get around 2622 * We could use hardware clipping but on many cards you get around
2641 * hardware clipping by writing to framebuffer directly like we are 2623 * hardware clipping by writing to framebuffer directly like we are
@@ -3229,6 +3211,10 @@ int __init atafb_init(void)
3229 // tries to read from HW which may not be initialized yet 3211 // tries to read from HW which may not be initialized yet
3230 // so set sane var first, then call atafb_set_par 3212 // so set sane var first, then call atafb_set_par
3231 atafb_get_var(&fb_info.var, &fb_info); 3213 atafb_get_var(&fb_info.var, &fb_info);
3214
3215#ifdef ATAFB_FALCON
3216 fb_info.pseudo_palette = current_par.hw.falcon.pseudo_palette;
3217#endif
3232 fb_info.flags = FBINFO_FLAG_DEFAULT; 3218 fb_info.flags = FBINFO_FLAG_DEFAULT;
3233 3219
3234 if (!fb_find_mode(&fb_info.var, &fb_info, mode_option, atafb_modedb, 3220 if (!fb_find_mode(&fb_info.var, &fb_info, mode_option, atafb_modedb,