author | Henry Zhao <Henry.Zhao@Sun.COM> |
Mon, 07 May 2007 17:53:20 -0700 | |
changeset 154 | ae2bd8710ae2 |
parent 98 | c21b46ed1efd |
permissions | -rw-r--r-- |
98
c21b46ed1efd
6489660 Xorg server 7.2 [PSARC 2007/051]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
1 |
# Copyright 2007 Sun Microsystems, Inc. All rights reserved. |
c21b46ed1efd
6489660 Xorg server 7.2 [PSARC 2007/051]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
2 |
# Use subject to license terms. |
c21b46ed1efd
6489660 Xorg server 7.2 [PSARC 2007/051]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
3 |
# |
c21b46ed1efd
6489660 Xorg server 7.2 [PSARC 2007/051]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
4 |
# Permission is hereby granted, free of charge, to any person obtaining a |
c21b46ed1efd
6489660 Xorg server 7.2 [PSARC 2007/051]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
5 |
# copy of this software and associated documentation files (the |
c21b46ed1efd
6489660 Xorg server 7.2 [PSARC 2007/051]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
6 |
# "Software"), to deal in the Software without restriction, including |
c21b46ed1efd
6489660 Xorg server 7.2 [PSARC 2007/051]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
7 |
# without limitation the rights to use, copy, modify, merge, publish, |
c21b46ed1efd
6489660 Xorg server 7.2 [PSARC 2007/051]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
8 |
# distribute, and/or sell copies of the Software, and to permit persons |
c21b46ed1efd
6489660 Xorg server 7.2 [PSARC 2007/051]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
9 |
# to whom the Software is furnished to do so, provided that the above |
c21b46ed1efd
6489660 Xorg server 7.2 [PSARC 2007/051]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
10 |
# copyright notice(s) and this permission notice appear in all copies of |
c21b46ed1efd
6489660 Xorg server 7.2 [PSARC 2007/051]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
11 |
# the Software and that both the above copyright notice(s) and this |
c21b46ed1efd
6489660 Xorg server 7.2 [PSARC 2007/051]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
12 |
# permission notice appear in supporting documentation. |
c21b46ed1efd
6489660 Xorg server 7.2 [PSARC 2007/051]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
13 |
# |
c21b46ed1efd
6489660 Xorg server 7.2 [PSARC 2007/051]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
14 |
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS |
c21b46ed1efd
6489660 Xorg server 7.2 [PSARC 2007/051]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
15 |
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
c21b46ed1efd
6489660 Xorg server 7.2 [PSARC 2007/051]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
16 |
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT |
c21b46ed1efd
6489660 Xorg server 7.2 [PSARC 2007/051]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
17 |
# OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR |
c21b46ed1efd
6489660 Xorg server 7.2 [PSARC 2007/051]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
18 |
# HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL |
c21b46ed1efd
6489660 Xorg server 7.2 [PSARC 2007/051]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
19 |
# INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING |
c21b46ed1efd
6489660 Xorg server 7.2 [PSARC 2007/051]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
20 |
# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, |
c21b46ed1efd
6489660 Xorg server 7.2 [PSARC 2007/051]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
21 |
# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION |
c21b46ed1efd
6489660 Xorg server 7.2 [PSARC 2007/051]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
22 |
# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
c21b46ed1efd
6489660 Xorg server 7.2 [PSARC 2007/051]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
23 |
# |
c21b46ed1efd
6489660 Xorg server 7.2 [PSARC 2007/051]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
24 |
# Except as contained in this notice, the name of a copyright holder |
c21b46ed1efd
6489660 Xorg server 7.2 [PSARC 2007/051]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
25 |
# shall not be used in advertising or otherwise to promote the sale, use |
c21b46ed1efd
6489660 Xorg server 7.2 [PSARC 2007/051]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
26 |
# or other dealings in this Software without prior written authorization |
c21b46ed1efd
6489660 Xorg server 7.2 [PSARC 2007/051]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
27 |
# of the copyright holder. |
c21b46ed1efd
6489660 Xorg server 7.2 [PSARC 2007/051]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
28 |
|
c21b46ed1efd
6489660 Xorg server 7.2 [PSARC 2007/051]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
29 |
6205507 - Xorg errors on ATI Radeon: xf86MapVidMem: failed to open /dev/xsvc (Not owner) |
c21b46ed1efd
6489660 Xorg server 7.2 [PSARC 2007/051]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
30 |
|
c21b46ed1efd
6489660 Xorg server 7.2 [PSARC 2007/051]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
31 |
|
c21b46ed1efd
6489660 Xorg server 7.2 [PSARC 2007/051]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
32 |
--- hw/xfree86/os-support/solaris/sun_vid.c 2006-10-11 13:46:15.000000000 -0700 |
c21b46ed1efd
6489660 Xorg server 7.2 [PSARC 2007/051]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
33 |
+++ hw/xfree86/os-support/sunos/sun_vid.c 2005-11-03 14:13:07.732827000 -0800 |
c21b46ed1efd
6489660 Xorg server 7.2 [PSARC 2007/051]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
34 |
@@ -39,6 +40,11 @@ |
c21b46ed1efd
6489660 Xorg server 7.2 [PSARC 2007/051]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
35 |
#define MAP_FAILED ((void *)-1) |
c21b46ed1efd
6489660 Xorg server 7.2 [PSARC 2007/051]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
36 |
#endif |
c21b46ed1efd
6489660 Xorg server 7.2 [PSARC 2007/051]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
37 |
|
c21b46ed1efd
6489660 Xorg server 7.2 [PSARC 2007/051]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
38 |
+#ifdef SUNSOFT |
c21b46ed1efd
6489660 Xorg server 7.2 [PSARC 2007/051]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
39 |
+static int apertureDevFD_ro = -1; |
c21b46ed1efd
6489660 Xorg server 7.2 [PSARC 2007/051]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
40 |
+static int apertureDevFD_rw = -1; |
c21b46ed1efd
6489660 Xorg server 7.2 [PSARC 2007/051]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
41 |
+#endif |
c21b46ed1efd
6489660 Xorg server 7.2 [PSARC 2007/051]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
42 |
+ |
c21b46ed1efd
6489660 Xorg server 7.2 [PSARC 2007/051]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
43 |
/***************************************************************************/ |
c21b46ed1efd
6489660 Xorg server 7.2 [PSARC 2007/051]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
44 |
/* Video Memory Mapping section */ |
c21b46ed1efd
6489660 Xorg server 7.2 [PSARC 2007/051]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
45 |
/***************************************************************************/ |
c21b46ed1efd
6489660 Xorg server 7.2 [PSARC 2007/051]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
46 |
@@ -71,7 +77,24 @@ |
c21b46ed1efd
6489660 Xorg server 7.2 [PSARC 2007/051]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
47 |
return FALSE; |
c21b46ed1efd
6489660 Xorg server 7.2 [PSARC 2007/051]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
48 |
} |
c21b46ed1efd
6489660 Xorg server 7.2 [PSARC 2007/051]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
49 |
} |
c21b46ed1efd
6489660 Xorg server 7.2 [PSARC 2007/051]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
50 |
+#ifdef SUNSOFT |
c21b46ed1efd
6489660 Xorg server 7.2 [PSARC 2007/051]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
51 |
+ apertureDevFD_rw = mmapFd; |
c21b46ed1efd
6489660 Xorg server 7.2 [PSARC 2007/051]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
52 |
+ if ((apertureDevFD_ro = open(apertureDevName, O_RDONLY)) < 0) |
c21b46ed1efd
6489660 Xorg server 7.2 [PSARC 2007/051]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
53 |
+ { |
c21b46ed1efd
6489660 Xorg server 7.2 [PSARC 2007/051]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
54 |
+ xf86MsgVerb(X_WARNING, 0, |
c21b46ed1efd
6489660 Xorg server 7.2 [PSARC 2007/051]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
55 |
+ "xf86LinearVidMem: failed to open %s (%s)\n", |
c21b46ed1efd
6489660 Xorg server 7.2 [PSARC 2007/051]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
56 |
+ apertureDevName, strerror(errno)); |
c21b46ed1efd
6489660 Xorg server 7.2 [PSARC 2007/051]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
57 |
+ xf86MsgVerb(X_WARNING, 0, |
c21b46ed1efd
6489660 Xorg server 7.2 [PSARC 2007/051]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
58 |
+ "xf86LinearVidMem: either /dev/fbs/aperture or /dev/xsvc" |
c21b46ed1efd
6489660 Xorg server 7.2 [PSARC 2007/051]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
59 |
+ " device driver required\n"); |
c21b46ed1efd
6489660 Xorg server 7.2 [PSARC 2007/051]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
60 |
+ xf86MsgVerb(X_WARNING, 0, |
c21b46ed1efd
6489660 Xorg server 7.2 [PSARC 2007/051]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
61 |
+ "xf86LinearVidMem: linear memory access disabled\n"); |
c21b46ed1efd
6489660 Xorg server 7.2 [PSARC 2007/051]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
62 |
+ apertureDevName = NULL; |
c21b46ed1efd
6489660 Xorg server 7.2 [PSARC 2007/051]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
63 |
+ return FALSE; |
c21b46ed1efd
6489660 Xorg server 7.2 [PSARC 2007/051]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
64 |
+ } |
c21b46ed1efd
6489660 Xorg server 7.2 [PSARC 2007/051]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
65 |
+#else |
c21b46ed1efd
6489660 Xorg server 7.2 [PSARC 2007/051]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
66 |
close(mmapFd); |
c21b46ed1efd
6489660 Xorg server 7.2 [PSARC 2007/051]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
67 |
+#endif |
c21b46ed1efd
6489660 Xorg server 7.2 [PSARC 2007/051]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
68 |
return TRUE; |
c21b46ed1efd
6489660 Xorg server 7.2 [PSARC 2007/051]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
69 |
} |
c21b46ed1efd
6489660 Xorg server 7.2 [PSARC 2007/051]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
70 |
|
c21b46ed1efd
6489660 Xorg server 7.2 [PSARC 2007/051]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
71 |
@@ -119,8 +142,11 @@ |
c21b46ed1efd
6489660 Xorg server 7.2 [PSARC 2007/051]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
72 |
|
c21b46ed1efd
6489660 Xorg server 7.2 [PSARC 2007/051]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
73 |
strcpy(vtname, apertureDevName); |
c21b46ed1efd
6489660 Xorg server 7.2 [PSARC 2007/051]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
74 |
} |
c21b46ed1efd
6489660 Xorg server 7.2 [PSARC 2007/051]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
75 |
- |
c21b46ed1efd
6489660 Xorg server 7.2 [PSARC 2007/051]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
76 |
+#ifdef SUNSOFT |
c21b46ed1efd
6489660 Xorg server 7.2 [PSARC 2007/051]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
77 |
+ fd = dup((Flags & VIDMEM_READONLY) ? apertureDevFD_ro : apertureDevFD_rw); |
c21b46ed1efd
6489660 Xorg server 7.2 [PSARC 2007/051]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
78 |
+#else |
c21b46ed1efd
6489660 Xorg server 7.2 [PSARC 2007/051]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
79 |
fd = open(vtname, (Flags & VIDMEM_READONLY) ? O_RDONLY : O_RDWR); |
c21b46ed1efd
6489660 Xorg server 7.2 [PSARC 2007/051]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
80 |
+#endif |
c21b46ed1efd
6489660 Xorg server 7.2 [PSARC 2007/051]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
81 |
if (fd < 0) |
c21b46ed1efd
6489660 Xorg server 7.2 [PSARC 2007/051]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
82 |
FatalError("xf86MapVidMem: failed to open %s (%s)\n", |
c21b46ed1efd
6489660 Xorg server 7.2 [PSARC 2007/051]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
83 |
vtname, strerror(errno)); |