/[gentoo-src]/Xorgautoconfig/Xorgautoconfig.c
Gentoo

Diff of /Xorgautoconfig/Xorgautoconfig.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.6 Revision 1.7
215 /* Work out the card specifics to figure out if we need DRI, etc. */ 215 /* Work out the card specifics to figure out if we need DRI, etc. */
216 depth = 16; 216 depth = 16;
217 if (nv) { 217 if (nv) {
218 if (!strncmp(macid, "PowerMac4,2", 11) || !strncmp(macid, "PowerMac4,5", 11)) 218 if (!strncmp(macid, "PowerMac4,2", 11) || !strncmp(macid, "PowerMac4,5", 11))
219 fprintf(f, " Option \"FlatPanel\"\n"); 219 fprintf(f, " Option \"FlatPanel\"\n");
220 videolen -= snprintf(videobuf, videolen, "%s", driver_nv); 220 videolen -= snprintf(videobuf + strlen(videobuf), videolen, "%s", driver_nv);
221 videolen -= snprintf(videobuf, videolen, " Driver\t\"nv\"\n"); 221 videolen -= snprintf(videobuf + strlen(videobuf), videolen, " Driver\t\"nv\"\n");
222 dri = FALSE; 222 dri = FALSE;
223 } else if((fbdev) || (bus == 0 && dev == 0 && func == 0)) { 223 } else if((fbdev) || (bus == 0 && dev == 0 && func == 0)) {
224 if (!fbdev) { 224 if (!fbdev) {
225 videolen -= snprintf(videobuf, videolen, " # We couldn't determine the BusID of your "); 225 videolen -= snprintf(videobuf + strlen(videobuf), videolen, " # We couldn't determine the BusID of your ");
226 videolen -= snprintf(videobuf, videolen, "video card. So we will use\n# the fbdev driver\n"); 226 videolen -= snprintf(videobuf + strlen(videobuf), videolen, "video card. So we will use\n# the fbdev driver\n");
227 } 227 }
228 videolen -= snprintf(videobuf, videolen, " #Option \"ShadowFB\" \"true\"\n"); 228 videolen -= snprintf(videobuf + strlen(videobuf), videolen, " #Option \"ShadowFB\" \"true\"\n");
229 videolen -= snprintf(videobuf, videolen, " #Option \"fbdev\" \"%s\"\n", name); 229 videolen -= snprintf(videobuf + strlen(videobuf), videolen, " #Option \"fbdev\" \"%s\"\n", name);
230 videolen -= snprintf(videobuf, videolen, " Driver\t\"fbdev\"\n"); 230 videolen -= snprintf(videobuf + strlen(videobuf), videolen, " Driver\t\"fbdev\"\n");
231 videolen -= snprintf(videobuf, videolen, " #BusID \"0:0:0\"\n"); 231 videolen -= snprintf(videobuf + strlen(videobuf), videolen, " #BusID \"0:0:0\"\n");
232 depth = 15; 232 depth = 15;
233 dri = FALSE; 233 dri = FALSE;
234 } else { 234 } else {
235 /* Try and guess what video card is behind /dev/fb0 */ 235 /* Try and guess what video card is behind /dev/fb0 */
236 switch(fix.accel) { 236 switch(fix.accel) {
237 /* ATI Mach64 Family cards */ 237 /* ATI Mach64 Family cards */
238 case 6: 238 case 6:
239 case 8: 239 case 8:
240 case 9: 240 case 9:
241 case 10: 241 case 10:
242 videolen -= snprintf(videobuf, videolen, "%s", driver_on_opts); 242 videolen -= snprintf(videobuf + strlen(videobuf), videolen, "%s", driver_on_opts);
243 videolen -= snprintf(videobuf, videolen, " Driver\t\"ati\"\n"); 243 videolen -= snprintf(videobuf + strlen(videobuf), videolen, " Driver\t\"ati\"\n");
244 dri = FALSE; /* Can this be enabled? */ 244 dri = FALSE; /* Can this be enabled? */
245 break; 245 break;
246 /* IMS Twin Turbo */ 246 /* IMS Twin Turbo */
247 case 14: 247 case 14:
248 videolen -= snprintf(videobuf, videolen, "%s", driver_off_opts); 248 videolen -= snprintf(videobuf + strlen(videobuf), videolen, "%s", driver_off_opts);
249 videolen -= snprintf(videobuf, videolen, " Driver\t\"imstt\"\n"); 249 videolen -= snprintf(videobuf + strlen(videobuf), videolen, " Driver\t\"imstt\"\n");
250 dri = FALSE; /* Can this be enabled? */ 250 dri = FALSE; /* Can this be enabled? */
251 break; 251 break;
252 /* Matrox Family */ 252 /* Matrox Family */
253 case 16: 253 case 16:
254 case 17: 254 case 17:
255 case 18: 255 case 18:
256 case 20: 256 case 20:
257 case 21: 257 case 21:
258 case 26: 258 case 26:
259 videolen -= snprintf(videobuf, videolen, "%s", driver_off_opts); 259 videolen -= snprintf(videobuf + strlen(videobuf), videolen, "%s", driver_off_opts);
260 videolen -= snprintf(videobuf, videolen, " Driver\t\"mga\"\n"); 260 videolen -= snprintf(videobuf + strlen(videobuf), videolen, " Driver\t\"mga\"\n");
261 dri = FALSE; /* Can this be enabled? */ 261 dri = FALSE; /* Can this be enabled? */
262 break; 262 break;
263 /* Chips&Technology 6555x */ 263 /* Chips&Technology 6555x */
264 /* Is this still broken? 264 /* Is this still broken?
265 case 30: 265 case 30:
266 videolen -= snprintf(videobuf, videolen, "%s", driver_off_opts); 266 videolen -= snprintf(videobuf + strlen(videobuf), videolen, "%s", driver_off_opts);
267 videolen -= snprintf(videobuf, videolen, " Driver\t\"chips\"\n"); 267 videolen -= snprintf(videobuf + strlen(videobuf), videolen, " Driver\t\"chips\"\n");
268 dri = FALSE; 268 dri = FALSE;
269 break; 269 break;
270 */ 270 */
271 /* VooDoo 3 / Banshee */ 271 /* VooDoo 3 / Banshee */
272 case 31: 272 case 31:
273 videolen -= snprintf(videobuf, videolen, "%s", driver_off_opts); 273 videolen -= snprintf(videobuf + strlen(videobuf), videolen, "%s", driver_off_opts);
274 videolen -= snprintf(videobuf, videolen, " Driver\t\"tdfx\"\n"); 274 videolen -= snprintf(videobuf + strlen(videobuf), videolen, " Driver\t\"tdfx\"\n");
275 dri = FALSE; /* Can this be enabled? */ 275 dri = FALSE; /* Can this be enabled? */
276 break; 276 break;
277 /* ATI Rage 128 Family */ 277 /* ATI Rage 128 Family */
278 case 32: 278 case 32:
279 videolen -= snprintf(videobuf, videolen, "%s", driver_r128); 279 videolen -= snprintf(videobuf + strlen(videobuf), videolen, "%s", driver_r128);
280 videolen -= snprintf(videobuf, videolen, " Driver\t\"r128\"\n"); 280 videolen -= snprintf(videobuf + strlen(videobuf), videolen, " Driver\t\"r128\"\n");
281 dri = TRUE; 281 dri = TRUE;
282 break; 282 break;
283 /* ATI Radeon */ 283 /* ATI Radeon */
284 /* FIXME what are the values for radeon > 9200? */ 284 /* FIXME what are the values for radeon > 9200? */
285 case 38: 285 case 38:
286 videolen -= snprintf(videobuf, videolen, "%s", driver_radeon); 286 videolen -= snprintf(videobuf + strlen(videobuf), videolen, "%s", driver_radeon);
287 if(!strncmp(macid + 5, "Pegasos", 7)) 287 if(!strncmp(macid + 5, "Pegasos", 7))
288 videolen -= snprintf(videobuf, videolen, "%s", "\tOption\t\"BusType\"\t\"PCI\""); 288 videolen -= snprintf(videobuf + strlen(videobuf), videolen, "%s", "\tOption\t\"BusType\"\t\"PCI\"");
289 videolen -= snprintf(videobuf, videolen, " Driver\t\"radeon\"\n"); 289 videolen -= snprintf(videobuf + strlen(videobuf), videolen, " Driver\t\"radeon\"\n");
290 dri = TRUE; 290 dri = TRUE;
291 break; 291 break;
292 default: 292 default:
293 /* FIXME still broken? */ 293 /* FIXME still broken? */
294 /* radeon seems to be broken on VE (aka 7000) */ 294 /* radeon seems to be broken on VE (aka 7000) */
295 if ((!strncmp(fix.id, "ATI Radeon", 10)) && 295 if ((!strncmp(fix.id, "ATI Radeon", 10)) &&
296 (strncmp(fix.id, "ATI Radeon VE", 13))) { 296 (strncmp(fix.id, "ATI Radeon VE", 13))) {
297 videolen -= snprintf(videobuf, videolen, "%s", driver_radeon); 297 videolen -= snprintf(videobuf + strlen(videobuf), videolen, "%s", driver_radeon);
298 if(!strncmp(macid + 5, "Pegasos", 7)) 298 if(!strncmp(macid + 5, "Pegasos", 7))
299 videolen -= snprintf(videobuf, videolen, "%s", "\tOption\t\"BusType\"\t\"PCI\""); 299 videolen -= snprintf(videobuf + strlen(videobuf), videolen, "%s", "\tOption\t\"BusType\"\t\"PCI\"");
300 videolen -= snprintf(videobuf, videolen, " Driver\t\"radeon\"\n"); 300 videolen -= snprintf(videobuf + strlen(videobuf), videolen, " Driver\t\"radeon\"\n");
301 dri = TRUE; 301 dri = TRUE;
302 } else if (!strncmp(fix.id, "Rage128", 7)) { 302 } else if (!strncmp(fix.id, "Rage128", 7)) {
303 videolen -= snprintf(videobuf, videolen, "%s", driver_r128); 303 videolen -= snprintf(videobuf + strlen(videobuf), videolen, "%s", driver_r128);
304 videolen -= snprintf(videobuf, videolen, " Driver\t\"r128\"\n"); 304 videolen -= snprintf(videobuf + strlen(videobuf), videolen, " Driver\t\"r128\"\n");
305 dri = TRUE; 305 dri = TRUE;
306 } else if (!strncmp(fix.id, "Rage Mobility M3", 16)) { 306 } else if (!strncmp(fix.id, "Rage Mobility M3", 16)) {
307 videolen -= snprintf(videobuf, videolen, "%s", driver_r128); 307 videolen -= snprintf(videobuf + strlen(videobuf), videolen, "%s", driver_r128);
308 videolen -= snprintf(videobuf, videolen, " Driver\t\"r128\"\n"); 308 videolen -= snprintf(videobuf + strlen(videobuf), videolen, " Driver\t\"r128\"\n");
309 dri = TRUE; 309 dri = TRUE;
310 } else { 310 } else {
311 videolen -= snprintf(videobuf, videolen, " #Option \"ShadowFB\" \"true\"\n"); 311 videolen -= snprintf(videobuf + strlen(videobuf), videolen, " #Option \"ShadowFB\" \"true\"\n");
312 videolen -= snprintf(videobuf, videolen, " Driver\t\"fbdev\"\n"); 312 videolen -= snprintf(videobuf + strlen(videobuf), videolen, " Driver\t\"fbdev\"\n");
313 dri = FALSE; 313 dri = FALSE;
314 depth = 15; 314 depth = 15;
315 } 315 }
316 break; 316 break;
317 } 317 }
318 videolen -= snprintf(videobuf, videolen, " BusID \"PCI:%d:%d:%d\"\n", bus, dev, func); 318 videolen -= snprintf(videobuf + strlen(videobuf), videolen, " BusID \"PCI:%d:%d:%d\"\n", bus, dev, func);
319 } 319 }
320 320
321 /* Let's be nice and backup an existing xorg.conf */ 321 /* Let's be nice and backup an existing xorg.conf */
322 if ((f = fopen("/etc/X11/xorg.conf", "r"))) { 322 if ((f = fopen("/etc/X11/xorg.conf", "r"))) {
323 system("mv /etc/X11/xorg.conf /etc/X11/xorg.conf.autobak"); 323 system("mv /etc/X11/xorg.conf /etc/X11/xorg.conf.autobak");

Legend:
Removed from v.1.6  
changed lines
  Added in v.1.7

  ViewVC Help
Powered by ViewVC 1.1.20