diff options
Diffstat (limited to 'drivers/video')
-rw-r--r-- | drivers/video/Makefile | 4 | ||||
-rw-r--r-- | drivers/video/amifb.c | 6 | ||||
-rw-r--r-- | drivers/video/atafb.c | 112 | ||||
-rw-r--r-- | drivers/video/c2p.c | 232 | ||||
-rw-r--r-- | drivers/video/c2p.h | 11 | ||||
-rw-r--r-- | drivers/video/c2p_core.h | 153 | ||||
-rw-r--r-- | drivers/video/c2p_iplan2.c | 153 | ||||
-rw-r--r-- | drivers/video/c2p_planar.c | 156 | ||||
-rw-r--r-- | drivers/video/console/fbcon.c | 38 |
9 files changed, 522 insertions, 343 deletions
diff --git a/drivers/video/Makefile b/drivers/video/Makefile index e39e33e797da..be2b657546ef 100644 --- a/drivers/video/Makefile +++ b/drivers/video/Makefile | |||
@@ -28,7 +28,7 @@ obj-$(CONFIG_FB_DDC) += fb_ddc.o | |||
28 | obj-$(CONFIG_FB_DEFERRED_IO) += fb_defio.o | 28 | obj-$(CONFIG_FB_DEFERRED_IO) += fb_defio.o |
29 | 29 | ||
30 | # Hardware specific drivers go first | 30 | # Hardware specific drivers go first |
31 | obj-$(CONFIG_FB_AMIGA) += amifb.o c2p.o | 31 | obj-$(CONFIG_FB_AMIGA) += amifb.o c2p_planar.o |
32 | obj-$(CONFIG_FB_ARC) += arcfb.o | 32 | obj-$(CONFIG_FB_ARC) += arcfb.o |
33 | obj-$(CONFIG_FB_CLPS711X) += clps711xfb.o | 33 | obj-$(CONFIG_FB_CLPS711X) += clps711xfb.o |
34 | obj-$(CONFIG_FB_CYBER2000) += cyber2000fb.o | 34 | obj-$(CONFIG_FB_CYBER2000) += cyber2000fb.o |
@@ -72,7 +72,7 @@ obj-$(CONFIG_FB_TCX) += tcx.o sbuslib.o | |||
72 | obj-$(CONFIG_FB_LEO) += leo.o sbuslib.o | 72 | obj-$(CONFIG_FB_LEO) += leo.o sbuslib.o |
73 | obj-$(CONFIG_FB_SGIVW) += sgivwfb.o | 73 | obj-$(CONFIG_FB_SGIVW) += sgivwfb.o |
74 | obj-$(CONFIG_FB_ACORN) += acornfb.o | 74 | obj-$(CONFIG_FB_ACORN) += acornfb.o |
75 | obj-$(CONFIG_FB_ATARI) += atafb.o c2p.o atafb_mfb.o \ | 75 | obj-$(CONFIG_FB_ATARI) += atafb.o c2p_iplan2.o atafb_mfb.o \ |
76 | atafb_iplan2p2.o atafb_iplan2p4.o atafb_iplan2p8.o | 76 | atafb_iplan2p2.o atafb_iplan2p4.o atafb_iplan2p8.o |
77 | obj-$(CONFIG_FB_MAC) += macfb.o | 77 | obj-$(CONFIG_FB_MAC) += macfb.o |
78 | obj-$(CONFIG_FB_HECUBA) += hecubafb.o | 78 | obj-$(CONFIG_FB_HECUBA) += hecubafb.o |
diff --git a/drivers/video/amifb.c b/drivers/video/amifb.c index b8e9a8682f2d..100f23661465 100644 --- a/drivers/video/amifb.c +++ b/drivers/video/amifb.c | |||
@@ -2159,9 +2159,9 @@ static void amifb_imageblit(struct fb_info *info, const struct fb_image *image) | |||
2159 | src += pitch; | 2159 | src += pitch; |
2160 | } | 2160 | } |
2161 | } else { | 2161 | } else { |
2162 | c2p(info->screen_base, image->data, dx, dy, width, height, | 2162 | c2p_planar(info->screen_base, image->data, dx, dy, width, |
2163 | par->next_line, par->next_plane, image->width, | 2163 | height, par->next_line, par->next_plane, |
2164 | info->var.bits_per_pixel); | 2164 | image->width, info->var.bits_per_pixel); |
2165 | } | 2165 | } |
2166 | } | 2166 | } |
2167 | 2167 | ||
diff --git a/drivers/video/atafb.c b/drivers/video/atafb.c index 77eb8b34fbfa..8058572a7428 100644 --- a/drivers/video/atafb.c +++ b/drivers/video/atafb.c | |||
@@ -122,7 +122,6 @@ static struct atafb_par { | |||
122 | void *screen_base; | 122 | void *screen_base; |
123 | int yres_virtual; | 123 | int yres_virtual; |
124 | u_long next_line; | 124 | u_long next_line; |
125 | u_long next_plane; | ||
126 | #if defined ATAFB_TT || defined ATAFB_STE | 125 | #if defined ATAFB_TT || defined ATAFB_STE |
127 | union { | 126 | union { |
128 | struct { | 127 | struct { |
@@ -149,6 +148,7 @@ static struct atafb_par { | |||
149 | short mono; | 148 | short mono; |
150 | short ste_mode; | 149 | short ste_mode; |
151 | short bpp; | 150 | short bpp; |
151 | u32 pseudo_palette[16]; | ||
152 | } falcon; | 152 | } falcon; |
153 | #endif | 153 | #endif |
154 | /* Nothing needed for external mode */ | 154 | /* Nothing needed for external mode */ |
@@ -614,7 +614,7 @@ static int tt_encode_fix(struct fb_fix_screeninfo *fix, struct atafb_par *par) | |||
614 | fix->xpanstep = 0; | 614 | fix->xpanstep = 0; |
615 | fix->ypanstep = 1; | 615 | fix->ypanstep = 1; |
616 | fix->ywrapstep = 0; | 616 | fix->ywrapstep = 0; |
617 | fix->line_length = 0; | 617 | fix->line_length = par->next_line; |
618 | fix->accel = FB_ACCEL_ATARIBLITT; | 618 | fix->accel = FB_ACCEL_ATARIBLITT; |
619 | return 0; | 619 | return 0; |
620 | } | 620 | } |
@@ -691,6 +691,7 @@ static int tt_decode_var(struct fb_var_screeninfo *var, struct atafb_par *par) | |||
691 | return -EINVAL; | 691 | return -EINVAL; |
692 | par->yres_virtual = yres_virtual; | 692 | par->yres_virtual = yres_virtual; |
693 | par->screen_base = screen_base + var->yoffset * linelen; | 693 | par->screen_base = screen_base + var->yoffset * linelen; |
694 | par->next_line = linelen; | ||
694 | return 0; | 695 | return 0; |
695 | } | 696 | } |
696 | 697 | ||
@@ -884,10 +885,6 @@ static int vdl_prescale[4][3] = { | |||
884 | /* Default hsync timing [mon_type] in picoseconds */ | 885 | /* Default hsync timing [mon_type] in picoseconds */ |
885 | static long h_syncs[4] = { 3000000, 4875000, 4000000, 4875000 }; | 886 | static long h_syncs[4] = { 3000000, 4875000, 4000000, 4875000 }; |
886 | 887 | ||
887 | #ifdef FBCON_HAS_CFB16 | ||
888 | static u16 fbcon_cfb16_cmap[16]; | ||
889 | #endif | ||
890 | |||
891 | static inline int hxx_prescale(struct falcon_hw *hw) | 888 | static inline int hxx_prescale(struct falcon_hw *hw) |
892 | { | 889 | { |
893 | return hw->ste_mode ? 16 | 890 | return hw->ste_mode ? 16 |
@@ -918,7 +915,7 @@ static int falcon_encode_fix(struct fb_fix_screeninfo *fix, | |||
918 | fix->visual = FB_VISUAL_TRUECOLOR; | 915 | fix->visual = FB_VISUAL_TRUECOLOR; |
919 | fix->xpanstep = 2; | 916 | fix->xpanstep = 2; |
920 | } | 917 | } |
921 | fix->line_length = 0; | 918 | fix->line_length = par->next_line; |
922 | fix->accel = FB_ACCEL_ATARIBLITT; | 919 | fix->accel = FB_ACCEL_ATARIBLITT; |
923 | return 0; | 920 | return 0; |
924 | } | 921 | } |
@@ -1394,14 +1391,7 @@ set_screen_base: | |||
1394 | par->screen_base = screen_base + var->yoffset * linelen; | 1391 | par->screen_base = screen_base + var->yoffset * linelen; |
1395 | par->hw.falcon.xoffset = 0; | 1392 | par->hw.falcon.xoffset = 0; |
1396 | 1393 | ||
1397 | // FIXME!!! sort of works, no crash | ||
1398 | //par->next_line = linelen; | ||
1399 | //par->next_plane = yres_virtual * linelen; | ||
1400 | par->next_line = linelen; | 1394 | par->next_line = linelen; |
1401 | par->next_plane = 2; | ||
1402 | // crashes | ||
1403 | //par->next_plane = linelen; | ||
1404 | //par->next_line = yres_virtual * linelen; | ||
1405 | 1395 | ||
1406 | return 0; | 1396 | return 0; |
1407 | } | 1397 | } |
@@ -1735,10 +1725,10 @@ static int falcon_setcolreg(unsigned int regno, unsigned int red, | |||
1735 | (((red & 0xe000) >> 13) | ((red & 0x1000) >> 12) << 8) | | 1725 | (((red & 0xe000) >> 13) | ((red & 0x1000) >> 12) << 8) | |
1736 | (((green & 0xe000) >> 13) | ((green & 0x1000) >> 12) << 4) | | 1726 | (((green & 0xe000) >> 13) | ((green & 0x1000) >> 12) << 4) | |
1737 | ((blue & 0xe000) >> 13) | ((blue & 0x1000) >> 12); | 1727 | ((blue & 0xe000) >> 13) | ((blue & 0x1000) >> 12); |
1738 | #ifdef FBCON_HAS_CFB16 | 1728 | #ifdef ATAFB_FALCON |
1739 | fbcon_cfb16_cmap[regno] = ((red & 0xf800) | | 1729 | ((u32 *)info->pseudo_palette)[regno] = ((red & 0xf800) | |
1740 | ((green & 0xfc00) >> 5) | | 1730 | ((green & 0xfc00) >> 5) | |
1741 | ((blue & 0xf800) >> 11)); | 1731 | ((blue & 0xf800) >> 11)); |
1742 | #endif | 1732 | #endif |
1743 | } | 1733 | } |
1744 | return 0; | 1734 | return 0; |
@@ -1852,7 +1842,7 @@ static int stste_encode_fix(struct fb_fix_screeninfo *fix, | |||
1852 | fix->ypanstep = 0; | 1842 | fix->ypanstep = 0; |
1853 | } | 1843 | } |
1854 | fix->ywrapstep = 0; | 1844 | fix->ywrapstep = 0; |
1855 | fix->line_length = 0; | 1845 | fix->line_length = par->next_line; |
1856 | fix->accel = FB_ACCEL_ATARIBLITT; | 1846 | fix->accel = FB_ACCEL_ATARIBLITT; |
1857 | return 0; | 1847 | return 0; |
1858 | } | 1848 | } |
@@ -1910,6 +1900,7 @@ static int stste_decode_var(struct fb_var_screeninfo *var, | |||
1910 | return -EINVAL; | 1900 | return -EINVAL; |
1911 | par->yres_virtual = yres_virtual; | 1901 | par->yres_virtual = yres_virtual; |
1912 | par->screen_base = screen_base + var->yoffset * linelen; | 1902 | par->screen_base = screen_base + var->yoffset * linelen; |
1903 | par->next_line = linelen; | ||
1913 | return 0; | 1904 | return 0; |
1914 | } | 1905 | } |
1915 | 1906 | ||
@@ -2169,7 +2160,7 @@ static int ext_encode_fix(struct fb_fix_screeninfo *fix, struct atafb_par *par) | |||
2169 | fix->xpanstep = 0; | 2160 | fix->xpanstep = 0; |
2170 | fix->ypanstep = 0; | 2161 | fix->ypanstep = 0; |
2171 | fix->ywrapstep = 0; | 2162 | fix->ywrapstep = 0; |
2172 | fix->line_length = 0; | 2163 | fix->line_length = par->next_line; |
2173 | return 0; | 2164 | return 0; |
2174 | } | 2165 | } |
2175 | 2166 | ||
@@ -2184,6 +2175,8 @@ static int ext_decode_var(struct fb_var_screeninfo *var, struct atafb_par *par) | |||
2184 | var->xoffset > 0 || | 2175 | var->xoffset > 0 || |
2185 | var->yoffset > 0) | 2176 | var->yoffset > 0) |
2186 | return -EINVAL; | 2177 | return -EINVAL; |
2178 | |||
2179 | par->next_line = external_xres_virtual * external_depth / 8; | ||
2187 | return 0; | 2180 | return 0; |
2188 | } | 2181 | } |
2189 | 2182 | ||
@@ -2443,42 +2436,6 @@ static void atafb_set_disp(struct fb_info *info) | |||
2443 | atafb_get_fix(&info->fix, info); | 2436 | atafb_get_fix(&info->fix, info); |
2444 | 2437 | ||
2445 | info->screen_base = (void *)info->fix.smem_start; | 2438 | info->screen_base = (void *)info->fix.smem_start; |
2446 | |||
2447 | switch (info->fix.type) { | ||
2448 | case FB_TYPE_INTERLEAVED_PLANES: | ||
2449 | switch (info->var.bits_per_pixel) { | ||
2450 | case 2: | ||
2451 | // display->dispsw = &fbcon_iplan2p2; | ||
2452 | break; | ||
2453 | case 4: | ||
2454 | // display->dispsw = &fbcon_iplan2p4; | ||
2455 | break; | ||
2456 | case 8: | ||
2457 | // display->dispsw = &fbcon_iplan2p8; | ||
2458 | break; | ||
2459 | } | ||
2460 | break; | ||
2461 | case FB_TYPE_PACKED_PIXELS: | ||
2462 | switch (info->var.bits_per_pixel) { | ||
2463 | #ifdef FBCON_HAS_MFB | ||
2464 | case 1: | ||
2465 | // display->dispsw = &fbcon_mfb; | ||
2466 | break; | ||
2467 | #endif | ||
2468 | #ifdef FBCON_HAS_CFB8 | ||
2469 | case 8: | ||
2470 | // display->dispsw = &fbcon_cfb8; | ||
2471 | break; | ||
2472 | #endif | ||
2473 | #ifdef FBCON_HAS_CFB16 | ||
2474 | case 16: | ||
2475 | // display->dispsw = &fbcon_cfb16; | ||
2476 | // display->dispsw_data = fbcon_cfb16_cmap; | ||
2477 | break; | ||
2478 | #endif | ||
2479 | } | ||
2480 | break; | ||
2481 | } | ||
2482 | } | 2439 | } |
2483 | 2440 | ||
2484 | static int atafb_setcolreg(u_int regno, u_int red, u_int green, u_int blue, | 2441 | static int atafb_setcolreg(u_int regno, u_int red, u_int green, u_int blue, |
@@ -2549,6 +2506,13 @@ static void atafb_fillrect(struct fb_info *info, const struct fb_fillrect *rect) | |||
2549 | if (!rect->width || !rect->height) | 2506 | if (!rect->width || !rect->height) |
2550 | return; | 2507 | return; |
2551 | 2508 | ||
2509 | #ifdef ATAFB_FALCON | ||
2510 | if (info->var.bits_per_pixel == 16) { | ||
2511 | cfb_fillrect(info, rect); | ||
2512 | return; | ||
2513 | } | ||
2514 | #endif | ||
2515 | |||
2552 | /* | 2516 | /* |
2553 | * We could use hardware clipping but on many cards you get around | 2517 | * We could use hardware clipping but on many cards you get around |
2554 | * hardware clipping by writing to framebuffer directly. | 2518 | * hardware clipping by writing to framebuffer directly. |
@@ -2583,6 +2547,13 @@ static void atafb_copyarea(struct fb_info *info, const struct fb_copyarea *area) | |||
2583 | u32 dx, dy, sx, sy, width, height; | 2547 | u32 dx, dy, sx, sy, width, height; |
2584 | int rev_copy = 0; | 2548 | int rev_copy = 0; |
2585 | 2549 | ||
2550 | #ifdef ATAFB_FALCON | ||
2551 | if (info->var.bits_per_pixel == 16) { | ||
2552 | cfb_copyarea(info, area); | ||
2553 | return; | ||
2554 | } | ||
2555 | #endif | ||
2556 | |||
2586 | /* clip the destination */ | 2557 | /* clip the destination */ |
2587 | x2 = area->dx + area->width; | 2558 | x2 = area->dx + area->width; |
2588 | y2 = area->dy + area->height; | 2559 | y2 = area->dy + area->height; |
@@ -2632,6 +2603,13 @@ static void atafb_imageblit(struct fb_info *info, const struct fb_image *image) | |||
2632 | const char *src; | 2603 | const char *src; |
2633 | u32 dx, dy, width, height, pitch; | 2604 | u32 dx, dy, width, height, pitch; |
2634 | 2605 | ||
2606 | #ifdef ATAFB_FALCON | ||
2607 | if (info->var.bits_per_pixel == 16) { | ||
2608 | cfb_imageblit(info, image); | ||
2609 | return; | ||
2610 | } | ||
2611 | #endif | ||
2612 | |||
2635 | /* | 2613 | /* |
2636 | * We could use hardware clipping but on many cards you get around | 2614 | * We could use hardware clipping but on many cards you get around |
2637 | * hardware clipping by writing to framebuffer directly like we are | 2615 | * hardware clipping by writing to framebuffer directly like we are |
@@ -2676,10 +2654,9 @@ static void atafb_imageblit(struct fb_info *info, const struct fb_image *image) | |||
2676 | src += pitch; | 2654 | src += pitch; |
2677 | } | 2655 | } |
2678 | } else { | 2656 | } else { |
2679 | // only used for logo; broken | 2657 | c2p_iplan2(info->screen_base, image->data, dx, dy, width, |
2680 | c2p(info->screen_base, image->data, dx, dy, width, height, | 2658 | height, par->next_line, image->width, |
2681 | par->next_line, par->next_plane, image->width, | 2659 | info->var.bits_per_pixel); |
2682 | info->var.bits_per_pixel); | ||
2683 | } | 2660 | } |
2684 | } | 2661 | } |
2685 | 2662 | ||
@@ -3098,8 +3075,7 @@ int __init atafb_setup(char *options) | |||
3098 | 3075 | ||
3099 | int __init atafb_init(void) | 3076 | int __init atafb_init(void) |
3100 | { | 3077 | { |
3101 | int pad; | 3078 | int pad, detected_mode, error; |
3102 | int detected_mode; | ||
3103 | unsigned int defmode = 0; | 3079 | unsigned int defmode = 0; |
3104 | unsigned long mem_req; | 3080 | unsigned long mem_req; |
3105 | 3081 | ||
@@ -3139,8 +3115,12 @@ int __init atafb_init(void) | |||
3139 | printk("atafb_init: initializing Falcon hw\n"); | 3115 | printk("atafb_init: initializing Falcon hw\n"); |
3140 | fbhw = &falcon_switch; | 3116 | fbhw = &falcon_switch; |
3141 | atafb_ops.fb_setcolreg = &falcon_setcolreg; | 3117 | atafb_ops.fb_setcolreg = &falcon_setcolreg; |
3142 | request_irq(IRQ_AUTO_4, falcon_vbl_switcher, IRQ_TYPE_PRIO, | 3118 | error = request_irq(IRQ_AUTO_4, falcon_vbl_switcher, |
3143 | "framebuffer/modeswitch", falcon_vbl_switcher); | 3119 | IRQ_TYPE_PRIO, |
3120 | "framebuffer/modeswitch", | ||
3121 | falcon_vbl_switcher); | ||
3122 | if (error) | ||
3123 | return error; | ||
3144 | defmode = DEFMODE_F30; | 3124 | defmode = DEFMODE_F30; |
3145 | break; | 3125 | break; |
3146 | } | 3126 | } |
@@ -3225,6 +3205,10 @@ int __init atafb_init(void) | |||
3225 | // tries to read from HW which may not be initialized yet | 3205 | // tries to read from HW which may not be initialized yet |
3226 | // so set sane var first, then call atafb_set_par | 3206 | // so set sane var first, then call atafb_set_par |
3227 | atafb_get_var(&fb_info.var, &fb_info); | 3207 | atafb_get_var(&fb_info.var, &fb_info); |
3208 | |||
3209 | #ifdef ATAFB_FALCON | ||
3210 | fb_info.pseudo_palette = current_par.hw.falcon.pseudo_palette; | ||
3211 | #endif | ||
3228 | fb_info.flags = FBINFO_FLAG_DEFAULT; | 3212 | fb_info.flags = FBINFO_FLAG_DEFAULT; |
3229 | 3213 | ||
3230 | if (!fb_find_mode(&fb_info.var, &fb_info, mode_option, atafb_modedb, | 3214 | if (!fb_find_mode(&fb_info.var, &fb_info, mode_option, atafb_modedb, |
diff --git a/drivers/video/c2p.c b/drivers/video/c2p.c deleted file mode 100644 index 376bc07ff952..000000000000 --- a/drivers/video/c2p.c +++ /dev/null | |||
@@ -1,232 +0,0 @@ | |||
1 | /* | ||
2 | * Fast C2P (Chunky-to-Planar) Conversion | ||
3 | * | ||
4 | * Copyright (C) 2003 Geert Uytterhoeven | ||
5 | * | ||
6 | * NOTES: | ||
7 | * - This code was inspired by Scout's C2P tutorial | ||
8 | * - It assumes to run on a big endian system | ||
9 | * | ||
10 | * This file is subject to the terms and conditions of the GNU General Public | ||
11 | * License. See the file COPYING in the main directory of this archive | ||
12 | * for more details. | ||
13 | */ | ||
14 | |||
15 | #include <linux/module.h> | ||
16 | #include <linux/string.h> | ||
17 | #include "c2p.h" | ||
18 | |||
19 | |||
20 | /* | ||
21 | * Basic transpose step | ||
22 | */ | ||
23 | |||
24 | #define _transp(d, i1, i2, shift, mask) \ | ||
25 | do { \ | ||
26 | u32 t = (d[i1] ^ (d[i2] >> shift)) & mask; \ | ||
27 | d[i1] ^= t; \ | ||
28 | d[i2] ^= t << shift; \ | ||
29 | } while (0) | ||
30 | |||
31 | static inline u32 get_mask(int n) | ||
32 | { | ||
33 | switch (n) { | ||
34 | case 1: | ||
35 | return 0x55555555; | ||
36 | break; | ||
37 | |||
38 | case 2: | ||
39 | return 0x33333333; | ||
40 | break; | ||
41 | |||
42 | case 4: | ||
43 | return 0x0f0f0f0f; | ||
44 | break; | ||
45 | |||
46 | case 8: | ||
47 | return 0x00ff00ff; | ||
48 | break; | ||
49 | |||
50 | case 16: | ||
51 | return 0x0000ffff; | ||
52 | break; | ||
53 | } | ||
54 | return 0; | ||
55 | } | ||
56 | |||
57 | #define transp_nx1(d, n) \ | ||
58 | do { \ | ||
59 | u32 mask = get_mask(n); \ | ||
60 | /* First block */ \ | ||
61 | _transp(d, 0, 1, n, mask); \ | ||
62 | /* Second block */ \ | ||
63 | _transp(d, 2, 3, n, mask); \ | ||
64 | /* Third block */ \ | ||
65 | _transp(d, 4, 5, n, mask); \ | ||
66 | /* Fourth block */ \ | ||
67 | _transp(d, 6, 7, n, mask); \ | ||
68 | } while (0) | ||
69 | |||
70 | #define transp_nx2(d, n) \ | ||
71 | do { \ | ||
72 | u32 mask = get_mask(n); \ | ||
73 | /* First block */ \ | ||
74 | _transp(d, 0, 2, n, mask); \ | ||
75 | _transp(d, 1, 3, n, mask); \ | ||
76 | /* Second block */ \ | ||
77 | _transp(d, 4, 6, n, mask); \ | ||
78 | _transp(d, 5, 7, n, mask); \ | ||
79 | } while (0) | ||
80 | |||
81 | #define transp_nx4(d, n) \ | ||
82 | do { \ | ||
83 | u32 mask = get_mask(n); \ | ||
84 | _transp(d, 0, 4, n, mask); \ | ||
85 | _transp(d, 1, 5, n, mask); \ | ||
86 | _transp(d, 2, 6, n, mask); \ | ||
87 | _transp(d, 3, 7, n, mask); \ | ||
88 | } while (0) | ||
89 | |||
90 | #define transp(d, n, m) transp_nx ## m(d, n) | ||
91 | |||
92 | |||
93 | /* | ||
94 | * Perform a full C2P step on 32 8-bit pixels, stored in 8 32-bit words | ||
95 | * containing | ||
96 | * - 32 8-bit chunky pixels on input | ||
97 | * - permuted planar data on output | ||
98 | */ | ||
99 | |||
100 | static void c2p_8bpp(u32 d[8]) | ||
101 | { | ||
102 | transp(d, 16, 4); | ||
103 | transp(d, 8, 2); | ||
104 | transp(d, 4, 1); | ||
105 | transp(d, 2, 4); | ||
106 | transp(d, 1, 2); | ||
107 | } | ||
108 | |||
109 | |||
110 | /* | ||
111 | * Array containing the permution indices of the planar data after c2p | ||
112 | */ | ||
113 | |||
114 | static const int perm_c2p_8bpp[8] = { 7, 5, 3, 1, 6, 4, 2, 0 }; | ||
115 | |||
116 | |||
117 | /* | ||
118 | * Compose two values, using a bitmask as decision value | ||
119 | * This is equivalent to (a & mask) | (b & ~mask) | ||
120 | */ | ||
121 | |||
122 | static inline unsigned long comp(unsigned long a, unsigned long b, | ||
123 | unsigned long mask) | ||
124 | { | ||
125 | return ((a ^ b) & mask) ^ b; | ||
126 | } | ||
127 | |||
128 | |||
129 | /* | ||
130 | * Store a full block of planar data after c2p conversion | ||
131 | */ | ||
132 | |||
133 | static inline void store_planar(char *dst, u32 dst_inc, u32 bpp, u32 d[8]) | ||
134 | { | ||
135 | int i; | ||
136 | |||
137 | for (i = 0; i < bpp; i++, dst += dst_inc) | ||
138 | *(u32 *)dst = d[perm_c2p_8bpp[i]]; | ||
139 | } | ||
140 | |||
141 | |||
142 | /* | ||
143 | * Store a partial block of planar data after c2p conversion | ||
144 | */ | ||
145 | |||
146 | static inline void store_planar_masked(char *dst, u32 dst_inc, u32 bpp, | ||
147 | u32 d[8], u32 mask) | ||
148 | { | ||
149 | int i; | ||
150 | |||
151 | for (i = 0; i < bpp; i++, dst += dst_inc) | ||
152 | *(u32 *)dst = comp(d[perm_c2p_8bpp[i]], *(u32 *)dst, mask); | ||
153 | } | ||
154 | |||
155 | |||
156 | /* | ||
157 | * c2p - Copy 8-bit chunky image data to a planar frame buffer | ||
158 | * @dst: Starting address of the planar frame buffer | ||
159 | * @dx: Horizontal destination offset (in pixels) | ||
160 | * @dy: Vertical destination offset (in pixels) | ||
161 | * @width: Image width (in pixels) | ||
162 | * @height: Image height (in pixels) | ||
163 | * @dst_nextline: Frame buffer offset to the next line (in bytes) | ||
164 | * @dst_nextplane: Frame buffer offset to the next plane (in bytes) | ||
165 | * @src_nextline: Image offset to the next line (in bytes) | ||
166 | * @bpp: Bits per pixel of the planar frame buffer (1-8) | ||
167 | */ | ||
168 | |||
169 | void c2p(u8 *dst, const u8 *src, u32 dx, u32 dy, u32 width, u32 height, | ||
170 | u32 dst_nextline, u32 dst_nextplane, u32 src_nextline, u32 bpp) | ||
171 | { | ||
172 | int dst_idx; | ||
173 | u32 d[8], first, last, w; | ||
174 | const u8 *c; | ||
175 | u8 *p; | ||
176 | |||
177 | dst += dy*dst_nextline+(dx & ~31); | ||
178 | dst_idx = dx % 32; | ||
179 | first = ~0UL >> dst_idx; | ||
180 | last = ~(~0UL >> ((dst_idx+width) % 32)); | ||
181 | while (height--) { | ||
182 | c = src; | ||
183 | p = dst; | ||
184 | w = width; | ||
185 | if (dst_idx+width <= 32) { | ||
186 | /* Single destination word */ | ||
187 | first &= last; | ||
188 | memset(d, 0, sizeof(d)); | ||
189 | memcpy((u8 *)d+dst_idx, c, width); | ||
190 | c += width; | ||
191 | c2p_8bpp(d); | ||
192 | store_planar_masked(p, dst_nextplane, bpp, d, first); | ||
193 | p += 4; | ||
194 | } else { | ||
195 | /* Multiple destination words */ | ||
196 | w = width; | ||
197 | /* Leading bits */ | ||
198 | if (dst_idx) { | ||
199 | w = 32 - dst_idx; | ||
200 | memset(d, 0, dst_idx); | ||
201 | memcpy((u8 *)d+dst_idx, c, w); | ||
202 | c += w; | ||
203 | c2p_8bpp(d); | ||
204 | store_planar_masked(p, dst_nextplane, bpp, d, first); | ||
205 | p += 4; | ||
206 | w = width-w; | ||
207 | } | ||
208 | /* Main chunk */ | ||
209 | while (w >= 32) { | ||
210 | memcpy(d, c, 32); | ||
211 | c += 32; | ||
212 | c2p_8bpp(d); | ||
213 | store_planar(p, dst_nextplane, bpp, d); | ||
214 | p += 4; | ||
215 | w -= 32; | ||
216 | } | ||
217 | /* Trailing bits */ | ||
218 | w %= 32; | ||
219 | if (w > 0) { | ||
220 | memcpy(d, c, w); | ||
221 | memset((u8 *)d+w, 0, 32-w); | ||
222 | c2p_8bpp(d); | ||
223 | store_planar_masked(p, dst_nextplane, bpp, d, last); | ||
224 | } | ||
225 | } | ||
226 | src += src_nextline; | ||
227 | dst += dst_nextline; | ||
228 | } | ||
229 | } | ||
230 | EXPORT_SYMBOL_GPL(c2p); | ||
231 | |||
232 | MODULE_LICENSE("GPL"); | ||
diff --git a/drivers/video/c2p.h b/drivers/video/c2p.h index c77cbf17e043..6c38d40427d8 100644 --- a/drivers/video/c2p.h +++ b/drivers/video/c2p.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * Fast C2P (Chunky-to-Planar) Conversion | 2 | * Fast C2P (Chunky-to-Planar) Conversion |
3 | * | 3 | * |
4 | * Copyright (C) 2003 Geert Uytterhoeven | 4 | * Copyright (C) 2003-2008 Geert Uytterhoeven |
5 | * | 5 | * |
6 | * This file is subject to the terms and conditions of the GNU General Public | 6 | * This file is subject to the terms and conditions of the GNU General Public |
7 | * License. See the file COPYING in the main directory of this archive | 7 | * License. See the file COPYING in the main directory of this archive |
@@ -10,7 +10,10 @@ | |||
10 | 10 | ||
11 | #include <linux/types.h> | 11 | #include <linux/types.h> |
12 | 12 | ||
13 | extern void c2p(u8 *dst, const u8 *src, u32 dx, u32 dy, u32 width, u32 height, | 13 | extern void c2p_planar(void *dst, const void *src, u32 dx, u32 dy, u32 width, |
14 | u32 dst_nextline, u32 dst_nextplane, u32 src_nextline, | 14 | u32 height, u32 dst_nextline, u32 dst_nextplane, |
15 | u32 bpp); | 15 | u32 src_nextline, u32 bpp); |
16 | 16 | ||
17 | extern void c2p_iplan2(void *dst, const void *src, u32 dx, u32 dy, u32 width, | ||
18 | u32 height, u32 dst_nextline, u32 src_nextline, | ||
19 | u32 bpp); | ||
diff --git a/drivers/video/c2p_core.h b/drivers/video/c2p_core.h new file mode 100644 index 000000000000..e1035a865fb9 --- /dev/null +++ b/drivers/video/c2p_core.h | |||
@@ -0,0 +1,153 @@ | |||
1 | /* | ||
2 | * Fast C2P (Chunky-to-Planar) Conversion | ||
3 | * | ||
4 | * Copyright (C) 2003-2008 Geert Uytterhoeven | ||
5 | * | ||
6 | * NOTES: | ||
7 | * - This code was inspired by Scout's C2P tutorial | ||
8 | * - It assumes to run on a big endian system | ||
9 | * | ||
10 | * This file is subject to the terms and conditions of the GNU General Public | ||
11 | * License. See the file COPYING in the main directory of this archive | ||
12 | * for more details. | ||
13 | */ | ||
14 | |||
15 | |||
16 | /* | ||
17 | * Basic transpose step | ||
18 | */ | ||
19 | |||
20 | static inline void _transp(u32 d[], unsigned int i1, unsigned int i2, | ||
21 | unsigned int shift, u32 mask) | ||
22 | { | ||
23 | u32 t = (d[i1] ^ (d[i2] >> shift)) & mask; | ||
24 | |||
25 | d[i1] ^= t; | ||
26 | d[i2] ^= t << shift; | ||
27 | } | ||
28 | |||
29 | |||
30 | extern void c2p_unsupported(void); | ||
31 | |||
32 | static inline u32 get_mask(unsigned int n) | ||
33 | { | ||
34 | switch (n) { | ||
35 | case 1: | ||
36 | return 0x55555555; | ||
37 | |||
38 | case 2: | ||
39 | return 0x33333333; | ||
40 | |||
41 | case 4: | ||
42 | return 0x0f0f0f0f; | ||
43 | |||
44 | case 8: | ||
45 | return 0x00ff00ff; | ||
46 | |||
47 | case 16: | ||
48 | return 0x0000ffff; | ||
49 | } | ||
50 | |||
51 | c2p_unsupported(); | ||
52 | return 0; | ||
53 | } | ||
54 | |||
55 | |||
56 | /* | ||
57 | * Transpose operations on 8 32-bit words | ||
58 | */ | ||
59 | |||
60 | static inline void transp8(u32 d[], unsigned int n, unsigned int m) | ||
61 | { | ||
62 | u32 mask = get_mask(n); | ||
63 | |||
64 | switch (m) { | ||
65 | case 1: | ||
66 | /* First n x 1 block */ | ||
67 | _transp(d, 0, 1, n, mask); | ||
68 | /* Second n x 1 block */ | ||
69 | _transp(d, 2, 3, n, mask); | ||
70 | /* Third n x 1 block */ | ||
71 | _transp(d, 4, 5, n, mask); | ||
72 | /* Fourth n x 1 block */ | ||
73 | _transp(d, 6, 7, n, mask); | ||
74 | return; | ||
75 | |||
76 | case 2: | ||
77 | /* First n x 2 block */ | ||
78 | _transp(d, 0, 2, n, mask); | ||
79 | _transp(d, 1, 3, n, mask); | ||
80 | /* Second n x 2 block */ | ||
81 | _transp(d, 4, 6, n, mask); | ||
82 | _transp(d, 5, 7, n, mask); | ||
83 | return; | ||
84 | |||
85 | case 4: | ||
86 | /* Single n x 4 block */ | ||
87 | _transp(d, 0, 4, n, mask); | ||
88 | _transp(d, 1, 5, n, mask); | ||
89 | _transp(d, 2, 6, n, mask); | ||
90 | _transp(d, 3, 7, n, mask); | ||
91 | return; | ||
92 | } | ||
93 | |||
94 | c2p_unsupported(); | ||
95 | } | ||
96 | |||
97 | |||
98 | /* | ||
99 | * Transpose operations on 4 32-bit words | ||
100 | */ | ||
101 | |||
102 | static inline void transp4(u32 d[], unsigned int n, unsigned int m) | ||
103 | { | ||
104 | u32 mask = get_mask(n); | ||
105 | |||
106 | switch (m) { | ||
107 | case 1: | ||
108 | /* First n x 1 block */ | ||
109 | _transp(d, 0, 1, n, mask); | ||
110 | /* Second n x 1 block */ | ||
111 | _transp(d, 2, 3, n, mask); | ||
112 | return; | ||
113 | |||
114 | case 2: | ||
115 | /* Single n x 2 block */ | ||
116 | _transp(d, 0, 2, n, mask); | ||
117 | _transp(d, 1, 3, n, mask); | ||
118 | return; | ||
119 | } | ||
120 | |||
121 | c2p_unsupported(); | ||
122 | } | ||
123 | |||
124 | |||
125 | /* | ||
126 | * Transpose operations on 4 32-bit words (reverse order) | ||
127 | */ | ||
128 | |||
129 | static inline void transp4x(u32 d[], unsigned int n, unsigned int m) | ||
130 | { | ||
131 | u32 mask = get_mask(n); | ||
132 | |||
133 | switch (m) { | ||
134 | case 2: | ||
135 | /* Single n x 2 block */ | ||
136 | _transp(d, 2, 0, n, mask); | ||
137 | _transp(d, 3, 1, n, mask); | ||
138 | return; | ||
139 | } | ||
140 | |||
141 | c2p_unsupported(); | ||
142 | } | ||
143 | |||
144 | |||
145 | /* | ||
146 | * Compose two values, using a bitmask as decision value | ||
147 | * This is equivalent to (a & mask) | (b & ~mask) | ||
148 | */ | ||
149 | |||
150 | static inline u32 comp(u32 a, u32 b, u32 mask) | ||
151 | { | ||
152 | return ((a ^ b) & mask) ^ b; | ||
153 | } | ||
diff --git a/drivers/video/c2p_iplan2.c b/drivers/video/c2p_iplan2.c new file mode 100644 index 000000000000..19156dc6158c --- /dev/null +++ b/drivers/video/c2p_iplan2.c | |||
@@ -0,0 +1,153 @@ | |||
1 | /* | ||
2 | * Fast C2P (Chunky-to-Planar) Conversion | ||
3 | * | ||
4 | * Copyright (C) 2003-2008 Geert Uytterhoeven | ||
5 | * | ||
6 | * This file is subject to the terms and conditions of the GNU General Public | ||
7 | * License. See the file COPYING in the main directory of this archive | ||
8 | * for more details. | ||
9 | */ | ||
10 | |||
11 | #include <linux/module.h> | ||
12 | #include <linux/string.h> | ||
13 | |||
14 | #include <asm/unaligned.h> | ||
15 | |||
16 | #include "c2p.h" | ||
17 | #include "c2p_core.h" | ||
18 | |||
19 | |||
20 | /* | ||
21 | * Perform a full C2P step on 16 8-bit pixels, stored in 4 32-bit words | ||
22 | * containing | ||
23 | * - 16 8-bit chunky pixels on input | ||
24 | * - permutated planar data (2 planes per 32-bit word) on output | ||
25 | */ | ||
26 | |||
27 | static void c2p_16x8(u32 d[4]) | ||
28 | { | ||
29 | transp4(d, 8, 2); | ||
30 | transp4(d, 1, 2); | ||
31 | transp4x(d, 16, 2); | ||
32 | transp4x(d, 2, 2); | ||
33 | transp4(d, 4, 1); | ||
34 | } | ||
35 | |||
36 | |||
37 | /* | ||
38 | * Array containing the permutation indices of the planar data after c2p | ||
39 | */ | ||
40 | |||
41 | static const int perm_c2p_16x8[4] = { 1, 3, 0, 2 }; | ||
42 | |||
43 | |||
44 | /* | ||
45 | * Store a full block of iplan2 data after c2p conversion | ||
46 | */ | ||
47 | |||
48 | static inline void store_iplan2(void *dst, u32 bpp, u32 d[4]) | ||
49 | { | ||
50 | int i; | ||
51 | |||
52 | for (i = 0; i < bpp/2; i++, dst += 4) | ||
53 | put_unaligned_be32(d[perm_c2p_16x8[i]], dst); | ||
54 | } | ||
55 | |||
56 | |||
57 | /* | ||
58 | * Store a partial block of iplan2 data after c2p conversion | ||
59 | */ | ||
60 | |||
61 | static inline void store_iplan2_masked(void *dst, u32 bpp, u32 d[4], u32 mask) | ||
62 | { | ||
63 | int i; | ||
64 | |||
65 | for (i = 0; i < bpp/2; i++, dst += 4) | ||
66 | put_unaligned_be32(comp(d[perm_c2p_16x8[i]], | ||
67 | get_unaligned_be32(dst), mask), | ||
68 | dst); | ||
69 | } | ||
70 | |||
71 | |||
72 | /* | ||
73 | * c2p_iplan2 - Copy 8-bit chunky image data to an interleaved planar | ||
74 | * frame buffer with 2 bytes of interleave | ||
75 | * @dst: Starting address of the planar frame buffer | ||
76 | * @dx: Horizontal destination offset (in pixels) | ||
77 | * @dy: Vertical destination offset (in pixels) | ||
78 | * @width: Image width (in pixels) | ||
79 | * @height: Image height (in pixels) | ||
80 | * @dst_nextline: Frame buffer offset to the next line (in bytes) | ||
81 | * @src_nextline: Image offset to the next line (in bytes) | ||
82 | * @bpp: Bits per pixel of the planar frame buffer (2, 4, or 8) | ||
83 | */ | ||
84 | |||
85 | void c2p_iplan2(void *dst, const void *src, u32 dx, u32 dy, u32 width, | ||
86 | u32 height, u32 dst_nextline, u32 src_nextline, u32 bpp) | ||
87 | { | ||
88 | union { | ||
89 | u8 pixels[16]; | ||
90 | u32 words[4]; | ||
91 | } d; | ||
92 | u32 dst_idx, first, last, w; | ||
93 | const u8 *c; | ||
94 | void *p; | ||
95 | |||
96 | dst += dy*dst_nextline+(dx & ~15)*bpp; | ||
97 | dst_idx = dx % 16; | ||
98 | first = 0xffffU >> dst_idx; | ||
99 | first |= first << 16; | ||
100 | last = 0xffffU ^ (0xffffU >> ((dst_idx+width) % 16)); | ||
101 | last |= last << 16; | ||
102 | while (height--) { | ||
103 | c = src; | ||
104 | p = dst; | ||
105 | w = width; | ||
106 | if (dst_idx+width <= 16) { | ||
107 | /* Single destination word */ | ||
108 | first &= last; | ||
109 | memset(d.pixels, 0, sizeof(d)); | ||
110 | memcpy(d.pixels+dst_idx, c, width); | ||
111 | c += width; | ||
112 | c2p_16x8(d.words); | ||
113 | store_iplan2_masked(p, bpp, d.words, first); | ||
114 | p += bpp*2; | ||
115 | } else { | ||
116 | /* Multiple destination words */ | ||
117 | w = width; | ||
118 | /* Leading bits */ | ||
119 | if (dst_idx) { | ||
120 | w = 16 - dst_idx; | ||
121 | memset(d.pixels, 0, dst_idx); | ||
122 | memcpy(d.pixels+dst_idx, c, w); | ||
123 | c += w; | ||
124 | c2p_16x8(d.words); | ||
125 | store_iplan2_masked(p, bpp, d.words, first); | ||
126 | p += bpp*2; | ||
127 | w = width-w; | ||
128 | } | ||
129 | /* Main chunk */ | ||
130 | while (w >= 16) { | ||
131 | memcpy(d.pixels, c, 16); | ||
132 | c += 16; | ||
133 | c2p_16x8(d.words); | ||
134 | store_iplan2(p, bpp, d.words); | ||
135 | p += bpp*2; | ||
136 | w -= 16; | ||
137 | } | ||
138 | /* Trailing bits */ | ||
139 | w %= 16; | ||
140 | if (w > 0) { | ||
141 | memcpy(d.pixels, c, w); | ||
142 | memset(d.pixels+w, 0, 16-w); | ||
143 | c2p_16x8(d.words); | ||
144 | store_iplan2_masked(p, bpp, d.words, last); | ||
145 | } | ||
146 | } | ||
147 | src += src_nextline; | ||
148 | dst += dst_nextline; | ||
149 | } | ||
150 | } | ||
151 | EXPORT_SYMBOL_GPL(c2p_iplan2); | ||
152 | |||
153 | MODULE_LICENSE("GPL"); | ||
diff --git a/drivers/video/c2p_planar.c b/drivers/video/c2p_planar.c new file mode 100644 index 000000000000..ec7ac8526f06 --- /dev/null +++ b/drivers/video/c2p_planar.c | |||
@@ -0,0 +1,156 @@ | |||
1 | /* | ||
2 | * Fast C2P (Chunky-to-Planar) Conversion | ||
3 | * | ||
4 | * Copyright (C) 2003-2008 Geert Uytterhoeven | ||
5 | * | ||
6 | * This file is subject to the terms and conditions of the GNU General Public | ||
7 | * License. See the file COPYING in the main directory of this archive | ||
8 | * for more details. | ||
9 | */ | ||
10 | |||
11 | #include <linux/module.h> | ||
12 | #include <linux/string.h> | ||
13 | |||
14 | #include <asm/unaligned.h> | ||
15 | |||
16 | #include "c2p.h" | ||
17 | #include "c2p_core.h" | ||
18 | |||
19 | |||
20 | /* | ||
21 | * Perform a full C2P step on 32 8-bit pixels, stored in 8 32-bit words | ||
22 | * containing | ||
23 | * - 32 8-bit chunky pixels on input | ||
24 | * - permutated planar data (1 plane per 32-bit word) on output | ||
25 | */ | ||
26 | |||
27 | static void c2p_32x8(u32 d[8]) | ||
28 | { | ||
29 | transp8(d, 16, 4); | ||
30 | transp8(d, 8, 2); | ||
31 | transp8(d, 4, 1); | ||
32 | transp8(d, 2, 4); | ||
33 | transp8(d, 1, 2); | ||
34 | } | ||
35 | |||
36 | |||
37 | /* | ||
38 | * Array containing the permutation indices of the planar data after c2p | ||
39 | */ | ||
40 | |||
41 | static const int perm_c2p_32x8[8] = { 7, 5, 3, 1, 6, 4, 2, 0 }; | ||
42 | |||
43 | |||
44 | /* | ||
45 | * Store a full block of planar data after c2p conversion | ||
46 | */ | ||
47 | |||
48 | static inline void store_planar(void *dst, u32 dst_inc, u32 bpp, u32 d[8]) | ||
49 | { | ||
50 | int i; | ||
51 | |||
52 | for (i = 0; i < bpp; i++, dst += dst_inc) | ||
53 | put_unaligned_be32(d[perm_c2p_32x8[i]], dst); | ||
54 | } | ||
55 | |||
56 | |||
57 | /* | ||
58 | * Store a partial block of planar data after c2p conversion | ||
59 | */ | ||
60 | |||
61 | static inline void store_planar_masked(void *dst, u32 dst_inc, u32 bpp, | ||
62 | u32 d[8], u32 mask) | ||
63 | { | ||
64 | int i; | ||
65 | |||
66 | for (i = 0; i < bpp; i++, dst += dst_inc) | ||
67 | put_unaligned_be32(comp(d[perm_c2p_32x8[i]], | ||
68 | get_unaligned_be32(dst), mask), | ||
69 | dst); | ||
70 | } | ||
71 | |||
72 | |||
73 | /* | ||
74 | * c2p_planar - Copy 8-bit chunky image data to a planar frame buffer | ||
75 | * @dst: Starting address of the planar frame buffer | ||
76 | * @dx: Horizontal destination offset (in pixels) | ||
77 | * @dy: Vertical destination offset (in pixels) | ||
78 | * @width: Image width (in pixels) | ||
79 | * @height: Image height (in pixels) | ||
80 | * @dst_nextline: Frame buffer offset to the next line (in bytes) | ||
81 | * @dst_nextplane: Frame buffer offset to the next plane (in bytes) | ||
82 | * @src_nextline: Image offset to the next line (in bytes) | ||
83 | * @bpp: Bits per pixel of the planar frame buffer (1-8) | ||
84 | */ | ||
85 | |||
86 | void c2p_planar(void *dst, const void *src, u32 dx, u32 dy, u32 width, | ||
87 | u32 height, u32 dst_nextline, u32 dst_nextplane, | ||
88 | u32 src_nextline, u32 bpp) | ||
89 | { | ||
90 | union { | ||
91 | u8 pixels[32]; | ||
92 | u32 words[8]; | ||
93 | } d; | ||
94 | u32 dst_idx, first, last, w; | ||
95 | const u8 *c; | ||
96 | void *p; | ||
97 | |||
98 | dst += dy*dst_nextline+(dx & ~31); | ||
99 | dst_idx = dx % 32; | ||
100 | first = 0xffffffffU >> dst_idx; | ||
101 | last = ~(0xffffffffU >> ((dst_idx+width) % 32)); | ||
102 | while (height--) { | ||
103 | c = src; | ||
104 | p = dst; | ||
105 | w = width; | ||
106 | if (dst_idx+width <= 32) { | ||
107 | /* Single destination word */ | ||
108 | first &= last; | ||
109 | memset(d.pixels, 0, sizeof(d)); | ||
110 | memcpy(d.pixels+dst_idx, c, width); | ||
111 | c += width; | ||
112 | c2p_32x8(d.words); | ||
113 | store_planar_masked(p, dst_nextplane, bpp, d.words, | ||
114 | first); | ||
115 | p += 4; | ||
116 | } else { | ||
117 | /* Multiple destination words */ | ||
118 | w = width; | ||
119 | /* Leading bits */ | ||
120 | if (dst_idx) { | ||
121 | w = 32 - dst_idx; | ||
122 | memset(d.pixels, 0, dst_idx); | ||
123 | memcpy(d.pixels+dst_idx, c, w); | ||
124 | c += w; | ||
125 | c2p_32x8(d.words); | ||
126 | store_planar_masked(p, dst_nextplane, bpp, | ||
127 | d.words, first); | ||
128 | p += 4; | ||
129 | w = width-w; | ||
130 | } | ||
131 | /* Main chunk */ | ||
132 | while (w >= 32) { | ||
133 | memcpy(d.pixels, c, 32); | ||
134 | c += 32; | ||
135 | c2p_32x8(d.words); | ||
136 | store_planar(p, dst_nextplane, bpp, d.words); | ||
137 | p += 4; | ||
138 | w -= 32; | ||
139 | } | ||
140 | /* Trailing bits */ | ||
141 | w %= 32; | ||
142 | if (w > 0) { | ||
143 | memcpy(d.pixels, c, w); | ||
144 | memset(d.pixels+w, 0, 32-w); | ||
145 | c2p_32x8(d.words); | ||
146 | store_planar_masked(p, dst_nextplane, bpp, | ||
147 | d.words, last); | ||
148 | } | ||
149 | } | ||
150 | src += src_nextline; | ||
151 | dst += dst_nextline; | ||
152 | } | ||
153 | } | ||
154 | EXPORT_SYMBOL_GPL(c2p_planar); | ||
155 | |||
156 | MODULE_LICENSE("GPL"); | ||
diff --git a/drivers/video/console/fbcon.c b/drivers/video/console/fbcon.c index 4bcff81b50e0..1657b9608b04 100644 --- a/drivers/video/console/fbcon.c +++ b/drivers/video/console/fbcon.c | |||
@@ -78,13 +78,6 @@ | |||
78 | #include <asm/fb.h> | 78 | #include <asm/fb.h> |
79 | #include <asm/irq.h> | 79 | #include <asm/irq.h> |
80 | #include <asm/system.h> | 80 | #include <asm/system.h> |
81 | #ifdef CONFIG_ATARI | ||
82 | #include <asm/atariints.h> | ||
83 | #endif | ||
84 | #if defined(__mc68000__) | ||
85 | #include <asm/machdep.h> | ||
86 | #include <asm/setup.h> | ||
87 | #endif | ||
88 | 81 | ||
89 | #include "fbcon.h" | 82 | #include "fbcon.h" |
90 | 83 | ||
@@ -155,9 +148,6 @@ static int fbcon_set_origin(struct vc_data *); | |||
155 | 148 | ||
156 | #define CURSOR_DRAW_DELAY (1) | 149 | #define CURSOR_DRAW_DELAY (1) |
157 | 150 | ||
158 | /* # VBL ints between cursor state changes */ | ||
159 | #define ATARI_CURSOR_BLINK_RATE (42) | ||
160 | |||
161 | static int vbl_cursor_cnt; | 151 | static int vbl_cursor_cnt; |
162 | static int fbcon_cursor_noblink; | 152 | static int fbcon_cursor_noblink; |
163 | 153 | ||
@@ -403,20 +393,6 @@ static void fb_flashcursor(struct work_struct *work) | |||
403 | release_console_sem(); | 393 | release_console_sem(); |
404 | } | 394 | } |
405 | 395 | ||
406 | #ifdef CONFIG_ATARI | ||
407 | static int cursor_blink_rate; | ||
408 | static irqreturn_t fb_vbl_handler(int irq, void *dev_id) | ||
409 | { | ||
410 | struct fb_info *info = dev_id; | ||
411 | |||
412 | if (vbl_cursor_cnt && --vbl_cursor_cnt == 0) { | ||
413 | schedule_work(&info->queue); | ||
414 | vbl_cursor_cnt = cursor_blink_rate; | ||
415 | } | ||
416 | return IRQ_HANDLED; | ||
417 | } | ||
418 | #endif | ||
419 | |||
420 | static void cursor_timer_handler(unsigned long dev_addr) | 396 | static void cursor_timer_handler(unsigned long dev_addr) |
421 | { | 397 | { |
422 | struct fb_info *info = (struct fb_info *) dev_addr; | 398 | struct fb_info *info = (struct fb_info *) dev_addr; |
@@ -1017,15 +993,6 @@ static const char *fbcon_startup(void) | |||
1017 | info->var.yres, | 993 | info->var.yres, |
1018 | info->var.bits_per_pixel); | 994 | info->var.bits_per_pixel); |
1019 | 995 | ||
1020 | #ifdef CONFIG_ATARI | ||
1021 | if (MACH_IS_ATARI) { | ||
1022 | cursor_blink_rate = ATARI_CURSOR_BLINK_RATE; | ||
1023 | (void)request_irq(IRQ_AUTO_4, fb_vbl_handler, | ||
1024 | IRQ_TYPE_PRIO, "framebuffer vbl", | ||
1025 | info); | ||
1026 | } | ||
1027 | #endif /* CONFIG_ATARI */ | ||
1028 | |||
1029 | fbcon_add_cursor_timer(info); | 996 | fbcon_add_cursor_timer(info); |
1030 | fbcon_has_exited = 0; | 997 | fbcon_has_exited = 0; |
1031 | return display_desc; | 998 | return display_desc; |
@@ -3454,11 +3421,6 @@ static void fbcon_exit(void) | |||
3454 | if (fbcon_has_exited) | 3421 | if (fbcon_has_exited) |
3455 | return; | 3422 | return; |
3456 | 3423 | ||
3457 | #ifdef CONFIG_ATARI | ||
3458 | if (MACH_IS_ATARI) | ||
3459 | free_irq(IRQ_AUTO_4, fb_vbl_handler); | ||
3460 | #endif | ||
3461 | |||
3462 | kfree((void *)softback_buf); | 3424 | kfree((void *)softback_buf); |
3463 | softback_buf = 0UL; | 3425 | softback_buf = 0UL; |
3464 | 3426 | ||