Репозиторий Sisyphus
Последнее обновление: 1 октября 2023 | Пакетов: 18631 | Посещений: 37849978
en ru br
Репозитории ALT
4.0: 7.3.0-alt1
3.0: 6.8.2-alt18
+updates:6.8.2-alt24
www.altlinux.org/Changes

Группа :: Система/X11
Пакет: xorg-x11

 Главная   Изменения   Спек   Патчи   Sources   Загрузить   Gear   Bugs and FR  Repocop 

Патч: xorg-x11-6.8.2-cvs-i810.patch
Скачать


diff -Naur xorg-x11-6.8.2/xc/programs/Xserver/hw/xfree86/drivers/i810/common.h xorg-x11-6.8.x.99/xc/programs/Xserver/hw/xfree86/drivers/i810/common.h
--- xorg-x11-6.8.2/xc/programs/Xserver/hw/xfree86/drivers/i810/common.h	2004-12-15 12:35:23 +0300
+++ xorg-x11-6.8.x.99/xc/programs/Xserver/hw/xfree86/drivers/i810/common.h	2005-06-03 12:23:33 +0400
@@ -305,6 +306,27 @@
 #define PCI_CHIP_I915_G_BRIDGE	   0x2580
 #endif
 
+#ifndef PCI_CHIP_I915_GM
+#define PCI_CHIP_I915_GM	   0x2592
+#define PCI_CHIP_I915_GM_BRIDGE	   0x2590
+#endif
+
+#ifndef PCI_CHIP_E7221_G
+#define PCI_CHIP_E7221_G	   0x258A
+/* Same as I915_G_BRIDGE */
+#define PCI_CHIP_E7221_G_BRIDGE	   0x2580
+#endif
+
+#ifndef PCI_CHIP_I945_G
+#define PCI_CHIP_I945_G        0x2772
+#define PCI_CHIP_I945_G_BRIDGE 0x2770
+#endif
+
+#ifndef PCI_CHIP_I945_GM
+#define PCI_CHIP_I945_GM        0x27A2
+#define PCI_CHIP_I945_GM_BRIDGE 0x27A0
+#endif
+
 #define IS_I810(pI810) (pI810->PciInfo->chipType == PCI_CHIP_I810 ||	\
 			pI810->PciInfo->chipType == PCI_CHIP_I810_DC100 || \
 			pI810->PciInfo->chipType == PCI_CHIP_I810_E)
@@ -312,10 +329,15 @@
 #define IS_I830(pI810) (pI810->PciInfo->chipType == PCI_CHIP_I830_M)
 #define IS_845G(pI810) (pI810->PciInfo->chipType == PCI_CHIP_845_G)
 #define IS_I85X(pI810)  (pI810->PciInfo->chipType == PCI_CHIP_I855_GM)
+#define IS_I852(pI810)  (pI810->PciInfo->chipType == PCI_CHIP_I855_GM && (pI810->variant == I852_GM || pI810->variant == I852_GME))
+#define IS_I855(pI810)  (pI810->PciInfo->chipType == PCI_CHIP_I855_GM && (pI810->variant == I855_GM || pI810->variant == I855_GME))
 #define IS_I865G(pI810) (pI810->PciInfo->chipType == PCI_CHIP_I865_G)
-#define IS_I915G(pI810) (pI810->PciInfo->chipType == PCI_CHIP_I915_G)
+#define IS_I915G(pI810) (pI810->PciInfo->chipType == PCI_CHIP_I915_G || pI810->PciInfo->chipType == PCI_CHIP_E7221_G)
+#define IS_I915GM(pI810) (pI810->PciInfo->chipType == PCI_CHIP_I915_GM)
+#define IS_I945G(pI810) (pI810->PciInfo->chipType == PCI_CHIP_I945_G)
+#define IS_I945GM(pI810) (pI810->PciInfo->chipType == PCI_CHIP_I945_GM)
 
-#define IS_MOBILE(pI810) (IS_I830(pI810) || IS_I85X(pI810))
+#define IS_MOBILE(pI810) (IS_I830(pI810) || IS_I85X(pI810) || IS_I915GM(pI810) || IS_I915GM(pI810))
 
 #define GTT_PAGE_SIZE			KB(4)
 #define ROUND_TO(x, y)			(((x) + (y) - 1) / (y) * (y))
diff -Naur xorg-x11-6.8.2/xc/programs/Xserver/hw/xfree86/drivers/i810/i810_driver.c xorg-x11-6.8.x.99/xc/programs/Xserver/hw/xfree86/drivers/i810/i810_driver.c
--- xorg-x11-6.8.2/xc/programs/Xserver/hw/xfree86/drivers/i810/i810_driver.c	2004-12-15 12:35:23 +0300
+++ xorg-x11-6.8.x.99/xc/programs/Xserver/hw/xfree86/drivers/i810/i810_driver.c	2005-06-03 12:23:33 +0400
@@ -129,6 +129,10 @@
    {PCI_CHIP_I855_GM,		"852GM/855GM"},
    {PCI_CHIP_I865_G,		"865G"},
    {PCI_CHIP_I915_G,		"915G"},
+   {PCI_CHIP_E7221_G,		"E7221 (i915)"},
+   {PCI_CHIP_I915_GM,		"915GM"},
+   {PCI_CHIP_I945_G,		"945G"},
+   {PCI_CHIP_I945_GM,		"945GM"},
    {-1,				NULL}
 };
 
@@ -144,6 +147,10 @@
    {PCI_CHIP_I855_GM,		PCI_CHIP_I855_GM,	RES_SHARED_VGA},
    {PCI_CHIP_I865_G,		PCI_CHIP_I865_G,	RES_SHARED_VGA},
    {PCI_CHIP_I915_G,		PCI_CHIP_I915_G,	RES_SHARED_VGA},
+   {PCI_CHIP_E7221_G,		PCI_CHIP_E7221_G,	RES_SHARED_VGA},
+   {PCI_CHIP_I915_GM,		PCI_CHIP_I915_GM,	RES_SHARED_VGA},
+   {PCI_CHIP_I945_G,		PCI_CHIP_I945_G,	RES_SHARED_VGA},
+   {PCI_CHIP_I945_GM,		PCI_CHIP_I945_GM,	RES_SHARED_VGA},
    {-1,				-1, RES_UNDEFINED }
 };
 
@@ -560,6 +566,10 @@
 	    case PCI_CHIP_I830_M:
 	    case PCI_CHIP_I855_GM:
 	    case PCI_CHIP_I915_G:
+	    case PCI_CHIP_E7221_G:
+	    case PCI_CHIP_I915_GM:
+	    case PCI_CHIP_I945_G:
+	    case PCI_CHIP_I945_GM:
     	       xf86SetEntitySharable(usedChips[i]);
 
     	       /* Allocate an entity private if necessary */		
diff -Naur xorg-x11-6.8.2/xc/programs/Xserver/hw/xfree86/drivers/i810/i810.man xorg-x11-6.8.x.99/xc/programs/Xserver/hw/xfree86/drivers/i810/i810.man
--- xorg-x11-6.8.2/xc/programs/Xserver/hw/xfree86/drivers/i810/i810.man	2004-06-22 18:28:46 +0400
+++ xorg-x11-6.8.x.99/xc/programs/Xserver/hw/xfree86/drivers/i810/i810.man	2005-06-03 12:23:33 +0400
@@ -25,7 +25,7 @@
 .SH SUPPORTED HARDWARE
 .B i810
 supports the i810, i810-DC100, i810e, i815, 830M, 845G, 852GM, 855GM,
-865G and 915G chipsets.
+865G, 915G, 915GM, 945G and 945GM chipsets.
 
 .SH CONFIGURATION DETAILS
 Please refer to __xconfigfile__(__filemansuffix__) for general configuration
@@ -191,6 +191,17 @@
 the machine has booted, but unfortunately it doesn't always work and
 is extremely dependent upon the Video BIOS.
 Default: disabled
+.TP
+.BI "Option \*qRotate\*q \*qCW\*q"
+.TP
+.BI "Option \*qRotate\*q \*qCCW\*q"
+Rotate the desktop 90 degrees clockwise or counterclockwise.  This option 
+forces the ShadowFB option on, and disables acceleration.
+Default: no rotation.
+.TP
+.BI "Option \*qShadowFB\*q \*q" boolean \*q
+Enable or disable use of the shadow framebuffer layer.  This option
+disables acceleration.  Default: off.
 
 .SH "SEE ALSO"
 __xservername__(__appmansuffix__), __xconfigfile__(__filemansuffix__), xorgconfig(__appmansuffix__), Xserver(__appmansuffix__), X(__miscmansuffix__)
@@ -199,5 +210,5 @@
 Jeff Hartmann, Mark Vojkovich, Alan Hourihane, H. J. Lu.  830M and 845G
 support reworked for XFree86 4.3 by David Dawes and Keith Whitwell.
 852GM, 855GM, and 865G support added by David Dawes and Keith Whitwell.
-915G support added by Alan Hourihane and Keith Whitwell.
+915G and 915GM support added by Alan Hourihane and Keith Whitwell.
 Dual Head, Clone and lid status support added by Alan Hourihane.
diff -Naur xorg-x11-6.8.2/xc/programs/Xserver/hw/xfree86/drivers/i810/i830_cursor.c xorg-x11-6.8.x.99/xc/programs/Xserver/hw/xfree86/drivers/i810/i830_cursor.c
--- xorg-x11-6.8.2/xc/programs/Xserver/hw/xfree86/drivers/i810/i830_cursor.c	2004-06-22 18:28:46 +0400
+++ xorg-x11-6.8.x.99/xc/programs/Xserver/hw/xfree86/drivers/i810/i830_cursor.c	2005-06-03 12:23:33 +0400
@@ -82,7 +82,7 @@
 
    DPRINTF(PFX, "I830InitHWCursor\n");
    /* Initialise the HW cursor registers, leaving the cursor hidden. */
-   if (IS_MOBILE(pI830) || IS_I915G(pI830)) {
+   if (IS_MOBILE(pI830) || IS_I915G(pI830) || IS_I945G(pI830) || IS_I945GM(pI830)) {
       temp = INREG(CURSOR_A_CONTROL);
       temp &= ~(CURSOR_MODE | MCURSOR_GAMMA_ENABLE | MCURSOR_MEM_TYPE_LOCAL |
 		MCURSOR_PIPE_SELECT);
@@ -304,7 +304,7 @@
    }
 
    /* have to upload the base for the new position */
-   if (IS_I915G(pI830)) {
+   if (IS_I915G(pI830) || IS_I915GM(pI830) || IS_I945G(pI830) || IS_I945GM(pI830)) {
       if (pI830->CursorIsARGB)
          OUTREG(CURSOR_A_BASE, pI830->CursorMemARGB->Physical);
       else
@@ -335,7 +335,7 @@
 	   pI830->CursorMemARGB->Physical, pI830->CursorMemARGB->Start);
 
    pI830->cursorOn = TRUE;
-   if (IS_MOBILE(pI830) || IS_I915G(pI830)) {
+   if (IS_MOBILE(pI830) || IS_I915G(pI830) || IS_I945G(pI830) || IS_I945GM(pI830)) {
       temp = INREG(CURSOR_A_CONTROL);
       temp &= ~(CURSOR_MODE | MCURSOR_PIPE_SELECT);
       if (pI830->CursorIsARGB)
@@ -383,7 +383,7 @@
    DPRINTF(PFX, "I830HideCursor\n");
 
    pI830->cursorOn = FALSE;
-   if (IS_MOBILE(pI830) || IS_I915G(pI830)) {
+   if (IS_MOBILE(pI830) || IS_I915G(pI830) || IS_I945G(pI830) || IS_I945GM(pI830)) {
       temp = INREG(CURSOR_A_CONTROL);
       temp &= ~CURSOR_MODE;
       temp |= CURSOR_MODE_DISABLE;
diff -Naur xorg-x11-6.8.2/xc/programs/Xserver/hw/xfree86/drivers/i810/i830_driver.c xorg-x11-6.8.x.99/xc/programs/Xserver/hw/xfree86/drivers/i810/i830_driver.c
--- xorg-x11-6.8.2/xc/programs/Xserver/hw/xfree86/drivers/i810/i830_driver.c	2004-12-15 12:35:23 +0300
+++ xorg-x11-6.8.x.99/xc/programs/Xserver/hw/xfree86/drivers/i810/i830_driver.c	2005-06-09 22:13:13 +0400
@@ -143,6 +143,9 @@
  *        - Add lid status checking
  *        - Fix Xvideo with high-res LFP's
  *        - Add ARGB HW cursor support
+ *
+ *    30/2005 Alan Hourihane
+ *        - Add Intel(R) 945G support.
  */
 
 #ifndef PRINT_MODE_INFO
@@ -185,6 +189,10 @@
    {PCI_CHIP_I855_GM,		"852GM/855GM"},
    {PCI_CHIP_I865_G,		"865G"},
    {PCI_CHIP_I915_G,		"915G"},
+   {PCI_CHIP_E7221_G,		"E7221 (i915)"},
+   {PCI_CHIP_I915_GM,		"915GM"},
+   {PCI_CHIP_I945_G,		"945G"},
+   {PCI_CHIP_I945_GM,		"945GM"},
    {-1,				NULL}
 };
 
@@ -194,6 +201,10 @@
    {PCI_CHIP_I855_GM,		PCI_CHIP_I855_GM,	RES_SHARED_VGA},
    {PCI_CHIP_I865_G,		PCI_CHIP_I865_G,	RES_SHARED_VGA},
    {PCI_CHIP_I915_G,		PCI_CHIP_I915_G,	RES_SHARED_VGA},
+   {PCI_CHIP_E7221_G,		PCI_CHIP_E7221_G,	RES_SHARED_VGA},
+   {PCI_CHIP_I915_GM,		PCI_CHIP_I915_GM,	RES_SHARED_VGA},
+   {PCI_CHIP_I945_G,		PCI_CHIP_I945_G,	RES_SHARED_VGA},
+   {PCI_CHIP_I945_GM,		PCI_CHIP_I945_GM,	RES_SHARED_VGA},
    {-1,				-1,			RES_UNDEFINED}
 };
 
@@ -942,7 +1319,7 @@
     * The GTT varying according the the FbMapSize and the popup is 4KB */
    range = (pI830->FbMapSize / (1024*1024)) + 4;
 
-   if (IS_I85X(pI830) || IS_I865G(pI830) || IS_I915G(pI830)) {
+   if (IS_I85X(pI830) || IS_I865G(pI830) || IS_I915G(pI830) || IS_I915GM(pI830) || IS_I945G(pI830) || IS_I945GM(pI830)) {
       switch (gmch_ctrl & I830_GMCH_GMS_MASK) {
       case I855_GMCH_GMS_STOLEN_1M:
 	 memsize = MB(1) - KB(range);
@@ -960,11 +1337,11 @@
 	 memsize = MB(32) - KB(range);
 	 break;
       case I915G_GMCH_GMS_STOLEN_48M:
-	 if (IS_I915G(pI830))
+	 if (IS_I915G(pI830) || IS_I915GM(pI830) || IS_I945G(pI830) || IS_I945GM(pI830))
 	    memsize = MB(48) - KB(range);
 	 break;
       case I915G_GMCH_GMS_STOLEN_64M:
-	 if (IS_I915G(pI830))
+	 if (IS_I915G(pI830) || IS_I915GM(pI830) || IS_I945G(pI830) || IS_I945GM(pI830))
 	    memsize = MB(64) - KB(range);
 	 break;
       }
@@ -1660,6 +2076,18 @@
    case PCI_CHIP_I915_G:
       chipname = "915G";
       break;
+   case PCI_CHIP_E7221_G:
+      chipname = "E7221 (i915)";
+      break;
+   case PCI_CHIP_I915_GM:
+      chipname = "915GM";
+      break;
+   case PCI_CHIP_I945_G:
+      chipname = "945G";
+      break;
+   case PCI_CHIP_I945_GM:
+      chipname = "945GM";
+      break;
    default:
       chipname = "unknown chipset";
       break;
@@ -1697,7 +2122,7 @@
       pI830->LinearAddr = pI830->pEnt->device->MemBase;
       from = X_CONFIG;
    } else {
-      if (IS_I915G(pI830)) {
+      if (IS_I915G(pI830) || IS_I915GM(pI830) || IS_I945G(pI830) || IS_I945GM(pI830)) {
 	 pI830->LinearAddr = pI830->PciInfo->memBase[2] & 0xF0000000;
 	 from = X_PROBED;
       } else if (pI830->PciInfo->memBase[1] != 0) {
@@ -1719,7 +2144,7 @@
       pI830->MMIOAddr = pI830->pEnt->device->IOBase;
       from = X_CONFIG;
    } else {
-      if (IS_I915G(pI830)) {
+      if (IS_I915G(pI830) || IS_I915GM(pI830) || IS_I945G(pI830) || IS_I945GM(pI830)) {
 	 pI830->MMIOAddr = pI830->PciInfo->memBase[0] & 0xFFF80000;
 	 from = X_PROBED;
       } else if (pI830->PciInfo->memBase[1]) {
@@ -1764,11 +2189,14 @@
 	 pI830->FbMapSize = 0x4000000; /* 64MB - has this been tested ?? */
       }
    } else {
-      if (IS_I915G(pI830)) {
+      if (IS_I915G(pI830) || IS_I915GM(pI830) || IS_I945G(pI830) || IS_I945GM(pI830)) {
 	 if (pI830->PciInfo->memBase[2] & 0x08000000)
 	    pI830->FbMapSize = 0x8000000;	/* 128MB aperture */
 	 else
 	    pI830->FbMapSize = 0x10000000;	/* 256MB aperture */
+
+   	 if (pI830->PciInfo->chipType == PCI_CHIP_E7221_G)
+	    pI830->FbMapSize = 0x8000000;	/* 128MB aperture */
       } else
 	 /* 128MB aperture for later chips */
 	 pI830->FbMapSize = 0x8000000;
@@ -1791,7 +2219,10 @@
       }
    }
 
-   if (IS_MOBILE(pI830) || IS_I915G(pI830))
+   if (pI830->PciInfo->chipType == PCI_CHIP_E7221_G)
+      pI830->availablePipes = 1;
+   else
+   if (IS_MOBILE(pI830) || IS_I915G(pI830) || IS_I945G(pI830) || IS_I945GM(pI830))
       pI830->availablePipes = 2;
    else
       pI830->availablePipes = 1;
@@ -2215,8 +2693,11 @@
 
    xf86DrvMsg(pScrn->scrnIndex, X_INFO, "BIOS Build: %d\n",pI830->bios_version);
 
-   /* BIOS build 3062 changed the pipe switching functionality */
+   if (IS_I915G(pI830) || IS_I915GM(pI830) || IS_I945G(pI830) || IS_I945GM(pI830))
+      pI830->newPipeSwitch = TRUE;
+   else
    if (pI830->availablePipes == 2 && pI830->bios_version >= 3062) {
+      /* BIOS build 3062 changed the pipe switching functionality */
       pI830->newPipeSwitch = TRUE;
       xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Using new Pipe switch code\n");
    } else
@@ -2367,14 +2861,13 @@
    }
 
    /* Check if the HW cursor needs physical address. */
-   if (IS_MOBILE(pI830) || IS_I915G(pI830))
+   if (IS_MOBILE(pI830) || IS_I915G(pI830) || IS_I945G(pI830) || IS_I945GM(pI830))
       pI830->CursorNeedsPhysical = TRUE;
    else
       pI830->CursorNeedsPhysical = FALSE;
 
-   /* Force ring buffer to be in low memory for the 845G and later. */
-   if (IS_845G(pI830) || IS_I85X(pI830) || IS_I865G(pI830) || IS_I915G(pI830))
-      pI830->NeedRingBufferLow = TRUE;
+   /* Force ring buffer to be in low memory for all chipsets */
+   pI830->NeedRingBufferLow = TRUE;
 
    /*
     * XXX If we knew the pre-initialised GTT format for certain, we could
diff -Naur xorg-x11-6.8.2/xc/programs/Xserver/hw/xfree86/drivers/i810/i830_memory.c xorg-x11-6.8.x.99/xc/programs/Xserver/hw/xfree86/drivers/i810/i830_memory.c
--- xorg-x11-6.8.2/xc/programs/Xserver/hw/xfree86/drivers/i810/i830_memory.c	2004-12-15 12:35:23 +0300
+++ xorg-x11-6.8.x.99/xc/programs/Xserver/hw/xfree86/drivers/i810/i830_memory.c	2005-06-03 12:23:33 +0400
@@ -1236,7 +1235,7 @@
 
    i830Reg->Fence[nr] = 0;
 
-   if (IS_I915G(pI830))
+   if (IS_I915G(pI830) || IS_I915GM(pI830) || IS_I945G(pI830) || IS_I945GM(pI830))
    	fence_mask = ~I915G_FENCE_START_MASK;
    else
    	fence_mask = ~I830_FENCE_START_MASK;
@@ -1244,7 +1243,7 @@
    if (start & fence_mask) {
       xf86DrvMsg(X_WARNING, pScrn->scrnIndex,
 		 "SetFence: %d: start (0x%08x) is not %s aligned\n",
-		 nr, start, (IS_I915G(pI830)) ? "1MB" : "512k");
+		 nr, start, (IS_I915G(pI830) || IS_I915GM(pI830) || IS_I945G(pI830) || IS_I945GM(pI830)) ? "1MB" : "512k");
       return;
    }
 
@@ -1264,7 +1263,7 @@
 
    val = (start | FENCE_X_MAJOR | FENCE_VALID);
 
-   if (IS_I915G(pI830)) {
+   if (IS_I915G(pI830) || IS_I915GM(pI830) || IS_I945G(pI830) || IS_I945GM(pI830)) {
    	switch (size) {
 	   case MB(1):
       		val |= I915G_FENCE_SIZE_1M;
@@ -1325,7 +1324,7 @@
    	}
    }
 
-   if (IS_I915G(pI830))
+   if (IS_I915G(pI830) || IS_I915GM(pI830) || IS_I945G(pI830) || IS_I945GM(pI830))
 	fence_pitch = pitch / 512;
    else
 	fence_pitch = pitch / 128;
--- xorg-x11-6.8.2/xc/programs/Xserver/hw/xfree86/drivers/i810/i830_video.c	2005-01-13 02:22:41 +0300
+++ xorg-x11-6.8.x.99/xc/programs/Xserver/hw/xfree86/drivers/i810/i830_video.c	2005-06-09 22:13:14 +0400
@@ -110,7 +110,7 @@
 
 #define MAKE_ATOM(a) MakeAtom(a, sizeof(a) - 1, TRUE)
 
-static Atom xvBrightness, xvContrast, xvColorKey;
+static Atom xvBrightness, xvContrast, xvColorKey, xvPipe;
 static Atom xvGamma0, xvGamma1, xvGamma2, xvGamma3, xvGamma4, xvGamma5;
 
 #define IMAGE_MAX_WIDTH		1440
@@ -251,12 +251,20 @@
    {15, TrueColor}, {16, TrueColor}, {24, TrueColor}
 };
 
-#define NUM_ATTRIBUTES 9
+#define CLONE_ATTRIBUTES 1
+static XF86AttributeRec CloneAttributes[CLONE_ATTRIBUTES] = {
+   {XvSettable | XvGettable, 0, 1, "XV_PIPE"}
+};
 
+#define NUM_ATTRIBUTES 3
 static XF86AttributeRec Attributes[NUM_ATTRIBUTES] = {
    {XvSettable | XvGettable, 0, (1 << 24) - 1, "XV_COLORKEY"},
    {XvSettable | XvGettable, -128, 127, "XV_BRIGHTNESS"},
-   {XvSettable | XvGettable, 0, 255, "XV_CONTRAST"},
+   {XvSettable | XvGettable, 0, 255, "XV_CONTRAST"}
+};
+
+#define GAMMA_ATTRIBUTES 6
+static XF86AttributeRec GammaAttributes[GAMMA_ATTRIBUTES] = {
    {XvSettable | XvGettable, 0, 0xffffff, "XV_GAMMA0"},
    {XvSettable | XvGettable, 0, 0xffffff, "XV_GAMMA1"},
    {XvSettable | XvGettable, 0, 0xffffff, "XV_GAMMA2"},
@@ -342,6 +350,7 @@
 
    int brightness;
    int contrast;
+   int pipe;
 
    RegionRec clip;
    CARD32 colorKey;
@@ -503,7 +512,7 @@
     * Select which pipe the overlay is enabled on.
     */
    overlay->OCONFIG &= ~OVERLAY_PIPE_MASK;
-   if (pI830->pipe == 0)
+   if (pPriv->pipe == 0)
       overlay->OCONFIG |= OVERLAY_PIPE_A;
    else 
       overlay->OCONFIG |= OVERLAY_PIPE_B;
@@ -580,6 +589,7 @@
    I830Ptr pI830 = I830PTR(pScrn);
    XF86VideoAdaptorPtr adapt;
    I830PortPrivPtr pPriv;
+   XF86AttributePtr att;
 
    DPRINTF(PFX, "I830SetupImageVideo\n");
 
@@ -589,7 +599,7 @@
 
    adapt->type = XvWindowMask | XvInputMask | XvImageMask;
    adapt->flags = VIDEO_OVERLAID_IMAGES | VIDEO_CLIP_TO_VIEWPORT;
-   adapt->name = "Intel(R) 830M/845G/852GM/855GM/865G/915G Video Overlay";
+   adapt->name = "Intel(R) Video Overlay";
    adapt->nEncodings = 1;
    adapt->pEncodings = DummyEncoding;
    adapt->nFormats = NUM_FORMATS;
@@ -600,12 +610,25 @@
    pPriv = (I830PortPrivPtr) (&adapt->pPortPrivates[1]);
 
    adapt->pPortPrivates[0].ptr = (pointer) (pPriv);
-   adapt->pAttributes = Attributes;
+   adapt->nAttributes = NUM_ATTRIBUTES;
+   if (pI830->Clone)
+      adapt->nAttributes += CLONE_ATTRIBUTES;
+   if (IS_I915G(pI830) || IS_I915GM(pI830) || IS_I945G(pI830) || IS_I945GM(pI830))
+      adapt->nAttributes += GAMMA_ATTRIBUTES; /* has gamma */
+   adapt->pAttributes = xnfalloc(sizeof(XF86AttributeRec) * adapt->nAttributes);
+   /* Now copy the attributes */
+   att = adapt->pAttributes;
+   memcpy((char *)att, (char*)Attributes, sizeof(XF86AttributeRec)* NUM_ATTRIBUTES);
+   att+=NUM_ATTRIBUTES;
+   if (pI830->Clone) {
+      memcpy((char*)att, (char*)CloneAttributes, sizeof(XF86AttributeRec) * CLONE_ATTRIBUTES);
+      att+=CLONE_ATTRIBUTES;
+   }
+   if (IS_I915G(pI830) || IS_I915GM(pI830) || IS_I945G(pI830) || IS_I945GM(pI830)) {
+      memcpy((char*)att, (char*)GammaAttributes, sizeof(XF86AttributeRec) * GAMMA_ATTRIBUTES);
+      att+=GAMMA_ATTRIBUTES;
+   }
    adapt->nImages = NUM_IMAGES;
-   if (IS_I915G(pI830))
-      adapt->nAttributes = 9; /* has gamma */
-   else
-      adapt->nAttributes = 3;
    adapt->pImages = Images;
    adapt->PutVideo = NULL;
    adapt->PutStill = NULL;
@@ -622,6 +645,7 @@
    pPriv->videoStatus = 0;
    pPriv->brightness = 0;
    pPriv->contrast = 64;
+   pPriv->pipe = pI830->pipe; /* default to current pipe */
    pPriv->linear = NULL;
    pPriv->currentBuf = 0;
    pPriv->gamma5 = 0xc0c0c0;
@@ -655,7 +679,12 @@
    xvBrightness = MAKE_ATOM("XV_BRIGHTNESS");
    xvContrast = MAKE_ATOM("XV_CONTRAST");
    xvColorKey = MAKE_ATOM("XV_COLORKEY");
-   if (IS_I915G(pI830)) {
+
+   /* Allow the pipe to be switched from pipe A to B when in clone mode */
+   if (pI830->Clone)
+     xvPipe = MAKE_ATOM("XV_PIPE");
+
+   if (IS_I915G(pI830) || IS_I915GM(pI830) || IS_I945G(pI830) || IS_I945GM(pI830)) {
      xvGamma0 = MAKE_ATOM("XV_GAMMA0");
      xvGamma1 = MAKE_ATOM("XV_GAMMA1");
      xvGamma2 = MAKE_ATOM("XV_GAMMA2");
@@ -759,7 +788,21 @@
       overlay->OCLRC0 = (pPriv->contrast << 18) | (pPriv->brightness & 0xff);
       if (pPriv->overlayOK)
          OVERLAY_UPDATE;
-   } else if (attribute == xvGamma0 && (IS_I915G(pI830))) {
+   } else if (pI830->Clone && attribute == xvPipe) {
+      if ((value < 0) || (value > 1))
+         return BadValue;
+      pPriv->pipe = value;
+      /*
+       * Select which pipe the overlay is enabled on.
+       */
+      overlay->OCONFIG &= ~OVERLAY_PIPE_MASK;
+      if (pPriv->pipe == 0)
+         overlay->OCONFIG |= OVERLAY_PIPE_A;
+      else 
+         overlay->OCONFIG |= OVERLAY_PIPE_B;
+      if (pPriv->overlayOK)
+         OVERLAY_UPDATE;
+   } else if (attribute == xvGamma0 && (IS_I915G(pI830) || IS_I915GM(pI830) || IS_I945G(pI830) || IS_I945GM(pI830))) {
       /* Avoid video anomalies, so set gamma registers when overlay is off */
       /* We also clamp the values if they are outside the ranges */
       if (!*pI830->overlayOn) {
@@ -768,35 +811,35 @@
 	   pPriv->gamma1 = pPriv->gamma0 + 0x7d;
       } else
          return BadRequest;
-   } else if (attribute == xvGamma1 && (IS_I915G(pI830))) {
+   } else if (attribute == xvGamma1 && (IS_I915G(pI830) || IS_I915GM(pI830) || IS_I945G(pI830) || IS_I945GM(pI830))) {
       if (!*pI830->overlayOn) {
          pPriv->gamma1 = value;
          if (pPriv->gamma1 - pPriv->gamma0 > 0x7d)
            pPriv->gamma0 = pPriv->gamma1 - 0x7d;
       } else
          return BadRequest;
-   } else if (attribute == xvGamma2 && (IS_I915G(pI830))) {
+   } else if (attribute == xvGamma2 && (IS_I915G(pI830) || IS_I915GM(pI830) || IS_I945G(pI830) || IS_I945GM(pI830))) {
       if (!*pI830->overlayOn) {
          pPriv->gamma2 = value;
          if (pPriv->gamma3 - pPriv->gamma2 > 0x7d)
             pPriv->gamma3 = pPriv->gamma2 + 0x7d;
       } else
          return BadRequest;
-   } else if (attribute == xvGamma3 && (IS_I915G(pI830))) {
+   } else if (attribute == xvGamma3 && (IS_I915G(pI830) || IS_I915GM(pI830) || IS_I945G(pI830) || IS_I945GM(pI830))) {
       if (!*pI830->overlayOn) {
          pPriv->gamma3 = value;
          if (pPriv->gamma3 - pPriv->gamma2 > 0x7d)
             pPriv->gamma2 = pPriv->gamma3 - 0x7d;
       } else
          return BadRequest;
-   } else if (attribute == xvGamma4 && (IS_I915G(pI830))) {
+   } else if (attribute == xvGamma4 && (IS_I915G(pI830) || IS_I915GM(pI830) || IS_I945G(pI830) || IS_I945GM(pI830))) {
       if (!*pI830->overlayOn) {
          pPriv->gamma4 = value;
          if (pPriv->gamma5 - pPriv->gamma4 > 0x7d)
             pPriv->gamma5 = pPriv->gamma4 + 0x7d;
       } else
          return BadRequest;
-   } else if (attribute == xvGamma5 && (IS_I915G(pI830))) {
+   } else if (attribute == xvGamma5 && (IS_I915G(pI830) || IS_I915GM(pI830) || IS_I945G(pI830) || IS_I945GM(pI830))) {
       if (!*pI830->overlayOn) {
          pPriv->gamma5 = value;
          if (pPriv->gamma5 - pPriv->gamma4 > 0x7d)
@@ -828,7 +871,7 @@
         attribute == xvGamma2 ||
         attribute == xvGamma3 ||
         attribute == xvGamma4 ||
-        attribute == xvGamma5) && (IS_I915G(pI830))) {
+        attribute == xvGamma5) && (IS_I915G(pI830) || IS_I915GM(pI830) || IS_I945G(pI830) || IS_I945GM(pI830))) {
 	I830UpdateGamma(pScrn);
    }
 
@@ -846,17 +889,19 @@
       *value = pPriv->brightness;
    } else if (attribute == xvContrast) {
       *value = pPriv->contrast;
-   } else if (attribute == xvGamma0 && (IS_I915G(pI830))) {
+   } else if (pI830->Clone && attribute == xvPipe) {
+      *value = pPriv->pipe;
+   } else if (attribute == xvGamma0 && (IS_I915G(pI830) || IS_I915GM(pI830) || IS_I945G(pI830) || IS_I945GM(pI830))) {
       *value = pPriv->gamma0;
-   } else if (attribute == xvGamma1 && (IS_I915G(pI830))) {
+   } else if (attribute == xvGamma1 && (IS_I915G(pI830) || IS_I915GM(pI830) || IS_I945G(pI830) || IS_I945GM(pI830))) {
       *value = pPriv->gamma1;
-   } else if (attribute == xvGamma2 && (IS_I915G(pI830))) {
+   } else if (attribute == xvGamma2 && (IS_I915G(pI830) || IS_I915GM(pI830) || IS_I945G(pI830) || IS_I945GM(pI830))) {
       *value = pPriv->gamma2;
-   } else if (attribute == xvGamma3 && (IS_I915G(pI830))) {
+   } else if (attribute == xvGamma3 && (IS_I915G(pI830) || IS_I915GM(pI830) || IS_I945G(pI830) || IS_I945GM(pI830))) {
       *value = pPriv->gamma3;
-   } else if (attribute == xvGamma4 && (IS_I915G(pI830))) {
+   } else if (attribute == xvGamma4 && (IS_I915G(pI830) || IS_I915GM(pI830) || IS_I945G(pI830) || IS_I945GM(pI830))) {
       *value = pPriv->gamma4;
-   } else if (attribute == xvGamma5 && (IS_I915G(pI830))) {
+   } else if (attribute == xvGamma5 && (IS_I915G(pI830) || IS_I915GM(pI830) || IS_I945G(pI830) || IS_I945GM(pI830))) {
       *value = pPriv->gamma5;
    } else if (attribute == xvColorKey) {
       *value = pPriv->colorKey;
@@ -912,7 +957,7 @@
 
 static void
 I830CopyPlanarData(ScrnInfoPtr pScrn, unsigned char *buf, int srcPitch,
-		   int dstPitch, int srcH, int top, int left,
+		   int srcPitch2, int dstPitch, int srcH, int top, int left,
 		   int h, int w, int id)
 {
    I830Ptr pI830 = I830PTR(pScrn);
@@ -920,8 +965,8 @@
    int i;
    unsigned char *src1, *src2, *src3, *dst1, *dst2, *dst3;
 
-   DPRINTF(PFX, "I830CopyPlanarData: srcPitch %d, dstPitch %d\n"
-	   "nlines %d, npixels %d, top %d, left %d\n", srcPitch, dstPitch,
+   ErrorF("I830CopyPlanarData: srcPitch %d, srcPitch %d, dstPitch %d\n"
+	   "nlines %d, npixels %d, top %d, left %d\n", srcPitch, srcPitch2, dstPitch,
 	   h, w, top, left);
 
    /* Copy Y data */
@@ -957,12 +1002,12 @@
 
    for (i = 0; i < h / 2; i++) {
       memcpy(dst2, src2, w / 2);
-      src2 += srcPitch >> 1;
+      src2 += srcPitch2;
       dst2 += dstPitch;
    }
 
    /* Copy U data for YV12, or V data for I420 */
-   src3 = buf + (srcH * srcPitch) + ((srcH * srcPitch) >> 2) +
+   src3 = buf + (srcH * srcPitch) + ((srcH >> 1) * srcPitch2) +
 	 ((top * srcPitch) >> 2) + (left >> 1);
    ErrorF("src3 is %p, offset is %d\n", src3,
 	  (unsigned long)src3 - (unsigned long)buf);
@@ -980,7 +1025,7 @@
 
    for (i = 0; i < h / 2; i++) {
       memcpy(dst3, src3, w / 2);
-      src3 += srcPitch >> 1;
+      src3 += srcPitch2;
       dst3 += dstPitch;
    }
 }
@@ -1125,59 +1170,111 @@
    I830OverlayRegPtr overlay =
 	 (I830OverlayRegPtr) (pI830->FbBase + pI830->OverlayMem->Start);
    unsigned int swidth;
+   unsigned int mask, shift, offsety, offsetu;
 
-   DPRINTF(PFX, "I830DisplayVideo: %dx%d (pitch %d)\n", width, height,
+   ErrorF("I830DisplayVideo: %dx%d (pitch %d)\n", width, height,
 	   dstPitch);
 
    if (!pPriv->overlayOK)
       return;
 
+   if (IS_I915G(pI830) || IS_I915GM(pI830)) {
+      shift = 6;
+      mask = 0x3f;
+   } else {
+      shift = 5;
+      mask = 0x1f;
+   }
+
+   if (pPriv->currentBuf == 0) {
+      offsety = pPriv->YBuf0offset;
+      offsetu = pPriv->UBuf0offset;
+   } else {
+      offsety = pPriv->YBuf1offset;
+      offsetu = pPriv->UBuf1offset;
+   }
+
 #if VIDEO_DEBUG
    CompareOverlay(pI830, (CARD32 *) overlay, 0x100);
 #endif
 
    /* When in dual head with different bpp setups we need to refresh the
     * color key, so let's reset the video parameters and refresh here */
-   I830ResetVideo(pScrn);
+#if 0
+   if (pI830->entityPrivate)
+#endif
+      I830ResetVideo(pScrn);
 
    switch (id) {
    case FOURCC_YV12:
    case FOURCC_I420:
-      swidth = (width + 1) & ~1 & 0xfff;
+      swidth = width;
+
       overlay->SWIDTH = swidth;
       swidth /= 2;
       overlay->SWIDTH |= (swidth & 0x7ff) << 16;
 
-      swidth = ((pPriv->YBuf0offset + width + 0x1f) >> 5) -
-	    (pPriv->YBuf0offset >> 5) - 1;
+      swidth = ((offsety + width + mask) >> shift) -
+	    (offsety >> shift);
 
-      ErrorF("Y width is %d, swidthsw is %d\n", width, swidth);
+      if (IS_I915G(pI830) || IS_I915GM(pI830))
+         swidth <<= 1;
+
+      swidth -= 1;
+
+      ErrorF("Y width is %d, swidth is %d\n", width, swidth);
 
       overlay->SWIDTHSW = swidth << 2;
 
-      swidth = ((pPriv->UBuf0offset + (width / 2) + 0x1f) >> 5) -
-	    (pPriv->UBuf0offset >> 5) - 1;
+      swidth = ((offsetu + (width / 2) + mask) >> shift) -
+	    (offsetu >> shift);
+
+      if (IS_I915G(pI830) || IS_I915GM(pI830))
+         swidth <<= 1;
+
+      swidth -= 1;
+
       ErrorF("UV width is %d, swidthsw is %d\n", width / 2, swidth);
 
       overlay->SWIDTHSW |= swidth << 18;
+
+      ErrorF("HEIGHT is %d\n",height);
+
+      overlay->SHEIGHT = height | ((height / 2) << 16);
       break;
    case FOURCC_UYVY:
    case FOURCC_YUY2:
    default:
-      /* XXX Check for i845 */
-
-      swidth = ((width + 31) & ~31) << 1;
+      swidth = width << 1;
       overlay->SWIDTH = swidth;
-      overlay->SWIDTHSW = swidth >> 3;
+
+      ErrorF("Y width is %d\n", swidth);
+
+      swidth = ((offsety + (width << 1) + mask) >> shift) -
+	    (offsety >> shift);
+
+      if (IS_I915G(pI830) || IS_I915GM(pI830))
+         swidth <<= 1;
+
+      swidth -= 1;
+
+      ErrorF("swidthsw is %d\n", swidth);
+
+      overlay->SWIDTHSW = swidth << 2;
+
+      ErrorF("HEIGHT is %d\n",height);
+
+      overlay->SHEIGHT = height;
       break;
    }
 
-   overlay->SHEIGHT = height | ((height / 2) << 16);
-
    if (pPriv->oneLineMode) {
       /* change the coordinates with panel fitting active */
+      /* Should move this to before clip helper */
       dstBox->y1 = (((dstBox->y1 - 1) * pPriv->scaleRatio) >> 16) + 1;
       dstBox->y2 = ((dstBox->y2 * pPriv->scaleRatio) >> 16) + 1;
+ 
+      if (dstBox->y1 < 0) dstBox->y1 = 0;
 
       /* Now, alter the height, so we scale to the correct size */
       drw_h = dstBox->y2 - dstBox->y1;
@@ -1189,6 +1286,9 @@
    overlay->DWINSZ = ((dstBox->y2 - dstBox->y1) << 16) |
 	 (dstBox->x2 - dstBox->x1);
 
+   ErrorF("dstBox: x1: %d, y1: %d, x2: %d, y2: %d\n", dstBox->x1, dstBox->y1,
+			dstBox->x2, dstBox->y2);
+
    /* buffer locations */
    overlay->OBUF_0Y = pPriv->YBuf0offset;
    overlay->OBUF_0U = pPriv->UBuf0offset;
@@ -1252,8 +1352,8 @@
       /*
        * Y down-scale factor as a multiple of 4096.
        */
-      xscaleFract = (src_w << 12) / drw_w;
-      yscaleFract = (src_h << 12) / drw_h;
+      xscaleFract = ((src_w - 1) << 12) / drw_w;
+      yscaleFract = ((src_h - 1) << 12) / drw_h;
 
       /* Calculate the UV scaling factor. */
       xscaleFractUV = xscaleFract / uvratio;
@@ -1273,9 +1373,9 @@
       xscaleIntUV = xscaleFractUV >> 12;
       yscaleIntUV = yscaleFractUV >> 12;
 
-      ErrorF("xscale: 0x%x.%03x, yscale: 0x%x.%03x\n", xscaleInt,
+      ErrorF("xscale: %x.%03x, yscale: %x.%03x\n", xscaleInt,
 	     xscaleFract & 0xFFF, yscaleInt, yscaleFract & 0xFFF);
-      ErrorF("UV xscale: 0x%x.%03x, UV yscale: 0x%x.%03x\n", xscaleIntUV,
+      ErrorF("UV xscale: %x.%03x, UV yscale: %x.%03x\n", xscaleIntUV,
 	     xscaleFractUV & 0xFFF, yscaleIntUV, yscaleFractUV & 0xFFF);
 
       newval = (xscaleInt << 16) |
@@ -1385,13 +1485,9 @@
 {
    ScreenPtr pScreen;
    FBLinearPtr new_linear;
-   int bytespp = pScrn->bitsPerPixel >> 3;
 
    DPRINTF(PFX, "I830AllocateMemory\n");
 
-   /* convert size in bytes into number of pixels */
-   size = (size + bytespp - 1) / bytespp;
-
    if (linear) {
       if (linear->size >= size)
 	 return linear;
@@ -1438,7 +1534,7 @@
    I830PortPrivPtr pPriv = (I830PortPrivPtr) data;
    ScreenPtr pScreen = screenInfo.screens[pScrn->scrnIndex];
    INT32 x1, x2, y1, y2;
-   int srcPitch, dstPitch;
+   int srcPitch, srcPitch2 = 0, dstPitch;
    int top, left, npixels, nlines, size, loops;
    BoxRec dstBox;
 
@@ -1448,7 +1544,7 @@
 
    if (pI830->entityPrivate) {
 	 if (pI830->entityPrivate->XvInUse != -1 &&
-	     pI830->entityPrivate->XvInUse != pI830->pipe) {
+	     pI830->entityPrivate->XvInUse != pPriv->pipe) {
 #ifdef PANORAMIX
 		if (!noPanoramiXExtension) {
 			return Success; /* faked for trying to share it */
@@ -1459,9 +1555,16 @@
 		}
 	 }
 
-      pI830->entityPrivate->XvInUse = pI830->pipe;
+      pI830->entityPrivate->XvInUse = pPriv->pipe;
    }
 
+   /* overlay limits */
+   if(src_w > (drw_w * 7))
+      drw_w = src_w * 7;
+
+   if(src_h > (drw_h * 7))
+      drw_h = src_h * 7;
+
    /* Clip */
    x1 = src_x;
    x2 = src_x + src_w;
@@ -1485,22 +1588,23 @@
    switch (id) {
    case FOURCC_YV12:
    case FOURCC_I420:
-      srcPitch = (width + 3) & ~3;
-      dstPitch = ((width / 2) + 255) & ~255;	/* of chroma */
+      srcPitch = width;
+      srcPitch2 = ((width >> 1) + 3) & ~3;
+      dstPitch = ((width / 2) + 63) & ~63;	/* of chroma */
       size = dstPitch * height * 3;
       break;
    case FOURCC_UYVY:
    case FOURCC_YUY2:
    default:
-      srcPitch = (width << 1);
-      dstPitch = (srcPitch + 255) & ~255;
+      srcPitch = width << 1;
+      dstPitch = (srcPitch + 63) & ~63;	/* of chroma */
       size = dstPitch * height;
       break;
    }
    ErrorF("srcPitch: %d, dstPitch: %d, size: %d\n", srcPitch, dstPitch, size);
 
-   if (!(pPriv->linear = I830AllocateMemory(pScrn, pPriv->linear,
-					    size * 2 / pI830->cpp)))
+   /* size is multiplied by 2 because we have two buffers that are flipping */
+   if (!(pPriv->linear = I830AllocateMemory(pScrn, pPriv->linear, size * 2 / pI830->cpp)))
       return BadAlloc;
 
    /* fixup pointers */
@@ -1549,7 +1653,7 @@
    case FOURCC_I420:
       top &= ~1;
       nlines = ((((y2 + 0xffff) >> 16) + 1) & ~1) - top;
-      I830CopyPlanarData(pScrn, buf, srcPitch, dstPitch, height, top, left,
+      I830CopyPlanarData(pScrn, buf, srcPitch, srcPitch2, dstPitch, height, top, left,
 			 nlines, npixels, id);
       break;
    case FOURCC_UYVY:
@@ -1605,21 +1709,13 @@
    case FOURCC_YV12:
    case FOURCC_I420:
       *h = (*h + 1) & ~1;
-#if 1
       size = (*w + 3) & ~3;
-#else
-      size = (*w + 255) & ~255;
-#endif
       if (pitches)
 	 pitches[0] = size;
       size *= *h;
       if (offsets)
 	 offsets[1] = size;
-#if 1
       tmp = ((*w >> 1) + 3) & ~3;
-#else
-      tmp = ((*w >> 1) + 255) & ~255;
-#endif
       if (pitches)
 	 pitches[1] = pitches[2] = tmp;
       tmp *= (*h >> 1);
@@ -1836,7 +1932,7 @@
 
    if (pI830->entityPrivate) {
 	 if (pI830->entityPrivate->XvInUse != -1 &&
-	     pI830->entityPrivate->XvInUse != pI830->pipe) {
+	     pI830->entityPrivate->XvInUse != pI830Priv->pipe) {
 #ifdef PANORAMIX
 		if (!noPanoramiXExtension) {
 			return Success; /* faked for trying to share it */
@@ -1847,7 +1943,7 @@
 		}
 	 }
 
-      pI830->entityPrivate->XvInUse = pI830->pipe;
+      pI830->entityPrivate->XvInUse = pI830Priv->pipe;
    }
 
    x1 = src_x;
@@ -1978,7 +2074,7 @@
    if (!pPriv)
       return;
 
-   if (pI830->pipe == 0) {
+   if (pPriv->pipe == 0) {
       if (INREG(PIPEACONF) & PIPEACONF_DOUBLE_WIDE) {
          xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
 	   "Disabling XVideo output because Pipe A is in double-wide mode.\n");
@@ -1990,7 +2086,7 @@
       }
    }
 
-   if (pI830->pipe == 1) {
+   if (pPriv->pipe == 1) {
       if (INREG(PIPEBCONF) & PIPEBCONF_DOUBLE_WIDE) {
          xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
 	   "Disabling XVideo output because Pipe B is in double-wide mode.\n");
@@ -2002,12 +2098,13 @@
       }
    }
 
-   /* Check we are on pipe B and have an LFP connected */
-   if ((pI830->pipe == 1) && (pI830->operatingDevices & (PIPE_LFP << 8))) {
-      size = INREG(PIPEBSRC);
+   /* Check we have an LFP connected */
+   if ((pPriv->pipe == 1 && pI830->operatingDevices & (PIPE_LFP << 8)) ||
+       (pPriv->pipe == 0 && pI830->operatingDevices & PIPE_LFP) ) {
+      size = pI830->pipe ? INREG(PIPEBSRC) : INREG(PIPEASRC);
       hsize = (size >> 16) & 0x7FF;
       vsize = size & 0x7FF;
-      active = INREG(VTOTAL_B) & 0x7FF;
+      active = pI830->pipe ? (INREG(VTOTAL_B) & 0x7FF) : (INREG(VTOTAL_A) & 0x7FF);
 
       if (vsize < active && hsize > 1024)
          I830SetOneLineModeRatio(pScrn);
--- xorg-x11-6.8.2/xc/extras/Mesa/src/mesa/drivers/dri/i915/intel_context.c.orig	2004-12-15 04:50:58 +0300
+++ xorg-x11-6.8.2/xc/extras/Mesa/src/mesa/drivers/dri/i915/intel_context.c	2005-07-30 23:13:20 +0400
@@ -96,6 +96,12 @@
 	 chipset = "Intel(R) 865G"; break;
       case PCI_CHIP_I915_G:
 	 chipset = "Intel(R) 915G"; break;
+      case PCI_CHIP_I915_GM:
+         chipset = "Intel(R) 915GM"; break;
+      case PCI_CHIP_I945_G:
+         chipset = "Intel(R) 945G"; break;
+      case PCI_CHIP_I945_GM:
+         chipset = "Intel(R) 945GM"; break;
       default:
 	 chipset = "Unknown Intel Chipset"; break;
       }
--- xorg-x11-6.8.2/xc/extras/Mesa/src/mesa/drivers/dri/i915/intel_screen.c.orig	2004-07-22 10:52:18 +0400
+++ xorg-x11-6.8.2/xc/extras/Mesa/src/mesa/drivers/dri/i915/intel_screen.c	2005-07-30 23:14:59 +0400
@@ -283,6 +283,9 @@
 				sharedContextPrivate );
 
    case PCI_CHIP_I915_G:
+   case PCI_CHIP_I915_GM:
+   case PCI_CHIP_I945_G:
+   case PCI_CHIP_I945_GM:
       return i915CreateContext( mesaVis, driContextPriv, 
 			       sharedContextPrivate );
  
--- xorg-x11-6.8.2/xc/extras/Mesa/src/mesa/drivers/dri/i915/intel_context.h.orig	2004-07-22 11:03:04 +0400
+++ xorg-x11-6.8.2/xc/extras/Mesa/src/mesa/drivers/dri/i915/intel_context.h	2005-07-30 23:10:59 +0400
@@ -406,6 +406,9 @@
 #define PCI_CHIP_I855_GM		0x3582
 #define PCI_CHIP_I865_G			0x2572
 #define PCI_CHIP_I915_G			0x2582
+#define PCI_CHIP_I915_GM		0x2592
+#define PCI_CHIP_I945_G			0x2772
+#define PCI_CHIP_I945_GM			0x27A2
 
 
 /* ================================================================
 
дизайн и разработка: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
текущий майнтейнер: Michael Shigorin