X11.spec

pld-linux w tom.gliwice.pl pld-linux w tom.gliwice.pl
Nie, 17 Wrz 2006, 18:44:35 CEST


Witam,

Załączam patch pozwalający driverowi i810 rozpoznać chipset 945GM dość 
popularny w obecnie produkowanym sprzęcie (np. ThinkPady serii R i T).
Jeśli spotka się z zainteresowaniem proszę o wrzucenie.

Pozdrawiam,

-- 
Leszek Zdonek
-------------- następna część ---------
--- X11.spec-orig	2006-09-17 18:28:15.485533250 +0200
+++ X11.spec	2006-09-17 18:33:54.914746250 +0200
@@ -116,6 +116,7 @@
 Patch33:	ftp://ftp.x.org/pub/X11R6.9.0/patches/x11r6.9.0-mitri.diff
 Patch34:	%{name}-intel.patch
 Patch35:	http://xorg.freedesktop.org/releases/X11R6.9.0/patches/x11r6.9.0-cidfonts.diff
+Patch36:	%{name}-i810_945GM.patch
 Patch50:	%{name}-glibc-locale_sync.patch
 Patch60:	%{name}-oldkeyb.patch
 Patch61:	%{name}-sparc64-asmfix.patch
@@ -2090,6 +2091,7 @@
 %patch30 -p0
 %patch31 -p0
 %patch32 -p0
+%patch36 -p0
 %patch50 -p1
 %patch60 -p0
 # FIXME
-------------- następna część ---------
diff -Naur xc.orig/programs/Xserver/hw/xfree86/drivers/i810/common.h xc/programs/Xserver/hw/xfree86/drivers/i810/common.h
--- xc.orig/programs/Xserver/hw/xfree86/drivers/i810/common.h	2006-01-19 03:39:29.000000000 -0800
+++ xc/programs/Xserver/hw/xfree86/drivers/i810/common.h	2006-01-19 03:46:54.000000000 -0800
@@ -322,6 +322,11 @@
 #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)
@@ -335,8 +340,10 @@
 #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_I9XX(pI810) (IS_I915G(pI810) || IS_I915GM(pI810) || IS_I945G(pI810) || IS_I945GM(pI810))
 
-#define IS_MOBILE(pI810) (IS_I830(pI810) || IS_I85X(pI810) || IS_I915GM(pI810))
+#define IS_MOBILE(pI810) (IS_I830(pI810) || IS_I85X(pI810) || IS_I915GM(pI810) || IS_I945GM(pI810))
 
 #define GTT_PAGE_SIZE			KB(4)
 #define ROUND_TO(x, y)			(((x) + (y) - 1) / (y) * (y))
diff -Naur xc.orig/programs/Xserver/hw/xfree86/drivers/i810/i810.man xc/programs/Xserver/hw/xfree86/drivers/i810/i810.man
--- xc.orig/programs/Xserver/hw/xfree86/drivers/i810/i810.man	2006-01-19 03:39:29.000000000 -0800
+++ xc/programs/Xserver/hw/xfree86/drivers/i810/i810.man	2006-01-19 03:56:24.000000000 -0800
@@ -25,7 +25,7 @@
 .SH SUPPORTED HARDWARE
 .B i810
 supports the i810, i810-DC100, i810e, i815, 830M, 845G, 852GM, 855GM,
-865G, 915G and 915GM chipsets.
+865G, 915G, 915GM, 945G and 945GM chipsets.
 
 .SH CONFIGURATION DETAILS
 Please refer to __xconfigfile__(__filemansuffix__) for general configuration
@@ -210,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 and 915GM support added by Alan Hourihane and Keith Whitwell.
+915G, 915GM, 945G and 945GM support added by Alan Hourihane and Keith Whitwell.
 Dual Head, Clone and lid status support added by Alan Hourihane.
diff -Naur xc.orig/programs/Xserver/hw/xfree86/drivers/i810/i810_driver.c xc/programs/Xserver/hw/xfree86/drivers/i810/i810_driver.c
--- xc.orig/programs/Xserver/hw/xfree86/drivers/i810/i810_driver.c	2006-01-19 03:39:29.000000000 -0800
+++ xc/programs/Xserver/hw/xfree86/drivers/i810/i810_driver.c	2006-01-19 03:46:54.000000000 -0800
@@ -136,6 +136,7 @@
    {PCI_CHIP_E7221_G,		"E7221 (i915)"},
    {PCI_CHIP_I915_GM,		"915GM"},
    {PCI_CHIP_I945_G,		"945G"},
+   {PCI_CHIP_I945_GM,		"945GM"},
    {-1,				NULL}
 };
 
@@ -154,6 +155,7 @@
    {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 }
 };
 
@@ -569,6 +571,7 @@
 	    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 xc.orig/programs/Xserver/hw/xfree86/drivers/i810/i830_cursor.c xc/programs/Xserver/hw/xfree86/drivers/i810/i830_cursor.c
--- xc.orig/programs/Xserver/hw/xfree86/drivers/i810/i830_cursor.c	2006-01-19 03:39:29.000000000 -0800
+++ xc/programs/Xserver/hw/xfree86/drivers/i810/i830_cursor.c	2006-01-19 03:46:54.000000000 -0800
@@ -86,7 +86,7 @@
 
    DPRINTF(PFX, "I830InitHWCursor\n");
    /* Initialise the HW cursor registers, leaving the cursor hidden. */
-   if (IS_MOBILE(pI830) || IS_I915G(pI830) || IS_I945G(pI830)) {
+   if (IS_MOBILE(pI830) || IS_I9XX(pI830)) {
       temp = INREG(CURSOR_A_CONTROL);
       temp &= ~(CURSOR_MODE | MCURSOR_GAMMA_ENABLE | MCURSOR_MEM_TYPE_LOCAL |
 		MCURSOR_PIPE_SELECT);
@@ -308,7 +308,7 @@
    }
 
    /* have to upload the base for the new position */
-   if (IS_I915G(pI830) || IS_I915GM(pI830) || IS_I945G(pI830)) {
+   if (IS_I9XX(pI830)) {
       if (pI830->CursorIsARGB)
          OUTREG(CURSOR_A_BASE, pI830->CursorMemARGB->Physical);
       else
@@ -339,7 +339,7 @@
 	   pI830->CursorMemARGB->Physical, pI830->CursorMemARGB->Start);
 
    pI830->cursorOn = TRUE;
-   if (IS_MOBILE(pI830) || IS_I915G(pI830) || IS_I945G(pI830)) {
+   if (IS_MOBILE(pI830) || IS_I9XX(pI830)) {
       temp = INREG(CURSOR_A_CONTROL);
       temp &= ~(CURSOR_MODE | MCURSOR_PIPE_SELECT);
       if (pI830->CursorIsARGB)
@@ -387,7 +387,7 @@
    DPRINTF(PFX, "I830HideCursor\n");
 
    pI830->cursorOn = FALSE;
-   if (IS_MOBILE(pI830) || IS_I915G(pI830) || IS_I945G(pI830)) {
+   if (IS_MOBILE(pI830) || IS_I9XX(pI830)) {
       temp = INREG(CURSOR_A_CONTROL);
       temp &= ~CURSOR_MODE;
       temp |= CURSOR_MODE_DISABLE;
diff -Naur xc.orig/programs/Xserver/hw/xfree86/drivers/i810/i830_driver.c xc/programs/Xserver/hw/xfree86/drivers/i810/i830_driver.c
--- xc.orig/programs/Xserver/hw/xfree86/drivers/i810/i830_driver.c	2006-01-19 03:39:29.000000000 -0800
+++ xc/programs/Xserver/hw/xfree86/drivers/i810/i830_driver.c	2006-01-19 03:46:54.000000000 -0800
@@ -146,6 +146,9 @@
  *
  *    30/2005 Alan Hourihane
  *        - Add Intel(R) 945G support.
+ *
+ *    01/2006 Alan Hourihane & Charles Johnson
+ *        - Add Intel(R) 945GM support.
  */
 
 #ifdef HAVE_CONFIG_H
@@ -196,6 +199,7 @@
    {PCI_CHIP_E7221_G,		"E7221 (i915)"},
    {PCI_CHIP_I915_GM,		"915GM"},
    {PCI_CHIP_I945_G,		"945G"},
+   {PCI_CHIP_I945_GM,		"945GM"},
    {-1,				NULL}
 };
 
@@ -208,6 +212,7 @@
    {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}
 };
 
@@ -1323,7 +1328,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) || IS_I915GM(pI830) || IS_I945G(pI830)) {
+   if (IS_I85X(pI830) || IS_I865G(pI830) || IS_I9XX(pI830)) {
       switch (gmch_ctrl & I830_GMCH_GMS_MASK) {
       case I855_GMCH_GMS_STOLEN_1M:
 	 memsize = MB(1) - KB(range);
@@ -1341,11 +1346,11 @@
 	 memsize = MB(32) - KB(range);
 	 break;
       case I915G_GMCH_GMS_STOLEN_48M:
-	 if (IS_I915G(pI830) || IS_I915GM(pI830) || IS_I945G(pI830))
+	 if (IS_I9XX(pI830))
 	    memsize = MB(48) - KB(range);
 	 break;
       case I915G_GMCH_GMS_STOLEN_64M:
-	 if (IS_I915G(pI830) || IS_I915GM(pI830) || IS_I945G(pI830))
+	 if (IS_I9XX(pI830))
 	    memsize = MB(64) - KB(range);
 	 break;
       }
@@ -2090,6 +2095,9 @@
    case PCI_CHIP_I945_G:
       chipname = "945G";
       break;
+   case PCI_CHIP_I945_GM:
+      chipname = "945GM";
+      break;
    default:
       chipname = "unknown chipset";
       break;
@@ -2127,7 +2135,7 @@
       pI830->LinearAddr = pI830->pEnt->device->MemBase;
       from = X_CONFIG;
    } else {
-      if (IS_I915G(pI830) || IS_I915GM(pI830) || IS_I945G(pI830)) {
+      if (IS_I9XX(pI830)) {
 	 pI830->LinearAddr = pI830->PciInfo->memBase[2] & 0xF0000000;
 	 from = X_PROBED;
       } else if (pI830->PciInfo->memBase[1] != 0) {
@@ -2149,7 +2157,7 @@
       pI830->MMIOAddr = pI830->pEnt->device->IOBase;
       from = X_CONFIG;
    } else {
-      if (IS_I915G(pI830) || IS_I915GM(pI830) || IS_I945G(pI830)) {
+      if (IS_I9XX(pI830)) {
 	 pI830->MMIOAddr = pI830->PciInfo->memBase[0] & 0xFFF80000;
 	 from = X_PROBED;
       } else if (pI830->PciInfo->memBase[1]) {
@@ -2194,7 +2202,7 @@
 	 pI830->FbMapSize = 0x4000000; /* 64MB - has this been tested ?? */
       }
    } else {
-      if (IS_I915G(pI830) || IS_I915GM(pI830) || IS_I945G(pI830)) {
+      if (IS_I9XX(pI830)) {
 	 if (pI830->PciInfo->memBase[2] & 0x08000000)
 	    pI830->FbMapSize = 0x8000000;	/* 128MB aperture */
 	 else
@@ -2227,7 +2235,7 @@
    if (pI830->PciInfo->chipType == PCI_CHIP_E7221_G)
       pI830->availablePipes = 1;
    else
-   if (IS_MOBILE(pI830) || IS_I915G(pI830) || IS_I945G(pI830))
+   if (IS_MOBILE(pI830) || IS_I9XX(pI830))
       pI830->availablePipes = 2;
    else
       pI830->availablePipes = 1;
@@ -2872,7 +2880,7 @@
    }
 
    /* Check if the HW cursor needs physical address. */
-   if (IS_MOBILE(pI830) || IS_I915G(pI830) || IS_I945G(pI830))
+   if (IS_MOBILE(pI830) || IS_I9XX(pI830))
       pI830->CursorNeedsPhysical = TRUE;
    else
       pI830->CursorNeedsPhysical = FALSE;
diff -Naur xc.orig/programs/Xserver/hw/xfree86/drivers/i810/i830_memory.c xc/programs/Xserver/hw/xfree86/drivers/i810/i830_memory.c
--- xc.orig/programs/Xserver/hw/xfree86/drivers/i810/i830_memory.c	2006-01-19 03:39:29.000000000 -0800
+++ xc/programs/Xserver/hw/xfree86/drivers/i810/i830_memory.c	2006-01-19 03:46:54.000000000 -0800
@@ -1239,7 +1239,7 @@
 
    i830Reg->Fence[nr] = 0;
 
-   if (IS_I915G(pI830) || IS_I915GM(pI830) || IS_I945G(pI830))
+   if (IS_I9XX(pI830))
    	fence_mask = ~I915G_FENCE_START_MASK;
    else
    	fence_mask = ~I830_FENCE_START_MASK;
@@ -1247,7 +1247,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) || IS_I915GM(pI830) || IS_I945G(pI830)) ? "1MB" : "512k");
+		 nr, start, (IS_I9XX(pI830)) ? "1MB" : "512k");
       return;
    }
 
@@ -1267,7 +1267,7 @@
 
    val = (start | FENCE_X_MAJOR | FENCE_VALID);
 
-   if (IS_I915G(pI830) || IS_I915GM(pI830) || IS_I945G(pI830)) {
+   if (IS_I9XX(pI830)) {
    	switch (size) {
 	   case MB(1):
       		val |= I915G_FENCE_SIZE_1M;
@@ -1328,7 +1328,7 @@
    	}
    }
 
-   if (IS_I915G(pI830) || IS_I915GM(pI830) || IS_I945G(pI830))
+   if (IS_I9XX(pI830))
 	fence_pitch = pitch / 512;
    else
 	fence_pitch = pitch / 128;
diff -Naur xc.orig/programs/Xserver/hw/xfree86/drivers/i810/i830_video.c xc/programs/Xserver/hw/xfree86/drivers/i810/i830_video.c
--- xc.orig/programs/Xserver/hw/xfree86/drivers/i810/i830_video.c	2006-01-19 03:39:29.000000000 -0800
+++ xc/programs/Xserver/hw/xfree86/drivers/i810/i830_video.c	2006-01-19 03:46:54.000000000 -0800
@@ -617,7 +617,7 @@
    adapt->nAttributes = NUM_ATTRIBUTES;
    if (pI830->Clone)
       adapt->nAttributes += CLONE_ATTRIBUTES;
-   if (IS_I915G(pI830) || IS_I915GM(pI830) || IS_I945G(pI830))
+   if (IS_I9XX(pI830))
       adapt->nAttributes += GAMMA_ATTRIBUTES; /* has gamma */
    adapt->pAttributes = xnfalloc(sizeof(XF86AttributeRec) * adapt->nAttributes);
    /* Now copy the attributes */
@@ -628,7 +628,7 @@
       memcpy((char*)att, (char*)CloneAttributes, sizeof(XF86AttributeRec) * CLONE_ATTRIBUTES);
       att+=CLONE_ATTRIBUTES;
    }
-   if (IS_I915G(pI830) || IS_I915GM(pI830) || IS_I945G(pI830)) {
+   if (IS_I9XX(pI830)) {
       memcpy((char*)att, (char*)GammaAttributes, sizeof(XF86AttributeRec) * GAMMA_ATTRIBUTES);
       att+=GAMMA_ATTRIBUTES;
    }
@@ -688,7 +688,7 @@
    if (pI830->Clone)
      xvPipe = MAKE_ATOM("XV_PIPE");
 
-   if (IS_I915G(pI830) || IS_I915GM(pI830) || IS_I945G(pI830)) {
+   if (IS_I9XX(pI830)) {
      xvGamma0 = MAKE_ATOM("XV_GAMMA0");
      xvGamma1 = MAKE_ATOM("XV_GAMMA1");
      xvGamma2 = MAKE_ATOM("XV_GAMMA2");
@@ -806,7 +806,7 @@
          overlay->OCONFIG |= OVERLAY_PIPE_B;
       if (pPriv->overlayOK)
          OVERLAY_UPDATE;
-   } else if (attribute == xvGamma0 && (IS_I915G(pI830) || IS_I915GM(pI830) || IS_I945G(pI830))) {
+   } else if (attribute == xvGamma0 && (IS_I9XX(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) {
@@ -815,35 +815,35 @@
 	   pPriv->gamma1 = pPriv->gamma0 + 0x7d;
       } else
          return BadRequest;
-   } else if (attribute == xvGamma1 && (IS_I915G(pI830) || IS_I915GM(pI830) || IS_I945G(pI830))) {
+   } else if (attribute == xvGamma1 && (IS_I9XX(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) || IS_I915GM(pI830) || IS_I945G(pI830))) {
+   } else if (attribute == xvGamma2 && (IS_I9XX(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) || IS_I915GM(pI830) || IS_I945G(pI830))) {
+   } else if (attribute == xvGamma3 && (IS_I9XX(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) || IS_I915GM(pI830) || IS_I945G(pI830))) {
+   } else if (attribute == xvGamma4 && (IS_I9XX(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) || IS_I915GM(pI830) || IS_I945G(pI830))) {
+   } else if (attribute == xvGamma5 && (IS_I9XX(pI830))) {
       if (!*pI830->overlayOn) {
          pPriv->gamma5 = value;
          if (pPriv->gamma5 - pPriv->gamma4 > 0x7d)
@@ -875,7 +875,7 @@
         attribute == xvGamma2 ||
         attribute == xvGamma3 ||
         attribute == xvGamma4 ||
-        attribute == xvGamma5) && (IS_I915G(pI830) || IS_I915GM(pI830) || IS_I945G(pI830))) {
+        attribute == xvGamma5) && (IS_I9XX(pI830))) {
 	I830UpdateGamma(pScrn);
    }
 
@@ -895,17 +895,17 @@
       *value = pPriv->contrast;
    } else if (pI830->Clone && attribute == xvPipe) {
       *value = pPriv->pipe;
-   } else if (attribute == xvGamma0 && (IS_I915G(pI830) || IS_I915GM(pI830) || IS_I945G(pI830))) {
+   } else if (attribute == xvGamma0 && (IS_I9XX(pI830))) {
       *value = pPriv->gamma0;
-   } else if (attribute == xvGamma1 && (IS_I915G(pI830) || IS_I915GM(pI830) || IS_I945G(pI830))) {
+   } else if (attribute == xvGamma1 && (IS_I9XX(pI830))) {
       *value = pPriv->gamma1;
-   } else if (attribute == xvGamma2 && (IS_I915G(pI830) || IS_I915GM(pI830) || IS_I945G(pI830))) {
+   } else if (attribute == xvGamma2 && (IS_I9XX(pI830))) {
       *value = pPriv->gamma2;
-   } else if (attribute == xvGamma3 && (IS_I915G(pI830) || IS_I915GM(pI830) || IS_I945G(pI830))) {
+   } else if (attribute == xvGamma3 && (IS_I9XX(pI830))) {
       *value = pPriv->gamma3;
-   } else if (attribute == xvGamma4 && (IS_I915G(pI830) || IS_I915GM(pI830) || IS_I945G(pI830))) {
+   } else if (attribute == xvGamma4 && (IS_I9XX(pI830))) {
       *value = pPriv->gamma4;
-   } else if (attribute == xvGamma5 && (IS_I915G(pI830) || IS_I915GM(pI830) || IS_I945G(pI830))) {
+   } else if (attribute == xvGamma5 && (IS_I9XX(pI830))) {
       *value = pPriv->gamma5;
    } else if (attribute == xvColorKey) {
       *value = pPriv->colorKey;


Więcej informacji o liście dyskusyjnej pld-devel-pl