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

Diff of /Xorgautoconfig/Xorgautoconfig.c

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

Revision 1.1.1.1 Revision 1.21
1/* Xorgautoconfig: versatile xorg.conf creation tool for PowerPC 1/* Xorgautoconfig: versatile xorg.conf creation tool for PowerPC
2 * 2 *
3 * Copyright (C) 2005 Lars Weiler <pylon@gentoo.org> 3 * Copyright (C) 2005 Lars Weiler <pylon@gentoo.org>
4 * Copyright (C) 2005 Joseph Jezak <josejx@gentoo.org>
4 * 5 *
5 * This xorg.conf creation tool is a fork from Xautoconfig-0.23 6 * This xorg.conf creation tool is a fork from Xautoconfig-0.23
6 * (http://ftp.penguinppc.org/projects/xautocfg/) 7 * (http://ftp.penguinppc.org/projects/xautocfg/)
7 * 8 *
8 * The original header-comment contained: 9 * The original header-comment contained:
9 * Copyright (C) 2002-2004 Dan Burcaw <dan@ydl.net> 10 * Copyright (C) 2002-2004 Dan Burcaw <dan@ydl.net>
10 * Copyright (C) 1999-2001 Tom Rini <trini@kernel.crashing.org> 11 * Copyright (C) 1999-2001 Tom Rini <trini@kernel.crashing.org>
11 * 12 *
12 * Thanks for this good start for a X.Org configurator! 13 * Thanks for this good start for an X.Org configurator!
13 * 14 *
14 */ 15 */
15 16
16#define _GNU_SOURCE 17#define _GNU_SOURCE
17#include <stdio.h> 18#include <stdio.h>
28#include <sys/syscall.h> 29#include <sys/syscall.h>
29#include <sys/mman.h> 30#include <sys/mman.h>
30#include <netinet/in.h> 31#include <netinet/in.h>
31#include <linux/fb.h> 32#include <linux/fb.h>
32#include <byteswap.h> 33#include <byteswap.h>
34#include <dirent.h>
35#include <sys/utsname.h>
36#include <pci/pci.h>
33 37
34#include "ddcprobe/common.h" 38#include "ddcprobe/common.h"
35#include "ddcprobe/vesamode.h" 39#include "ddcprobe/vesamode.h"
36#include "Xorgtext.h" 40#include "Xorgtext.h"
37 41
50}; 54};
51 55
52int main(int argc, char **argv) { 56int main(int argc, char **argv) {
53 FILE * f; 57 FILE * f;
54 int i, depth, fd; 58 int i, depth, fd;
55 int rc = 0, offb = 0, fbdepth = 0, fbdev = 0, nv = 0; 59 int rc = 0, offb = 0, fbdepth = 0, fbdev = 0, nv = 0, forcebus = 0;
56 unsigned int xsstart, xsend, xtotal = 0; 60 unsigned int xsstart, xsend, xtotal = 0;
57 unsigned int ysstart, ysend, ytotal = 0; 61 unsigned int ysstart, ysend, ytotal = 0;
58 double drate, vrate, hrate; 62 double drate, vrate, hrate;
59 unsigned int htotal, vtotal; 63 unsigned int htotal, vtotal;
60 char manufacturer[4]; 64 char manufacturer[4];
66 70
67 const char * name = "/dev/fb0"; 71 const char * name = "/dev/fb0";
68 unsigned char *mem; 72 unsigned char *mem;
69 char *macid; 73 char *macid;
70 char *eisaid; 74 char *eisaid;
75 char keyboard_layout[32];
76 memset(keyboard_layout, 0, 32);
71 77
78 DIR *testdir; /* Test if path is a directory */
79 char *busid_input; /* BusID input test */
80 char path[256]; /* Font Path */
81 char videobuf[MAX_VIDEO_LEN]; /* Video Card Device section */
82 int videolen = MAX_VIDEO_LEN - 1; /* How many chars we have left */
83 char dri = FALSE; /* DRI on or off */
84 char dump = FALSE; /* Dump debugging info? */
85 char quiet = FALSE; /* Be quiet */
86 struct utsname kern; /* Get the kernel version */
87 char kern_new = FALSE;
88 char kern_ver [3];
89
90 uname(&kern);
91 if(strlen(kern.release) > 6) {
92 strncpy(kern_ver, (const char *)(&kern.release) + 4, 2);
93 kern_ver[2] = 0;
94
95 if(atoi(kern_ver) >= 12)
96 kern_new = TRUE;
97 }
98
72 if (!(fd = open(name, O_RDONLY))) 99 if (!(fd = open(name, O_RDONLY)))
73 rc = 2; /* Failure */ 100 rc = 2; /* Failure */
74 101
75 if (!rc && ioctl(fd, FBIOGET_FSCREENINFO, &fix)) 102 if (!rc && ioctl(fd, FBIOGET_FSCREENINFO, &fix))
76 rc = 2; /* Failure */ 103 rc = 2; /* Failure */
77 104
78 if (!rc && ioctl(fd, FBIOGET_VSCREENINFO, &var)) 105 if (!rc && ioctl(fd, FBIOGET_VSCREENINFO, &var))
79 rc = 2; /* Failure */ 106 rc = 2; /* Failure */
80 107
81 close(fd); 108 close(fd);
109
110 if (rc) {
111 fprintf(stderr, "Can't access %s. Exiting.\n", name);
112 return -1;
113 }
82 114
83 /* 640x480 framebuffer typically implies a CRT, so lets bump */ 115 /* 640x480 framebuffer typically implies a CRT, so lets bump */
84 /* the resolution up to 800x600 to be a bit more sane */ 116 /* the resolution up to 800x600 to be a bit more sane */
85 if (var.xres == 640 && var.yres == 480) { 117 if (var.xres == 640 && var.yres == 480) {
86 var.xres = 800; 118 var.xres = 800;
87 var.yres = 600; 119 var.yres = 600;
88 } 120 }
89 121
90 if (rc) { 122 if (argc > 1) {
91 fprintf(stderr, "Can't access %s. Exiting.\n", name); 123 int args;
92 return -1; 124 for(args = 1; args<argc; args++) {
93 }
94
95 if (argc == 2)
96 {
97 if (!strcmp(argv[1], "--fbdepth")) 125 if (!strncmp(argv[args], "--fbdepth",9))
98 fbdepth = 1; 126 fbdepth = 1;
99 else if (!strcmp(argv[1], "--fbdev")) 127 else if (!strncmp(argv[args], "--fbdev",7))
100 fbdev = 1; 128 fbdev = 1;
129 else if (!strncmp(argv[args], "--dump",6))
130 dump = TRUE;
101 else if (!strcmp(argv[1], "--safe")) 131 else if (!strncmp(argv[args], "--safe",6))
102 fbdev = fbdepth = 1; 132 fbdev = fbdepth = 1;
133 else if (!strncmp(argv[args], "--quiet",7))
134 quiet = TRUE;
103 else if (!strcmp(argv[1], "--help")) { 135 else if (!strncmp(argv[args], "--keymap=", 9)) {
136 strncpy(keyboard_layout, argv[args] + 9 , 29);
137 strcat(keyboard_layout, "\"\n");
138 }
139 else if (!strncmp(argv[args], "--force-bus=",12)) {
140 /* Bus */
141 busid_input = strtok(argv[args] + 12, ":");
142 if(busid_input != NULL)
143 bus = atoi(busid_input);
144 /* Dev */
145 busid_input = strtok(NULL, ":");
146 if(busid_input != NULL)
147 bus = atoi(busid_input);
148 /* Func */
149 busid_input = strtok(NULL, ":");
150 if(busid_input != NULL)
151 func = atoi(busid_input);
152 forcebus = TRUE;
153 }
154 else if (!strncmp(argv[args], "--version",9)) {
155 printf("Xorgautoconfig v" XAC_VER "\n");
156 exit(0);
157 }
158 else if (!strcmp(argv[args], "--list-keymaps")) {
159 printf("%s", keymap_list);
160 exit(0);
161 } else {
104 usage(); 162 usage();
105 exit(0); 163 exit(0);
106 } else {
107 usage();
108 exit(0);
109 } 164 }
110 } else if (argc > 2) { 165 }
111 usage();
112 exit(0);
113
114 } 166 }
115 167
116 /* Check to see what type of Mac we're on.*/ 168 /* Check to see what type of Mac we're on.*/
117 /* e.g. PowerBook1,1 */ 169 /* e.g. PowerBook1,1 */
118 macid = macMachineType(); 170 macid = macMachineType();
189 { 241 {
190 mem = strdup(fix.id); 242 mem = strdup(fix.id);
191 while(((i = strlen(mem)) > 0) && isspace(mem[i - 1])) { 243 while(((i = strlen(mem)) > 0) && isspace(mem[i - 1])) {
192 mem[i - 1] = '\0'; 244 mem[i - 1] = '\0';
193 } 245 }
194 if (strstr(fix.id, "NVDA") != NULL) 246 if (strstr(fix.id, "NV") != NULL && strstr(fix.id, "ATI") == NULL)
195 nv = 1; 247 nv = 1;
196
197 if (!strncmp(fix.id, "OFfb", 4)) 248 if (!strncmp(fix.id, "OFfb", 4))
198 offb = 1; 249 offb = 1;
199 } 250 }
200 251
201 findVideoDevice(); /* For BusID */ 252 /* For BusID */
253 if(forcebus == 0)
254 findVideoDevice();
255
256 /* Work out the card specifics to figure out if we need DRI, etc. */
257 depth = 16;
258 memset(videobuf, 0, MAX_VIDEO_LEN);
259 if (nv) {
260 if (!strncmp(macid, "PowerMac4,2", 11) || !strncmp(macid, "PowerMac4,5", 11))
261 videolen -= snprintf(videobuf + strlen(videobuf), videolen, " Option \"FlatPanel\"\n");
262 videolen -= snprintf(videobuf + strlen(videobuf), videolen, "%s", driver_nv);
263 videolen -= snprintf(videobuf + strlen(videobuf), videolen, " Driver\t\"nv\"\n");
264 dri = FALSE;
265 } else if((fbdev) || (bus == 0 && dev == 0 && func == 0)) {
266 if (!fbdev) {
267 videolen -= snprintf(videobuf + strlen(videobuf),
268 videolen, "\t# We couldn't determine the BusID of your ");
269 videolen -= snprintf(videobuf + strlen(videobuf),
270 videolen, "video card. So we will use\n#\tthe fbdev driver\n");
271 }
272 videolen -= snprintf(videobuf + strlen(videobuf), videolen, " #Option \"ShadowFB\" \"true\"\n");
273 videolen -= snprintf(videobuf + strlen(videobuf), videolen, " #Option \"fbdev\" \"%s\"\n", name);
274 videolen -= snprintf(videobuf + strlen(videobuf), videolen, " Driver\t\"fbdev\"\n");
275 videolen -= snprintf(videobuf + strlen(videobuf), videolen, " #BusID \"0:0:0\"\n");
276 depth = 15;
277 dri = FALSE;
278 } else {
279 /* Try and guess what video card is behind /dev/fb0 */
280 switch(fix.accel) {
281 /* ATI Mach64 Family cards */
282 case 6:
283 case 8:
284 case 9:
285 case 10:
286 videolen -= snprintf(videobuf + strlen(videobuf), videolen, "%s", driver_on_opts);
287 videolen -= snprintf(videobuf + strlen(videobuf), videolen, " Driver\t\"ati\"\n");
288 dri = FALSE; /* Can this be enabled? */
289 break;
290 /* IMS Twin Turbo */
291 case 14:
292 videolen -= snprintf(videobuf + strlen(videobuf), videolen, "%s", driver_off_opts);
293 videolen -= snprintf(videobuf + strlen(videobuf), videolen, " Driver\t\"imstt\"\n");
294 dri = FALSE; /* Can this be enabled? */
295 break;
296 /* Matrox Family */
297 case 16:
298 case 17:
299 case 18:
300 case 20:
301 case 21:
302 case 26:
303 videolen -= snprintf(videobuf + strlen(videobuf), videolen, "%s", driver_off_opts);
304 videolen -= snprintf(videobuf + strlen(videobuf), videolen, " Driver\t\"mga\"\n");
305 dri = FALSE; /* Can this be enabled? */
306 break;
307 /* Chips&Technology 6555x */
308 /* Is this still broken?
309 case 30:
310 videolen -= snprintf(videobuf + strlen(videobuf), videolen, "%s", driver_off_opts);
311 videolen -= snprintf(videobuf + strlen(videobuf), videolen, " Driver\t\"chips\"\n");
312 dri = FALSE;
313 break;
314 */
315 /* VooDoo 3 / Banshee */
316 case 31:
317 videolen -= snprintf(videobuf + strlen(videobuf), videolen, "%s", driver_off_opts);
318 videolen -= snprintf(videobuf + strlen(videobuf), videolen, " Driver\t\"tdfx\"\n");
319 dri = FALSE; /* Can this be enabled? */
320 break;
321 /* ATI Rage 128 Family */
322 case 32:
323 videolen -= snprintf(videobuf + strlen(videobuf), videolen, "%s", driver_r128);
324 videolen -= snprintf(videobuf + strlen(videobuf), videolen, " Driver\t\"r128\"\n");
325 dri = TRUE;
326 break;
327 /* ATI Radeon */
328 case 38:
329 videolen -= snprintf(videobuf + strlen(videobuf), videolen, "%s", driver_radeon);
330 if(!strncmp(macid + 5, "Pegasos", 7))
331 videolen -= snprintf(videobuf + strlen(videobuf), videolen, "%s", "\tOption\t\"BusType\"\t\"PCI\"\n");
332 videolen -= snprintf(videobuf + strlen(videobuf), videolen, " Driver\t\"radeon\"\n");
333 dri = TRUE;
334 break;
335 default:
336 if (!strncmp(fix.id, "ATI Radeon", 10)) {
337 videolen -= snprintf(videobuf + strlen(videobuf), videolen, "%s", driver_radeon);
338 if(!strncmp(macid + 5, "Pegasos", 7))
339 videolen -= snprintf(videobuf + strlen(videobuf), videolen, "%s", "\tOption\t\"BusType\"\t\"PCI\"\n");
340 videolen -= snprintf(videobuf + strlen(videobuf), videolen, " Driver\t\"radeon\"\n");
341 dri = TRUE;
342 } else if (!strncmp(fix.id, "Rage128", 7)) {
343 videolen -= snprintf(videobuf + strlen(videobuf), videolen, "%s", driver_r128);
344 videolen -= snprintf(videobuf + strlen(videobuf), videolen, " Driver\t\"r128\"\n");
345 dri = TRUE;
346 } else if (!strncmp(fix.id, "Rage Mobility M3", 16)) {
347 videolen -= snprintf(videobuf + strlen(videobuf), videolen, "%s", driver_r128);
348 videolen -= snprintf(videobuf + strlen(videobuf), videolen, " Driver\t\"r128\"\n");
349 dri = TRUE;
350 } else {
351 videolen -= snprintf(videobuf + strlen(videobuf), videolen, " #Option \"ShadowFB\" \"true\"\n");
352 videolen -= snprintf(videobuf + strlen(videobuf), videolen, " Driver\t\"fbdev\"\n");
353 dri = FALSE;
354 depth = 15;
355 }
356 break;
357 }
358 videolen -= snprintf(videobuf + strlen(videobuf), videolen, "# BusID \"PCI:%d:%d:%d\"\n", bus, dev, func);
359 }
360
361 if(dump) {
362 printf("Dumping Debugging Information:\n");
363 printf("\tMachine ID:\t%s\n", macid);
364 if(edid_info == NULL)
365 printf("\tNo EDID Information present\n");
366 else
367 printf("\tEDID Tag:\t%s\n", eisaid);
368 printf("\tH-Min: %i H-Max: %i V-Min: %i V-Max: %i\n", sync.h_min, sync.h_max, sync.v_min, sync.v_max);
369 printf("\tCard Dump:\n");
370 printf("\t\tFramebuffer Id:\t\t%s\n", fix.id);
371 printf("\t\tFramebuffer Type:\t%i\n", fix.accel);
372 printf("\t\tFramebuffer Depth:\t%i\n", depth);
373 return 0;
374 }
202 375
203 /* Let's be nice and backup an existing xorg.conf */ 376 /* Let's be nice and backup an existing xorg.conf */
204 if ((f = fopen("/etc/X11/xorg.conf", "r"))) { 377 if ((f = fopen("/etc/X11/xorg.conf", "r"))) {
205 system("mv /etc/X11/xorg.conf /etc/X11/xorg.xorgautoconfig"); 378 system("mv /etc/X11/xorg.conf /etc/X11/xorg.conf.autobak");
379 if(!quiet)
380 printf("The current xorg.conf has been copied into /etc/X11/xorg.conf.autobak\n");
206 } 381 }
207 382
383 /* Check the permissions for writing */
208 if (!(f = fopen("/etc/X11/xorg.conf", "w"))) { 384 if (!(f = fopen("/etc/X11/xorg.conf", "w"))) {
209 fprintf(stderr, "Can't write to /etc/X11/xorg.conf. Exiting.\n"); 385 fprintf(stderr, "Can't write to /etc/X11/xorg.conf. Exiting.\n");
210 return -1;; 386 return -1;
211 } 387 }
212
213 388
214 /*** BEGIN xorg.conf ***/ 389 /*** BEGIN xorg.conf ***/
215 fprintf(f, "%s", header); 390 fprintf(f, "%s", header);
216 391
217 /* fontpath */ 392 /* Set fontpaths */
393 DIR *fontdir = opendir(FONTPATH);
394 struct dirent *fontpath;
395
396 /* Add x fontserver note */
397 fprintf(f, "%s", fontpath_xfs);
398 if(fontdir != NULL) {
399 while ((fontpath = readdir (fontdir))) {
400 if((fontpath->d_name)[0] != '.') {
401 /* Only add directories */
402 strcpy(path, FONTPATH);
403 strcat(path, fontpath->d_name);
404 strcat(path, "/");
405 testdir = opendir(path);
406 if(testdir != NULL) {
407 fprintf(f, "\tFontPath\t\"%s\"\n",
408 path);
409 if(!strncmp(fontpath->d_name,"75dpi",5) ||
410 !strncmp(fontpath->d_name,"100dpi",6)){
411 fprintf(f, "\tFontPath\t\"%s:unscaled\"\n",
412 path);
413 }
414 closedir(testdir);
415 }
416 }
417 }
418 closedir(fontdir);
419 }
420 else {
218 fprintf(f, "%s", fontpath_gentoo); 421 fprintf(f, "%s", fontpath_gentoo);
422 }
423 fprintf(f, "EndSection\n\n");
219 424
220 /* modules section */ 425 /* modules section */
426 fprintf(f, "%s", modules_section_start);
427 if(!dri) fprintf(f, "%s", "#");
221 fprintf(f, "%s", modules_section); 428 fprintf(f, "%s", modules_section_end);
222 429
223 /* extensions section */ 430 /* extensions section */
224 fprintf(f, "%s", extensions_section); 431 fprintf(f, "%s", extensions_section);
225 432
226 /* serverflags section */ 433 /* serverflags section */
228 435
229 /* input dev section */ 436 /* input dev section */
230 fprintf(f, "%s", inputdev_section); 437 fprintf(f, "%s", inputdev_section);
231 438
232 /* keyboard */ 439 /* keyboard */
440 if(0 == keyboard_layout[0])
441 strcpy(keyboard_layout, "us\"\n");
442 fprintf(f, "%s", keyboard_linux_start);
443 fprintf(f, "%s", keyboard_layout);
233 fprintf(f, "%s", keyboard_linux); 444 fprintf(f, "%s", keyboard_linux_end);
234 445
235 /* mouse */ 446 /* mouse */
236 fprintf(f, "%s", mouse_section); 447 fprintf(f, "%s", mouse_section);
237 fprintf(f, "IMPS/2\"\n");
238 fprintf(f, " Option \"Device\" \"/dev/input/mice\"\n");
239 fprintf(f, "EndSection\n\n");
240 448
241 /* monitor section */ 449 /* monitor section */
242 if (!offb) 450 if (!offb)
243 fprintf(f, "%s", monitor_section); 451 fprintf(f, "%s", monitor_section);
244 else 452 else
245 fprintf(f, "%s", monitor_section_nomodes); 453 fprintf(f, "%s", monitor_section_nomodes);
246 454
455 /* Check for bogus sync values */
456 if (sync.v_min > sync.v_max){
457 int swap;
458 swap = sync.v_min;
459 sync.v_min = sync.v_max;
460 sync.v_max = swap;
461 }
247 /* Use EDID's horizsync / vert refresh first, otherwise try to be sane */ 462 /* Use EDID's horizsync / vert refresh first, otherwise try to be sane */
248 if (sync.h_min && sync.h_max && sync.v_min && sync.v_max) 463 if (sync.h_min && sync.h_max && sync.v_min && sync.v_max)
249 { 464 {
250 fprintf(f, "\tHorizSync %d-%d\n\tVertRefresh %d-%d\n", 465 fprintf(f, "\tHorizSync %d-%d\n\tVertRefresh %d-%d\n",
251 sync.h_min, sync.h_max, sync.v_min, sync.v_max); 466 sync.h_min, sync.h_max, sync.v_min, sync.v_max);
292 fprintf(f, " Composite"); 507 fprintf(f, " Composite");
293 if (var.sync & FB_SYNC_BROADCAST) 508 if (var.sync & FB_SYNC_BROADCAST)
294 fprintf(f, " bcast"); 509 fprintf(f, " bcast");
295 } 510 }
296 fprintf(f, "%s", device_start); 511 fprintf(f, "%s", device_start);
297 depth = 16; 512 fprintf(f, "%s", videobuf);
298
299 /* See if we know where the card is, if not... */
300 if (nv) {
301 if (!strncmp(macid, "PowerMac4,2", 11) || !strncmp(macid, "PowerMac4,5", 11))
302 fprintf(f, " Option \"FlatPanel\"\n");
303 fprintf(f, " Driver \"nv\"\n");
304 } else if((fbdev) || (bus == 0 && dev == 0 && func == 0)) {
305 if (!fbdev) {
306 fprintf(f, " # We couldn't determine the BusID of your ");
307 fprintf(f, "video card. So we will use\n# the fbdev driver\n");
308 }
309 fprintf(f, " #Option \"ShadowFB\" \"true\"\n");
310 fprintf(f, " #Option \"fbdev\" \"%s\"\n", name);
311 fprintf(f, " Driver \"fbdev\"\n");
312 fprintf(f, " #BusID \"0:0:0\"\n");
313 depth = 15;
314 } else {
315 /* Try and guess what video card is behind /dev/fb0 */
316 switch(fix.accel) {
317 /* ATI Mach64 Family cards */
318 case 6:
319 case 8:
320 case 9:
321 case 10:
322 fprintf(f, "%s", driver_on_opts);
323 fprintf(f, " Driver \"ati\"\n");
324 break;
325 /* IMS Twin Turbo */
326 case 14:
327 fprintf(f, "%s", driver_off_opts);
328 fprintf(f, " Driver \"imstt\"\n");
329 break;
330 /* Matrox Family */
331 case 16:
332 case 17:
333 case 18:
334 case 20:
335 case 21:
336 case 26:
337 fprintf(f, "%s", driver_off_opts);
338 fprintf(f, " Driver \"mga\"\n");
339 break;
340 /* Chips&Technology 6555x */
341 /* Apparently this is broken...
342 case 30:
343 fprintf(f, "%s", driver_off_opts);
344 fprintf(f, " Driver \"chips\"\n");
345 break;
346 */
347 /* VooDoo 3 / Banshee */
348 case 31:
349 fprintf(f, "%s", driver_off_opts);
350 fprintf(f, " Driver \"tdfx\"\n");
351 break;
352 /* ATI Rage 128 Family */
353 case 32:
354 fprintf(f, "%s", driver_on_opts);
355 fprintf(f, " Driver \"r128\"\n");
356 break;
357 /* ATI Radeon */
358 case 38:
359 fprintf(f, "%s", driver_on_opts);
360 fprintf(f, " Driver \"radeon\"\n");
361 break;
362 default:
363 /* radeon seems to be broken on VE (aka 7000) */
364 if ((!strncmp(fix.id, "ATI Radeon", 10)) &&
365 (strncmp(fix.id, "ATI Radeon VE", 13))) {
366 fprintf(f, "%s", driver_on_opts);
367 fprintf(f, " Driver \"radeon\"\n");
368 } else if (!strncmp(fix.id, "Rage128", 7)) {
369 fprintf(f, "%s", driver_on_opts);
370 fprintf(f, " Driver \"r128\"\n");
371 } else if (!strncmp(fix.id, "Rage Mobility M3", 16)) {
372 fprintf(f, "%s", driver_on_opts);
373 fprintf(f, " Driver \"r128\"\n");
374 } else {
375 fprintf(f, " #Option \"ShadowFB\"");
376 fprintf(f, " \"true\"\n");
377 fprintf(f, " Driver \"fbdev\"\n");
378 depth = 15;
379 }
380 break;
381 }
382 fprintf(f, " BusID \"PCI:%d:%d:%d\"\n", bus, dev, func);
383 }
384 fprintf(f, "%s", screen_section); 513 fprintf(f, "%s", screen_section);
385 fprintf(f, "%d\n", depth); 514 fprintf(f, "%d\n", depth);
386 if(fbdepth && depth != var.bits_per_pixel) 515 if(fbdepth && depth != var.bits_per_pixel)
387 fprintf(f," DefaultFbBpp %d\n", var.bits_per_pixel); 516 fprintf(f," DefaultFbBpp %d\n", var.bits_per_pixel);
388 517
415 fprintf(f, " EndSubSection\n"); 544 fprintf(f, " EndSubSection\n");
416 } 545 }
417 546
418 fprintf(f, "EndSection\n"); 547 fprintf(f, "EndSection\n");
419 fprintf(f, "%s", dri_section); 548 fprintf(f, "%s", dri_section);
420 /*** END XF86Config ***/ 549 /*** END Xorg.conf ***/
421 550
422 fclose(f); 551 fclose(f);
423 552
553 if(!quiet) {
424 fprintf(stdout, "Wrote /etc/X11/xorg.conf\n"); 554 fprintf(stdout, "Wrote /etc/X11/xorg.conf\n");
555 fprintf(stdout, "Please check the configuration file for additional options\n");
556 }
425 557
426 return 0; 558 return 0;
427} 559}

Legend:
Removed from v.1.1.1.1  
changed lines
  Added in v.1.21

  ViewVC Help
Powered by ViewVC 1.1.20