]> git.pld-linux.org Git - packages/X11.git/blame - X11-i810_945GM.patch
-rel 19; fix for CVE-2006-6101 CVE-2006-6102 CVE-2006-6103
[packages/X11.git] / X11-i810_945GM.patch
CommitLineData
d0f440e1
TO
1diff -Naur xc.orig/programs/Xserver/hw/xfree86/drivers/i810/common.h xc/programs/Xserver/hw/xfree86/drivers/i810/common.h
2--- xc.orig/programs/Xserver/hw/xfree86/drivers/i810/common.h 2006-01-19 03:39:29.000000000 -0800
3+++ xc/programs/Xserver/hw/xfree86/drivers/i810/common.h 2006-01-19 03:46:54.000000000 -0800
4@@ -322,6 +322,11 @@
5 #define PCI_CHIP_I945_G_BRIDGE 0x2770
6 #endif
7
8+#ifndef PCI_CHIP_I945_GM
9+#define PCI_CHIP_I945_GM 0x27A2
10+#define PCI_CHIP_I945_GM_BRIDGE 0x27A0
11+#endif
12+
13 #define IS_I810(pI810) (pI810->PciInfo->chipType == PCI_CHIP_I810 || \
14 pI810->PciInfo->chipType == PCI_CHIP_I810_DC100 || \
15 pI810->PciInfo->chipType == PCI_CHIP_I810_E)
16@@ -335,8 +340,10 @@
17 #define IS_I915G(pI810) (pI810->PciInfo->chipType == PCI_CHIP_I915_G || pI810->PciInfo->chipType == PCI_CHIP_E7221_G)
18 #define IS_I915GM(pI810) (pI810->PciInfo->chipType == PCI_CHIP_I915_GM)
19 #define IS_I945G(pI810) (pI810->PciInfo->chipType == PCI_CHIP_I945_G)
20+#define IS_I945GM(pI810) (pI810->PciInfo->chipType == PCI_CHIP_I945_GM)
21+#define IS_I9XX(pI810) (IS_I915G(pI810) || IS_I915GM(pI810) || IS_I945G(pI810) || IS_I945GM(pI810))
22
23-#define IS_MOBILE(pI810) (IS_I830(pI810) || IS_I85X(pI810) || IS_I915GM(pI810))
24+#define IS_MOBILE(pI810) (IS_I830(pI810) || IS_I85X(pI810) || IS_I915GM(pI810) || IS_I945GM(pI810))
25
26 #define GTT_PAGE_SIZE KB(4)
27 #define ROUND_TO(x, y) (((x) + (y) - 1) / (y) * (y))
28diff -Naur xc.orig/programs/Xserver/hw/xfree86/drivers/i810/i810.man xc/programs/Xserver/hw/xfree86/drivers/i810/i810.man
29--- xc.orig/programs/Xserver/hw/xfree86/drivers/i810/i810.man 2006-01-19 03:39:29.000000000 -0800
30+++ xc/programs/Xserver/hw/xfree86/drivers/i810/i810.man 2006-01-19 03:56:24.000000000 -0800
31@@ -25,7 +25,7 @@
32 .SH SUPPORTED HARDWARE
33 .B i810
34 supports the i810, i810-DC100, i810e, i815, 830M, 845G, 852GM, 855GM,
35-865G, 915G and 915GM chipsets.
36+865G, 915G, 915GM, 945G and 945GM chipsets.
37
38 .SH CONFIGURATION DETAILS
39 Please refer to __xconfigfile__(__filemansuffix__) for general configuration
40@@ -210,5 +210,5 @@
41 Jeff Hartmann, Mark Vojkovich, Alan Hourihane, H. J. Lu. 830M and 845G
42 support reworked for XFree86 4.3 by David Dawes and Keith Whitwell.
43 852GM, 855GM, and 865G support added by David Dawes and Keith Whitwell.
44-915G and 915GM support added by Alan Hourihane and Keith Whitwell.
45+915G, 915GM, 945G and 945GM support added by Alan Hourihane and Keith Whitwell.
46 Dual Head, Clone and lid status support added by Alan Hourihane.
47diff -Naur xc.orig/programs/Xserver/hw/xfree86/drivers/i810/i810_driver.c xc/programs/Xserver/hw/xfree86/drivers/i810/i810_driver.c
48--- xc.orig/programs/Xserver/hw/xfree86/drivers/i810/i810_driver.c 2006-01-19 03:39:29.000000000 -0800
49+++ xc/programs/Xserver/hw/xfree86/drivers/i810/i810_driver.c 2006-01-19 03:46:54.000000000 -0800
50@@ -136,6 +136,7 @@
51 {PCI_CHIP_E7221_G, "E7221 (i915)"},
52 {PCI_CHIP_I915_GM, "915GM"},
53 {PCI_CHIP_I945_G, "945G"},
54+ {PCI_CHIP_I945_GM, "945GM"},
55 {-1, NULL}
56 };
57
58@@ -154,6 +155,7 @@
59 {PCI_CHIP_E7221_G, PCI_CHIP_E7221_G, RES_SHARED_VGA},
60 {PCI_CHIP_I915_GM, PCI_CHIP_I915_GM, RES_SHARED_VGA},
61 {PCI_CHIP_I945_G, PCI_CHIP_I945_G, RES_SHARED_VGA},
62+ {PCI_CHIP_I945_GM, PCI_CHIP_I945_GM, RES_SHARED_VGA},
63 {-1, -1, RES_UNDEFINED }
64 };
65
66@@ -569,6 +571,7 @@
67 case PCI_CHIP_E7221_G:
68 case PCI_CHIP_I915_GM:
69 case PCI_CHIP_I945_G:
70+ case PCI_CHIP_I945_GM:
71 xf86SetEntitySharable(usedChips[i]);
72
73 /* Allocate an entity private if necessary */
74diff -Naur xc.orig/programs/Xserver/hw/xfree86/drivers/i810/i830_cursor.c xc/programs/Xserver/hw/xfree86/drivers/i810/i830_cursor.c
75--- xc.orig/programs/Xserver/hw/xfree86/drivers/i810/i830_cursor.c 2006-01-19 03:39:29.000000000 -0800
76+++ xc/programs/Xserver/hw/xfree86/drivers/i810/i830_cursor.c 2006-01-19 03:46:54.000000000 -0800
77@@ -86,7 +86,7 @@
78
79 DPRINTF(PFX, "I830InitHWCursor\n");
80 /* Initialise the HW cursor registers, leaving the cursor hidden. */
81- if (IS_MOBILE(pI830) || IS_I915G(pI830) || IS_I945G(pI830)) {
82+ if (IS_MOBILE(pI830) || IS_I9XX(pI830)) {
83 temp = INREG(CURSOR_A_CONTROL);
84 temp &= ~(CURSOR_MODE | MCURSOR_GAMMA_ENABLE | MCURSOR_MEM_TYPE_LOCAL |
85 MCURSOR_PIPE_SELECT);
86@@ -308,7 +308,7 @@
87 }
88
89 /* have to upload the base for the new position */
90- if (IS_I915G(pI830) || IS_I915GM(pI830) || IS_I945G(pI830)) {
91+ if (IS_I9XX(pI830)) {
92 if (pI830->CursorIsARGB)
93 OUTREG(CURSOR_A_BASE, pI830->CursorMemARGB->Physical);
94 else
95@@ -339,7 +339,7 @@
96 pI830->CursorMemARGB->Physical, pI830->CursorMemARGB->Start);
97
98 pI830->cursorOn = TRUE;
99- if (IS_MOBILE(pI830) || IS_I915G(pI830) || IS_I945G(pI830)) {
100+ if (IS_MOBILE(pI830) || IS_I9XX(pI830)) {
101 temp = INREG(CURSOR_A_CONTROL);
102 temp &= ~(CURSOR_MODE | MCURSOR_PIPE_SELECT);
103 if (pI830->CursorIsARGB)
104@@ -387,7 +387,7 @@
105 DPRINTF(PFX, "I830HideCursor\n");
106
107 pI830->cursorOn = FALSE;
108- if (IS_MOBILE(pI830) || IS_I915G(pI830) || IS_I945G(pI830)) {
109+ if (IS_MOBILE(pI830) || IS_I9XX(pI830)) {
110 temp = INREG(CURSOR_A_CONTROL);
111 temp &= ~CURSOR_MODE;
112 temp |= CURSOR_MODE_DISABLE;
113diff -Naur xc.orig/programs/Xserver/hw/xfree86/drivers/i810/i830_driver.c xc/programs/Xserver/hw/xfree86/drivers/i810/i830_driver.c
114--- xc.orig/programs/Xserver/hw/xfree86/drivers/i810/i830_driver.c 2006-01-19 03:39:29.000000000 -0800
115+++ xc/programs/Xserver/hw/xfree86/drivers/i810/i830_driver.c 2006-01-19 03:46:54.000000000 -0800
116@@ -146,6 +146,9 @@
117 *
118 * 30/2005 Alan Hourihane
119 * - Add Intel(R) 945G support.
120+ *
121+ * 01/2006 Alan Hourihane & Charles Johnson
122+ * - Add Intel(R) 945GM support.
123 */
124
125 #ifdef HAVE_CONFIG_H
126@@ -196,6 +199,7 @@
127 {PCI_CHIP_E7221_G, "E7221 (i915)"},
128 {PCI_CHIP_I915_GM, "915GM"},
129 {PCI_CHIP_I945_G, "945G"},
130+ {PCI_CHIP_I945_GM, "945GM"},
131 {-1, NULL}
132 };
133
134@@ -208,6 +212,7 @@
135 {PCI_CHIP_E7221_G, PCI_CHIP_E7221_G, RES_SHARED_VGA},
136 {PCI_CHIP_I915_GM, PCI_CHIP_I915_GM, RES_SHARED_VGA},
137 {PCI_CHIP_I945_G, PCI_CHIP_I945_G, RES_SHARED_VGA},
138+ {PCI_CHIP_I945_GM, PCI_CHIP_I945_GM, RES_SHARED_VGA},
139 {-1, -1, RES_UNDEFINED}
140 };
141
142@@ -1323,7 +1328,7 @@
143 * The GTT varying according the the FbMapSize and the popup is 4KB */
144 range = (pI830->FbMapSize / (1024*1024)) + 4;
145
146- if (IS_I85X(pI830) || IS_I865G(pI830) || IS_I915G(pI830) || IS_I915GM(pI830) || IS_I945G(pI830)) {
147+ if (IS_I85X(pI830) || IS_I865G(pI830) || IS_I9XX(pI830)) {
148 switch (gmch_ctrl & I830_GMCH_GMS_MASK) {
149 case I855_GMCH_GMS_STOLEN_1M:
150 memsize = MB(1) - KB(range);
151@@ -1341,11 +1346,11 @@
152 memsize = MB(32) - KB(range);
153 break;
154 case I915G_GMCH_GMS_STOLEN_48M:
155- if (IS_I915G(pI830) || IS_I915GM(pI830) || IS_I945G(pI830))
156+ if (IS_I9XX(pI830))
157 memsize = MB(48) - KB(range);
158 break;
159 case I915G_GMCH_GMS_STOLEN_64M:
160- if (IS_I915G(pI830) || IS_I915GM(pI830) || IS_I945G(pI830))
161+ if (IS_I9XX(pI830))
162 memsize = MB(64) - KB(range);
163 break;
164 }
165@@ -2090,6 +2095,9 @@
166 case PCI_CHIP_I945_G:
167 chipname = "945G";
168 break;
169+ case PCI_CHIP_I945_GM:
170+ chipname = "945GM";
171+ break;
172 default:
173 chipname = "unknown chipset";
174 break;
175@@ -2127,7 +2135,7 @@
176 pI830->LinearAddr = pI830->pEnt->device->MemBase;
177 from = X_CONFIG;
178 } else {
179- if (IS_I915G(pI830) || IS_I915GM(pI830) || IS_I945G(pI830)) {
180+ if (IS_I9XX(pI830)) {
181 pI830->LinearAddr = pI830->PciInfo->memBase[2] & 0xF0000000;
182 from = X_PROBED;
183 } else if (pI830->PciInfo->memBase[1] != 0) {
184@@ -2149,7 +2157,7 @@
185 pI830->MMIOAddr = pI830->pEnt->device->IOBase;
186 from = X_CONFIG;
187 } else {
188- if (IS_I915G(pI830) || IS_I915GM(pI830) || IS_I945G(pI830)) {
189+ if (IS_I9XX(pI830)) {
190 pI830->MMIOAddr = pI830->PciInfo->memBase[0] & 0xFFF80000;
191 from = X_PROBED;
192 } else if (pI830->PciInfo->memBase[1]) {
193@@ -2194,7 +2202,7 @@
194 pI830->FbMapSize = 0x4000000; /* 64MB - has this been tested ?? */
195 }
196 } else {
197- if (IS_I915G(pI830) || IS_I915GM(pI830) || IS_I945G(pI830)) {
198+ if (IS_I9XX(pI830)) {
199 if (pI830->PciInfo->memBase[2] & 0x08000000)
200 pI830->FbMapSize = 0x8000000; /* 128MB aperture */
201 else
202@@ -2227,7 +2235,7 @@
203 if (pI830->PciInfo->chipType == PCI_CHIP_E7221_G)
204 pI830->availablePipes = 1;
205 else
206- if (IS_MOBILE(pI830) || IS_I915G(pI830) || IS_I945G(pI830))
207+ if (IS_MOBILE(pI830) || IS_I9XX(pI830))
208 pI830->availablePipes = 2;
209 else
210 pI830->availablePipes = 1;
211@@ -2872,7 +2880,7 @@
212 }
213
214 /* Check if the HW cursor needs physical address. */
215- if (IS_MOBILE(pI830) || IS_I915G(pI830) || IS_I945G(pI830))
216+ if (IS_MOBILE(pI830) || IS_I9XX(pI830))
217 pI830->CursorNeedsPhysical = TRUE;
218 else
219 pI830->CursorNeedsPhysical = FALSE;
220diff -Naur xc.orig/programs/Xserver/hw/xfree86/drivers/i810/i830_memory.c xc/programs/Xserver/hw/xfree86/drivers/i810/i830_memory.c
221--- xc.orig/programs/Xserver/hw/xfree86/drivers/i810/i830_memory.c 2006-01-19 03:39:29.000000000 -0800
222+++ xc/programs/Xserver/hw/xfree86/drivers/i810/i830_memory.c 2006-01-19 03:46:54.000000000 -0800
223@@ -1239,7 +1239,7 @@
224
225 i830Reg->Fence[nr] = 0;
226
227- if (IS_I915G(pI830) || IS_I915GM(pI830) || IS_I945G(pI830))
228+ if (IS_I9XX(pI830))
229 fence_mask = ~I915G_FENCE_START_MASK;
230 else
231 fence_mask = ~I830_FENCE_START_MASK;
232@@ -1247,7 +1247,7 @@
233 if (start & fence_mask) {
234 xf86DrvMsg(X_WARNING, pScrn->scrnIndex,
235 "SetFence: %d: start (0x%08x) is not %s aligned\n",
236- nr, start, (IS_I915G(pI830) || IS_I915GM(pI830) || IS_I945G(pI830)) ? "1MB" : "512k");
237+ nr, start, (IS_I9XX(pI830)) ? "1MB" : "512k");
238 return;
239 }
240
241@@ -1267,7 +1267,7 @@
242
243 val = (start | FENCE_X_MAJOR | FENCE_VALID);
244
245- if (IS_I915G(pI830) || IS_I915GM(pI830) || IS_I945G(pI830)) {
246+ if (IS_I9XX(pI830)) {
247 switch (size) {
248 case MB(1):
249 val |= I915G_FENCE_SIZE_1M;
250@@ -1328,7 +1328,7 @@
251 }
252 }
253
254- if (IS_I915G(pI830) || IS_I915GM(pI830) || IS_I945G(pI830))
255+ if (IS_I9XX(pI830))
256 fence_pitch = pitch / 512;
257 else
258 fence_pitch = pitch / 128;
259diff -Naur xc.orig/programs/Xserver/hw/xfree86/drivers/i810/i830_video.c xc/programs/Xserver/hw/xfree86/drivers/i810/i830_video.c
260--- xc.orig/programs/Xserver/hw/xfree86/drivers/i810/i830_video.c 2006-01-19 03:39:29.000000000 -0800
261+++ xc/programs/Xserver/hw/xfree86/drivers/i810/i830_video.c 2006-01-19 03:46:54.000000000 -0800
262@@ -617,7 +617,7 @@
263 adapt->nAttributes = NUM_ATTRIBUTES;
264 if (pI830->Clone)
265 adapt->nAttributes += CLONE_ATTRIBUTES;
266- if (IS_I915G(pI830) || IS_I915GM(pI830) || IS_I945G(pI830))
267+ if (IS_I9XX(pI830))
268 adapt->nAttributes += GAMMA_ATTRIBUTES; /* has gamma */
269 adapt->pAttributes = xnfalloc(sizeof(XF86AttributeRec) * adapt->nAttributes);
270 /* Now copy the attributes */
271@@ -628,7 +628,7 @@
272 memcpy((char*)att, (char*)CloneAttributes, sizeof(XF86AttributeRec) * CLONE_ATTRIBUTES);
273 att+=CLONE_ATTRIBUTES;
274 }
275- if (IS_I915G(pI830) || IS_I915GM(pI830) || IS_I945G(pI830)) {
276+ if (IS_I9XX(pI830)) {
277 memcpy((char*)att, (char*)GammaAttributes, sizeof(XF86AttributeRec) * GAMMA_ATTRIBUTES);
278 att+=GAMMA_ATTRIBUTES;
279 }
280@@ -688,7 +688,7 @@
281 if (pI830->Clone)
282 xvPipe = MAKE_ATOM("XV_PIPE");
283
284- if (IS_I915G(pI830) || IS_I915GM(pI830) || IS_I945G(pI830)) {
285+ if (IS_I9XX(pI830)) {
286 xvGamma0 = MAKE_ATOM("XV_GAMMA0");
287 xvGamma1 = MAKE_ATOM("XV_GAMMA1");
288 xvGamma2 = MAKE_ATOM("XV_GAMMA2");
289@@ -806,7 +806,7 @@
290 overlay->OCONFIG |= OVERLAY_PIPE_B;
291 if (pPriv->overlayOK)
292 OVERLAY_UPDATE;
293- } else if (attribute == xvGamma0 && (IS_I915G(pI830) || IS_I915GM(pI830) || IS_I945G(pI830))) {
294+ } else if (attribute == xvGamma0 && (IS_I9XX(pI830))) {
295 /* Avoid video anomalies, so set gamma registers when overlay is off */
296 /* We also clamp the values if they are outside the ranges */
297 if (!*pI830->overlayOn) {
298@@ -815,35 +815,35 @@
299 pPriv->gamma1 = pPriv->gamma0 + 0x7d;
300 } else
301 return BadRequest;
302- } else if (attribute == xvGamma1 && (IS_I915G(pI830) || IS_I915GM(pI830) || IS_I945G(pI830))) {
303+ } else if (attribute == xvGamma1 && (IS_I9XX(pI830))) {
304 if (!*pI830->overlayOn) {
305 pPriv->gamma1 = value;
306 if (pPriv->gamma1 - pPriv->gamma0 > 0x7d)
307 pPriv->gamma0 = pPriv->gamma1 - 0x7d;
308 } else
309 return BadRequest;
310- } else if (attribute == xvGamma2 && (IS_I915G(pI830) || IS_I915GM(pI830) || IS_I945G(pI830))) {
311+ } else if (attribute == xvGamma2 && (IS_I9XX(pI830))) {
312 if (!*pI830->overlayOn) {
313 pPriv->gamma2 = value;
314 if (pPriv->gamma3 - pPriv->gamma2 > 0x7d)
315 pPriv->gamma3 = pPriv->gamma2 + 0x7d;
316 } else
317 return BadRequest;
318- } else if (attribute == xvGamma3 && (IS_I915G(pI830) || IS_I915GM(pI830) || IS_I945G(pI830))) {
319+ } else if (attribute == xvGamma3 && (IS_I9XX(pI830))) {
320 if (!*pI830->overlayOn) {
321 pPriv->gamma3 = value;
322 if (pPriv->gamma3 - pPriv->gamma2 > 0x7d)
323 pPriv->gamma2 = pPriv->gamma3 - 0x7d;
324 } else
325 return BadRequest;
326- } else if (attribute == xvGamma4 && (IS_I915G(pI830) || IS_I915GM(pI830) || IS_I945G(pI830))) {
327+ } else if (attribute == xvGamma4 && (IS_I9XX(pI830))) {
328 if (!*pI830->overlayOn) {
329 pPriv->gamma4 = value;
330 if (pPriv->gamma5 - pPriv->gamma4 > 0x7d)
331 pPriv->gamma5 = pPriv->gamma4 + 0x7d;
332 } else
333 return BadRequest;
334- } else if (attribute == xvGamma5 && (IS_I915G(pI830) || IS_I915GM(pI830) || IS_I945G(pI830))) {
335+ } else if (attribute == xvGamma5 && (IS_I9XX(pI830))) {
336 if (!*pI830->overlayOn) {
337 pPriv->gamma5 = value;
338 if (pPriv->gamma5 - pPriv->gamma4 > 0x7d)
339@@ -875,7 +875,7 @@
340 attribute == xvGamma2 ||
341 attribute == xvGamma3 ||
342 attribute == xvGamma4 ||
343- attribute == xvGamma5) && (IS_I915G(pI830) || IS_I915GM(pI830) || IS_I945G(pI830))) {
344+ attribute == xvGamma5) && (IS_I9XX(pI830))) {
345 I830UpdateGamma(pScrn);
346 }
347
348@@ -895,17 +895,17 @@
349 *value = pPriv->contrast;
350 } else if (pI830->Clone && attribute == xvPipe) {
351 *value = pPriv->pipe;
352- } else if (attribute == xvGamma0 && (IS_I915G(pI830) || IS_I915GM(pI830) || IS_I945G(pI830))) {
353+ } else if (attribute == xvGamma0 && (IS_I9XX(pI830))) {
354 *value = pPriv->gamma0;
355- } else if (attribute == xvGamma1 && (IS_I915G(pI830) || IS_I915GM(pI830) || IS_I945G(pI830))) {
356+ } else if (attribute == xvGamma1 && (IS_I9XX(pI830))) {
357 *value = pPriv->gamma1;
358- } else if (attribute == xvGamma2 && (IS_I915G(pI830) || IS_I915GM(pI830) || IS_I945G(pI830))) {
359+ } else if (attribute == xvGamma2 && (IS_I9XX(pI830))) {
360 *value = pPriv->gamma2;
361- } else if (attribute == xvGamma3 && (IS_I915G(pI830) || IS_I915GM(pI830) || IS_I945G(pI830))) {
362+ } else if (attribute == xvGamma3 && (IS_I9XX(pI830))) {
363 *value = pPriv->gamma3;
364- } else if (attribute == xvGamma4 && (IS_I915G(pI830) || IS_I915GM(pI830) || IS_I945G(pI830))) {
365+ } else if (attribute == xvGamma4 && (IS_I9XX(pI830))) {
366 *value = pPriv->gamma4;
367- } else if (attribute == xvGamma5 && (IS_I915G(pI830) || IS_I915GM(pI830) || IS_I945G(pI830))) {
368+ } else if (attribute == xvGamma5 && (IS_I9XX(pI830))) {
369 *value = pPriv->gamma5;
370 } else if (attribute == xvColorKey) {
371 *value = pPriv->colorKey;
This page took 0.876215 seconds and 4 git commands to generate.