1 diff -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
5 #define PCI_CHIP_I945_G_BRIDGE 0x2770
8 +#ifndef PCI_CHIP_I945_GM
9 +#define PCI_CHIP_I945_GM 0x27A2
10 +#define PCI_CHIP_I945_GM_BRIDGE 0x27A0
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)
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))
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))
26 #define GTT_PAGE_SIZE KB(4)
27 #define ROUND_TO(x, y) (((x) + (y) - 1) / (y) * (y))
28 diff -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
32 .SH SUPPORTED HARDWARE
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.
38 .SH CONFIGURATION DETAILS
39 Please refer to __xconfigfile__(__filemansuffix__) for general configuration
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.
47 diff -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
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"},
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 }
67 case PCI_CHIP_E7221_G:
68 case PCI_CHIP_I915_GM:
70 + case PCI_CHIP_I945_GM:
71 xf86SetEntitySharable(usedChips[i]);
73 /* Allocate an entity private if necessary */
74 diff -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
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 |
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);
96 pI830->CursorMemARGB->Physical, pI830->CursorMemARGB->Start);
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)
105 DPRINTF(PFX, "I830HideCursor\n");
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;
113 diff -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
118 * 30/2005 Alan Hourihane
119 * - Add Intel(R) 945G support.
121 + * 01/2006 Alan Hourihane & Charles Johnson
122 + * - Add Intel(R) 945GM support.
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"},
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}
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;
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);
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);
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);
165 @@ -2090,6 +2095,9 @@
166 case PCI_CHIP_I945_G:
169 + case PCI_CHIP_I945_GM:
170 + chipname = "945GM";
173 chipname = "unknown chipset";
175 @@ -2127,7 +2135,7 @@
176 pI830->LinearAddr = pI830->pEnt->device->MemBase;
179 - if (IS_I915G(pI830) || IS_I915GM(pI830) || IS_I945G(pI830)) {
180 + if (IS_I9XX(pI830)) {
181 pI830->LinearAddr = pI830->PciInfo->memBase[2] & 0xF0000000;
183 } else if (pI830->PciInfo->memBase[1] != 0) {
184 @@ -2149,7 +2157,7 @@
185 pI830->MMIOAddr = pI830->pEnt->device->IOBase;
188 - if (IS_I915G(pI830) || IS_I915GM(pI830) || IS_I945G(pI830)) {
189 + if (IS_I9XX(pI830)) {
190 pI830->MMIOAddr = pI830->PciInfo->memBase[0] & 0xFFF80000;
192 } else if (pI830->PciInfo->memBase[1]) {
193 @@ -2194,7 +2202,7 @@
194 pI830->FbMapSize = 0x4000000; /* 64MB - has this been tested ?? */
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 */
202 @@ -2227,7 +2235,7 @@
203 if (pI830->PciInfo->chipType == PCI_CHIP_E7221_G)
204 pI830->availablePipes = 1;
206 - if (IS_MOBILE(pI830) || IS_I915G(pI830) || IS_I945G(pI830))
207 + if (IS_MOBILE(pI830) || IS_I9XX(pI830))
208 pI830->availablePipes = 2;
210 pI830->availablePipes = 1;
211 @@ -2872,7 +2880,7 @@
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;
219 pI830->CursorNeedsPhysical = FALSE;
220 diff -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 @@
225 i830Reg->Fence[nr] = 0;
227 - if (IS_I915G(pI830) || IS_I915GM(pI830) || IS_I945G(pI830))
228 + if (IS_I9XX(pI830))
229 fence_mask = ~I915G_FENCE_START_MASK;
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");
241 @@ -1267,7 +1267,7 @@
243 val = (start | FENCE_X_MAJOR | FENCE_VALID);
245 - if (IS_I915G(pI830) || IS_I915GM(pI830) || IS_I945G(pI830)) {
246 + if (IS_I9XX(pI830)) {
249 val |= I915G_FENCE_SIZE_1M;
250 @@ -1328,7 +1328,7 @@
254 - if (IS_I915G(pI830) || IS_I915GM(pI830) || IS_I945G(pI830))
255 + if (IS_I9XX(pI830))
256 fence_pitch = pitch / 512;
258 fence_pitch = pitch / 128;
259 diff -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
263 adapt->nAttributes = NUM_ATTRIBUTES;
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 */
272 memcpy((char*)att, (char*)CloneAttributes, sizeof(XF86AttributeRec) * CLONE_ATTRIBUTES);
273 att+=CLONE_ATTRIBUTES;
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;
282 xvPipe = MAKE_ATOM("XV_PIPE");
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");
290 overlay->OCONFIG |= OVERLAY_PIPE_B;
291 if (pPriv->overlayOK)
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;
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;
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;
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;
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;
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)
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);
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;