2e3bea28eb0d97b398fe2cb0527d992a6dfe362b
1 Two chunks of jbarne's nohwaccess patch got taken upstream; this patch
2 contains just the remainder, which implements a -nohwaccess option.
4 Index: xserver/hw/xfree86/os-support/linux/lnx_init.c
5 ===================================================================
6 --- xserver.orig/hw/xfree86/os-support/linux/lnx_init.c 2012-03-15 11:09:22.000000000 +0000
7 +++ xserver/hw/xfree86/os-support/linux/lnx_init.c 2012-03-15 11:16:31.000000000 +0000
8 @@ -41,6 +41,7 @@
9 static Bool KeepTty = FALSE;
10 static Bool VTSwitch = TRUE;
11 static Bool ShareVTs = FALSE;
12 +Bool NoHwAccess = FALSE;
13 static int activeVT = -1;
15 static char vtname[11];
16 @@ -319,6 +320,11 @@
17 ShareVTs = TRUE;
18 return 1;
19 }
20 + if (!strcmp(argv[i], "-nohwaccess"))
21 + {
22 + NoHwAccess = TRUE;
23 + return(1);
24 + }
25 if ((argv[i][0] == 'v') && (argv[i][1] == 't'))
26 {
27 if (sscanf(argv[i], "vt%2d", &xf86Info.vtno) == 0)
28 @@ -340,4 +346,5 @@
29 ErrorF("don't detach controlling tty (for debugging only)\n");
30 ErrorF("-novtswitch don't immediately switch to new VT\n");
31 ErrorF("-sharevts share VTs with another X server\n");
32 + ErrorF("-nohwaccess don't access hardware ports directly\n");
33 }
34 Index: xserver/hw/xfree86/os-support/linux/lnx_video.c
35 ===================================================================
36 --- xserver.orig/hw/xfree86/os-support/linux/lnx_video.c 2012-03-15 11:09:22.000000000 +0000
37 +++ xserver/hw/xfree86/os-support/linux/lnx_video.c 2012-03-15 11:16:31.000000000 +0000
38 @@ -50,6 +50,7 @@
39 #define MAP_FAILED ((void *)-1)
40 #endif
42 +extern Bool NoHwAccess;
43 static Bool ExtendedEnabled = FALSE;
45 #ifdef __ia64__
46 @@ -497,6 +498,9 @@
47 int fd;
48 unsigned int ioBase_phys;
49 #endif
50 + /* Fake it... */
51 + if (NoHwAccess)
52 + return TRUE;
54 if (ExtendedEnabled)
55 return TRUE;