~ubuntu-branches/ubuntu/lucid/xorg-server/lucid-updates

« back to all changes in this revision

Viewing changes to debian/patches/198_nohwaccess.patch

  • Committer: Bazaar Package Importer
  • Author(s): Bryce Harrington
  • Date: 2010-02-05 22:17:20 UTC
  • Revision ID: james.westby@ubuntu.com-20100205221720-80o00c3r8jnijqhb
Tags: 2:1.7.3.902-1ubuntu12
Add 198_nohwaccess.patch: Needed for rootless X.  Adds a -nohwaccess
argument to make X not access the hardware ports directly.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
Two chunks of jbarne's nohwaccess patch got taken upstream; this patch
 
2
contains just the remainder, which implements a -nohwaccess option.
 
3
 
 
4
diff --git a/hw/xfree86/os-support/linux/lnx_init.c b/hw/xfree86/os-support/linux/lnx_init.c
 
5
index 7f40857..cf58c01 100644
 
6
--- a/hw/xfree86/os-support/linux/lnx_init.c
 
7
+++ b/hw/xfree86/os-support/linux/lnx_init.c
 
8
@@ -49,6 +49,7 @@ static Bool KeepTty = FALSE;
 
9
 static int VTnum = -1;
 
10
 static Bool VTSwitch = TRUE;
 
11
 static Bool ShareVTs = FALSE;
 
12
+Bool NoHwAccess = FALSE;
 
13
 static int activeVT = -1;
 
14
 
 
15
 static int vtPermSave[4];
 
16
@@ -433,6 +438,11 @@ xf86ProcessArgument(int argc, char *argv[], int i)
 
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", &VTnum) == 0)
 
28
@@ -454,5 +464,6 @@ xf86UseMsg()
 
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
        return;
 
34
 }
 
35
diff --git a/hw/xfree86/os-support/linux/lnx_video.c b/hw/xfree86/os-support/linux/lnx_video.c
 
36
index 688106a..34a845b 100644
 
37
--- a/hw/xfree86/os-support/linux/lnx_video.c
 
38
+++ b/hw/xfree86/os-support/linux/lnx_video.c
 
39
@@ -51,6 +51,7 @@
 
40
 #define MAP_FAILED ((void *)-1)
 
41
 #endif
 
42
 
 
43
+extern Bool NoHwAccess;
 
44
 static Bool ExtendedEnabled = FALSE;
 
45
 
 
46
 #ifdef __ia64__
 
47
@@ -509,6 +510,9 @@ xf86EnableIO(void)
 
48
        int fd;
 
49
        unsigned int ioBase_phys;
 
50
 #endif
 
51
+       /* Fake it... */
 
52
+       if (NoHwAccess)
 
53
+               return TRUE;
 
54
 
 
55
        if (ExtendedEnabled)
 
56
                return TRUE;