]> git.pld-linux.org Git - packages/kernel.git/blob - kernel-fb-modules.patch
- ported from linux-2.4.25-atmdd.patch
[packages/kernel.git] / kernel-fb-modules.patch
1 diff -urN orig/drivers/video/Config.in linux/drivers/video/Config.in
2 --- orig/drivers/video/Config.in        Mon Sep  4 13:39:22 2000
3 +++ linux/drivers/video/Config.in       Mon Oct  2 16:23:19 2000
4 @@ -6,7 +6,7 @@
5    define_bool CONFIG_DUMMY_CONSOLE y
6    if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then
7      if [ "$CONFIG_AMIGA" = "y" -o "$CONFIG_PCI" = "y" ]; then
8 -      bool 'Permedia2 support (experimental)' CONFIG_FB_PM2
9 +      tristate 'Permedia2 support (experimental)' CONFIG_FB_PM2
10        if [ "$CONFIG_FB_PM2" = "y" ]; then
11          if [ "$CONFIG_PCI" = "y" ]; then
12            bool '  enable FIFO disconnect feature' CONFIG_FB_PM2_FIFO_DISCONNECT
13 @@ -51,7 +51,7 @@
14      bool 'Atari native chipset support' CONFIG_FB_ATARI
15    fi
16    if [ "$CONFIG_ATARI" = "y" -o "$CONFIG_PCI" != "n" ]; then
17 -    bool 'ATI Mach64 display support' CONFIG_FB_ATY
18 +    tristate 'ATI Mach64 display support' CONFIG_FB_ATY
19    fi
20    if [ "$CONFIG_PPC" = "y" ]; then
21      bool 'Open Firmware frame buffer device support' CONFIG_FB_OF
22 @@ -84,7 +84,7 @@
23      define_bool CONFIG_BUS_I2C y
24    fi
25    if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then
26 -    if [ "$CONFIG_PCI" != "n" ]; then
27 +    if [ "$CONFIG_PCI" != "n" -a "$ARCH" != "sparc" -a "$ARCH" != "sparc64" ]; then
28        tristate 'Matrox acceleration' CONFIG_FB_MATROX
29        if  [ "$CONFIG_FB_MATROX" != "n" ]; then
30          bool '  Millennium I/II support' CONFIG_FB_MATROX_MILLENIUM
31 diff -urN orig/drivers/video/atyfb.c linux/drivers/video/atyfb.c
32 --- orig/drivers/video/atyfb.c  Mon Sep  4 13:39:22 2000
33 +++ linux/drivers/video/atyfb.c Mon Oct  2 16:21:33 2000
34 @@ -394,7 +394,7 @@
35       *  Interface used by the world
36       */
37  
38 -void atyfb_init(void);
39 +int atyfb_init(void);
40  #ifdef CONFIG_FB_OF
41  void atyfb_of_init(struct device_node *dp);
42  #endif
43 @@ -2880,7 +2880,7 @@
44      return 1;
45  }
46  
47 -__initfunc(void atyfb_init(void))
48 +int __init atyfb_init(void)
49  {
50  #if defined(CONFIG_FB_OF)
51      /* We don't want to be called like this. */
52 @@ -2900,7 +2900,7 @@
53  
54      /* Do not attach when we have a serial console. */
55      if (!con_is_present())
56 -       return;
57 +       return 0;
58  #else
59      u16 tmp;
60  #endif
61 @@ -2912,7 +2912,7 @@
62             info = kmalloc(sizeof(struct fb_info_aty), GFP_ATOMIC);
63             if (!info) {
64                 printk("atyfb_init: can't alloc fb_info_aty\n");
65 -               return;
66 +               return 0;
67             }
68             memset(info, 0, sizeof(struct fb_info_aty));
69  
70 @@ -2948,7 +2948,7 @@
71             if (!info->mmap_map) {
72                 printk("atyfb_init: can't alloc mmap_map\n");
73                 kfree(info);
74 -               return;
75 +               return 0;
76             }
77             memset(info->mmap_map, 0, j * sizeof(*info->mmap_map));
78  
79 @@ -3133,7 +3133,7 @@
80  
81             if(!info->ati_regbase) {
82                     kfree(info);
83 -                   return;
84 +                   return 0;
85             }
86  
87             info->ati_regbase_phys += 0xc00;
88 @@ -3160,7 +3160,7 @@
89  
90             if(!info->frame_buffer) {
91                     kfree(info);
92 -                   return;
93 +                   return 0;
94             }
95  
96  #endif /* __sparc__ */
97 @@ -3169,7 +3169,7 @@
98                 if (info->mmap_map)
99                     kfree(info->mmap_map);
100                 kfree(info);
101 -               return;
102 +               return 0;
103             }
104  
105  #ifdef __sparc__
106 @@ -3207,7 +3207,7 @@
107         info = kmalloc(sizeof(struct fb_info_aty), GFP_ATOMIC);
108         if (!info) {
109             printk("atyfb_init: can't alloc fb_info_aty\n");
110 -           return;
111 +           return 0;
112         }
113         memset(info, 0, sizeof(struct fb_info_aty));
114  
115 @@ -3223,10 +3223,11 @@
116         if (!aty_init(info, "ISA bus")) {
117             kfree(info);
118             /* This is insufficient! kernel_map has added two large chunks!! */
119 -           return;
120 +           return 0;
121         }
122      }
123  #endif
124 +    return 1;
125  }
126  
127  #ifdef CONFIG_FB_OF
128 @@ -4213,3 +4214,46 @@
129         return result;
130  }
131  #endif /* CONFIG_PMAC_PBOOK */
132 +
133 +#ifdef MODULE
134 +
135 +int blink = 1;
136 +static u32 vram = 0;
137 +static int pll = 0;
138 +static int mclk = 0;
139 +#if defined(CONFIG_PPC)
140 +static int vmode = VMODE_NVRAM;
141 +static int cmode = CMODE_NVRAM;
142 +#endif
143 +
144 +MODULE_PARM(noaccel, "i");
145 +MODULE_PARM_DESC(noaccel, "Do not use accelerating engine (0 or 1=disabled) (default=0)");
146 +MODULE_PARM(blink, "i");
147 +MODULE_PARM_DESC(blink, "Enables hardware cursor blinking (0 or 1) (default=1)");
148 +#ifdef CONFIG_PPC
149 +MODULE_PARM(vmode, "i");
150 +MODULE_PARM_DESC(vmode, "Specify the vmode mode number that should be used (640x480 default)");
151 +MODULE_PARM(cmode, "i");
152 +MODULE_PARM_DESC(cmode, "Specify the video depth that should be used (8bit default)");
153 +#endif
154 +
155 +int init_module(void)
156 +{
157 +       curblink = blink;
158 +       default_vram = vram;
159 +       default_pll = pll;
160 +       default_mclk = mclk;
161 +#ifdef CONFIG_PPC
162 +       default_vmode = vmode;
163 +       default_cmode = cmode;
164 +#endif
165 +       if (!atyfb_init())
166 +               return -ENXIO;
167 +       MOD_INC_USE_COUNT;
168 +       return 0;
169 +}
170 +
171 +void cleanup_module(void)
172 +{
173 +}
174 +#endif /* MODULE */
175 diff -urN orig/drivers/video/pm2fb.c linux/drivers/video/pm2fb.c
176 --- orig/drivers/video/pm2fb.c  Mon Sep  4 13:39:22 2000
177 +++ linux/drivers/video/pm2fb.c Mon Oct  2 16:21:33 2000
178 @@ -2041,12 +2041,12 @@
179                 board_table[i->board].cleanup(i);
180  }
181  
182 -__initfunc(void pm2fb_init(void)) {
183 +int __init pm2fb_init(void) {
184  
185         memset(&fb_info, 0, sizeof(fb_info));
186         memcpy(&fb_info.current_par, &pm2fb_options.user_mode, sizeof(fb_info.current_par));
187         if (!pm2fb_conf(&fb_info))
188 -               return;
189 +               return 0;
190         pm2fb_reset(&fb_info);
191         fb_info.disp.scrollmode=SCROLL_YNOMOVE;
192         fb_info.gen.parsize=sizeof(struct pm2fb_par);
193 @@ -2065,7 +2065,7 @@
194         fbgen_install_cmap(0, &fb_info.gen);
195         if (register_framebuffer(&fb_info.gen.info)<0) {
196                 printk("pm2fb: unable to register.\n");
197 -               return;
198 +               return 0;
199         }
200         printk("fb%d: %s (%s), using %uK of video memory.\n",
201                                 GET_FB_IDX(fb_info.gen.info.node),
202 @@ -2073,6 +2073,7 @@
203                                 permedia2_name,
204                                 (u32 )(fb_info.regions.fb_size>>10));
205         MOD_INC_USE_COUNT;
206 +       return 1;
207  }
208  
209  static void __init pm2fb_mode_setup(char* options) {
210 @@ -2127,7 +2128,8 @@
211  
212  int init_module(void) {
213         if (mode) pm2fb_mode_setup(mode);
214 -       pm2fb_init();
215 +       if (!pm2fb_init())
216 +               return -ENXIO;
217  }
218  
219  void cleanup_module(void) {
This page took 0.100178 seconds and 3 git commands to generate.