summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/common.h6
-rw-r--r--src/i810_driver.c3
-rw-r--r--src/i830_cursor.c8
-rw-r--r--src/i830_driver.c29
-rw-r--r--src/i830_memory.c8
-rw-r--r--src/i830_video.c32
6 files changed, 50 insertions, 36 deletions
diff --git a/src/common.h b/src/common.h
index 0d901f95..85a24ab3 100644
--- a/src/common.h
+++ b/src/common.h
@@ -317,6 +317,11 @@ extern int I810_DEBUG;
#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
+
#define IS_I810(pI810) (pI810->PciInfo->chipType == PCI_CHIP_I810 || \
pI810->PciInfo->chipType == PCI_CHIP_I810_DC100 || \
pI810->PciInfo->chipType == PCI_CHIP_I810_E)
@@ -329,6 +334,7 @@ extern int I810_DEBUG;
#define IS_I865G(pI810) (pI810->PciInfo->chipType == PCI_CHIP_I865_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_MOBILE(pI810) (IS_I830(pI810) || IS_I85X(pI810) || IS_I915GM(pI810))
diff --git a/src/i810_driver.c b/src/i810_driver.c
index 98c26581..28f607d3 100644
--- a/src/i810_driver.c
+++ b/src/i810_driver.c
@@ -131,6 +131,7 @@ static SymTabRec I810Chipsets[] = {
{PCI_CHIP_I915_G, "915G"},
{PCI_CHIP_E7221_G, "E7221 (i915)"},
{PCI_CHIP_I915_GM, "915GM"},
+ {PCI_CHIP_I945_G, "945G"},
{-1, NULL}
};
@@ -148,6 +149,7 @@ static PciChipsets I810PciChipsets[] = {
{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},
{-1, -1, RES_UNDEFINED }
};
@@ -566,6 +568,7 @@ I810Probe(DriverPtr drv, int flags)
case PCI_CHIP_I915_G:
case PCI_CHIP_E7221_G:
case PCI_CHIP_I915_GM:
+ case PCI_CHIP_I945_G:
xf86SetEntitySharable(usedChips[i]);
/* Allocate an entity private if necessary */
diff --git a/src/i830_cursor.c b/src/i830_cursor.c
index 367aaf45..0603f40a 100644
--- a/src/i830_cursor.c
+++ b/src/i830_cursor.c
@@ -82,7 +82,7 @@ I830InitHWCursor(ScrnInfoPtr pScrn)
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)) {
temp = INREG(CURSOR_A_CONTROL);
temp &= ~(CURSOR_MODE | MCURSOR_GAMMA_ENABLE | MCURSOR_MEM_TYPE_LOCAL |
MCURSOR_PIPE_SELECT);
@@ -304,7 +304,7 @@ I830SetCursorPosition(ScrnInfoPtr pScrn, int x, int y)
}
/* have to upload the base for the new position */
- if (IS_I915G(pI830) || IS_I915GM(pI830)) {
+ if (IS_I915G(pI830) || IS_I915GM(pI830) || IS_I945G(pI830)) {
if (pI830->CursorIsARGB)
OUTREG(CURSOR_A_BASE, pI830->CursorMemARGB->Physical);
else
@@ -335,7 +335,7 @@ I830ShowCursor(ScrnInfoPtr pScrn)
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)) {
temp = INREG(CURSOR_A_CONTROL);
temp &= ~(CURSOR_MODE | MCURSOR_PIPE_SELECT);
if (pI830->CursorIsARGB)
@@ -383,7 +383,7 @@ I830HideCursor(ScrnInfoPtr pScrn)
DPRINTF(PFX, "I830HideCursor\n");
pI830->cursorOn = FALSE;
- if (IS_MOBILE(pI830) || IS_I915G(pI830)) {
+ if (IS_MOBILE(pI830) || IS_I915G(pI830) || IS_I945G(pI830)) {
temp = INREG(CURSOR_A_CONTROL);
temp &= ~CURSOR_MODE;
temp |= CURSOR_MODE_DISABLE;
diff --git a/src/i830_driver.c b/src/i830_driver.c
index 66a919fc..654dc196 100644
--- a/src/i830_driver.c
+++ b/src/i830_driver.c
@@ -143,6 +143,9 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
* - 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
@@ -188,6 +191,7 @@ static SymTabRec I830BIOSChipsets[] = {
{PCI_CHIP_I915_G, "915G"},
{PCI_CHIP_E7221_G, "E7221 (i915)"},
{PCI_CHIP_I915_GM, "915GM"},
+ {PCI_CHIP_I945_G, "945G"},
{-1, NULL}
};
@@ -199,6 +203,7 @@ static PciChipsets I830BIOSPciChipsets[] = {
{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},
{-1, -1, RES_UNDEFINED}
};
@@ -1314,7 +1319,7 @@ I830DetectMemory(ScrnInfoPtr pScrn)
* 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)) {
+ if (IS_I85X(pI830) || IS_I865G(pI830) || IS_I915G(pI830) || IS_I915GM(pI830) || IS_I945G(pI830)) {
switch (gmch_ctrl & I830_GMCH_GMS_MASK) {
case I855_GMCH_GMS_STOLEN_1M:
memsize = MB(1) - KB(range);
@@ -1332,11 +1337,11 @@ I830DetectMemory(ScrnInfoPtr pScrn)
memsize = MB(32) - KB(range);
break;
case I915G_GMCH_GMS_STOLEN_48M:
- if (IS_I915G(pI830) || IS_I915GM(pI830))
+ if (IS_I915G(pI830) || IS_I915GM(pI830) || IS_I945G(pI830))
memsize = MB(48) - KB(range);
break;
case I915G_GMCH_GMS_STOLEN_64M:
- if (IS_I915G(pI830) || IS_I915GM(pI830))
+ if (IS_I915G(pI830) || IS_I915GM(pI830) || IS_I945G(pI830))
memsize = MB(64) - KB(range);
break;
}
@@ -2077,6 +2082,9 @@ I830BIOSPreInit(ScrnInfoPtr pScrn, int flags)
case PCI_CHIP_I915_GM:
chipname = "915GM";
break;
+ case PCI_CHIP_I945_G:
+ chipname = "945G";
+ break;
default:
chipname = "unknown chipset";
break;
@@ -2114,7 +2122,7 @@ I830BIOSPreInit(ScrnInfoPtr pScrn, int flags)
pI830->LinearAddr = pI830->pEnt->device->MemBase;
from = X_CONFIG;
} else {
- if (IS_I915G(pI830) || IS_I915GM(pI830)) {
+ if (IS_I915G(pI830) || IS_I915GM(pI830) || IS_I945G(pI830)) {
pI830->LinearAddr = pI830->PciInfo->memBase[2] & 0xF0000000;
from = X_PROBED;
} else if (pI830->PciInfo->memBase[1] != 0) {
@@ -2136,7 +2144,7 @@ I830BIOSPreInit(ScrnInfoPtr pScrn, int flags)
pI830->MMIOAddr = pI830->pEnt->device->IOBase;
from = X_CONFIG;
} else {
- if (IS_I915G(pI830) || IS_I915GM(pI830)) {
+ if (IS_I915G(pI830) || IS_I915GM(pI830) || IS_I945G(pI830)) {
pI830->MMIOAddr = pI830->PciInfo->memBase[0] & 0xFFF80000;
from = X_PROBED;
} else if (pI830->PciInfo->memBase[1]) {
@@ -2181,7 +2189,7 @@ I830BIOSPreInit(ScrnInfoPtr pScrn, int flags)
pI830->FbMapSize = 0x4000000; /* 64MB - has this been tested ?? */
}
} else {
- if (IS_I915G(pI830) || IS_I915GM(pI830)) {
+ if (IS_I915G(pI830) || IS_I915GM(pI830) || IS_I945G(pI830)) {
if (pI830->PciInfo->memBase[2] & 0x08000000)
pI830->FbMapSize = 0x8000000; /* 128MB aperture */
else
@@ -2853,16 +2861,13 @@ I830BIOSPreInit(ScrnInfoPtr pScrn, int flags)
}
/* 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))
pI830->CursorNeedsPhysical = TRUE;
else
pI830->CursorNeedsPhysical = FALSE;
- /* Force ring buffer to be in low memory for the 845G and later. */
-#if 0
- if (IS_845G(pI830) || IS_I85X(pI830) || IS_I865G(pI830) || IS_I915G(pI830) || IS_I915GM(pI830))
-#endif
- 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 --git a/src/i830_memory.c b/src/i830_memory.c
index 301c55b6..e8f04258 100644
--- a/src/i830_memory.c
+++ b/src/i830_memory.c
@@ -1235,7 +1235,7 @@ SetFence(ScrnInfoPtr pScrn, int nr, unsigned int start, unsigned int pitch,
i830Reg->Fence[nr] = 0;
- if (IS_I915G(pI830) || IS_I915GM(pI830))
+ if (IS_I915G(pI830) || IS_I915GM(pI830) || IS_I945G(pI830))
fence_mask = ~I915G_FENCE_START_MASK;
else
fence_mask = ~I830_FENCE_START_MASK;
@@ -1243,7 +1243,7 @@ SetFence(ScrnInfoPtr pScrn, int nr, unsigned int start, unsigned int pitch,
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)) ? "1MB" : "512k");
+ nr, start, (IS_I915G(pI830) || IS_I915GM(pI830) || IS_I945G(pI830)) ? "1MB" : "512k");
return;
}
@@ -1263,7 +1263,7 @@ SetFence(ScrnInfoPtr pScrn, int nr, unsigned int start, unsigned int pitch,
val = (start | FENCE_X_MAJOR | FENCE_VALID);
- if (IS_I915G(pI830) || IS_I915GM(pI830)) {
+ if (IS_I915G(pI830) || IS_I915GM(pI830) || IS_I945G(pI830)) {
switch (size) {
case MB(1):
val |= I915G_FENCE_SIZE_1M;
@@ -1324,7 +1324,7 @@ SetFence(ScrnInfoPtr pScrn, int nr, unsigned int start, unsigned int pitch,
}
}
- if (IS_I915G(pI830) || IS_I915GM(pI830))
+ if (IS_I915G(pI830) || IS_I915GM(pI830) || IS_I945G(pI830))
fence_pitch = pitch / 512;
else
fence_pitch = pitch / 128;
diff --git a/src/i830_video.c b/src/i830_video.c
index a53e27dc..7123b4f2 100644
--- a/src/i830_video.c
+++ b/src/i830_video.c
@@ -613,7 +613,7 @@ I830SetupImageVideo(ScreenPtr pScreen)
adapt->nAttributes = NUM_ATTRIBUTES;
if (pI830->Clone)
adapt->nAttributes += CLONE_ATTRIBUTES;
- if (IS_I915G(pI830) || IS_I915GM(pI830))
+ if (IS_I915G(pI830) || IS_I915GM(pI830) || IS_I945G(pI830))
adapt->nAttributes += GAMMA_ATTRIBUTES; /* has gamma */
adapt->pAttributes = xnfalloc(sizeof(XF86AttributeRec) * adapt->nAttributes);
/* Now copy the attributes */
@@ -624,7 +624,7 @@ I830SetupImageVideo(ScreenPtr pScreen)
memcpy((char*)att, (char*)CloneAttributes, sizeof(XF86AttributeRec) * CLONE_ATTRIBUTES);
att+=CLONE_ATTRIBUTES;
}
- if (IS_I915G(pI830) || IS_I915GM(pI830)) {
+ if (IS_I915G(pI830) || IS_I915GM(pI830) || IS_I945G(pI830)) {
memcpy((char*)att, (char*)GammaAttributes, sizeof(XF86AttributeRec) * GAMMA_ATTRIBUTES);
att+=GAMMA_ATTRIBUTES;
}
@@ -684,7 +684,7 @@ I830SetupImageVideo(ScreenPtr pScreen)
if (pI830->Clone)
xvPipe = MAKE_ATOM("XV_PIPE");
- if (IS_I915G(pI830) || IS_I915GM(pI830)) {
+ if (IS_I915G(pI830) || IS_I915GM(pI830) || IS_I945G(pI830)) {
xvGamma0 = MAKE_ATOM("XV_GAMMA0");
xvGamma1 = MAKE_ATOM("XV_GAMMA1");
xvGamma2 = MAKE_ATOM("XV_GAMMA2");
@@ -802,7 +802,7 @@ I830SetPortAttribute(ScrnInfoPtr pScrn,
overlay->OCONFIG |= OVERLAY_PIPE_B;
if (pPriv->overlayOK)
OVERLAY_UPDATE;
- } else if (attribute == xvGamma0 && (IS_I915G(pI830) || IS_I915GM(pI830))) {
+ } else if (attribute == xvGamma0 && (IS_I915G(pI830) || IS_I915GM(pI830) || IS_I945G(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) {
@@ -811,35 +811,35 @@ I830SetPortAttribute(ScrnInfoPtr pScrn,
pPriv->gamma1 = pPriv->gamma0 + 0x7d;
} else
return BadRequest;
- } else if (attribute == xvGamma1 && (IS_I915G(pI830) || IS_I915GM(pI830))) {
+ } else if (attribute == xvGamma1 && (IS_I915G(pI830) || IS_I915GM(pI830) || IS_I945G(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))) {
+ } else if (attribute == xvGamma2 && (IS_I915G(pI830) || IS_I915GM(pI830) || IS_I945G(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))) {
+ } else if (attribute == xvGamma3 && (IS_I915G(pI830) || IS_I915GM(pI830) || IS_I945G(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))) {
+ } else if (attribute == xvGamma4 && (IS_I915G(pI830) || IS_I915GM(pI830) || IS_I945G(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))) {
+ } else if (attribute == xvGamma5 && (IS_I915G(pI830) || IS_I915GM(pI830) || IS_I945G(pI830))) {
if (!*pI830->overlayOn) {
pPriv->gamma5 = value;
if (pPriv->gamma5 - pPriv->gamma4 > 0x7d)
@@ -871,7 +871,7 @@ I830SetPortAttribute(ScrnInfoPtr pScrn,
attribute == xvGamma2 ||
attribute == xvGamma3 ||
attribute == xvGamma4 ||
- attribute == xvGamma5) && (IS_I915G(pI830) || IS_I915GM(pI830))) {
+ attribute == xvGamma5) && (IS_I915G(pI830) || IS_I915GM(pI830) || IS_I945G(pI830))) {
I830UpdateGamma(pScrn);
}
@@ -891,17 +891,17 @@ I830GetPortAttribute(ScrnInfoPtr pScrn,
*value = pPriv->contrast;
} else if (pI830->Clone && attribute == xvPipe) {
*value = pPriv->pipe;
- } else if (attribute == xvGamma0 && (IS_I915G(pI830) || IS_I915GM(pI830))) {
+ } else if (attribute == xvGamma0 && (IS_I915G(pI830) || IS_I915GM(pI830) || IS_I945G(pI830))) {
*value = pPriv->gamma0;
- } else if (attribute == xvGamma1 && (IS_I915G(pI830) || IS_I915GM(pI830))) {
+ } else if (attribute == xvGamma1 && (IS_I915G(pI830) || IS_I915GM(pI830) || IS_I945G(pI830))) {
*value = pPriv->gamma1;
- } else if (attribute == xvGamma2 && (IS_I915G(pI830) || IS_I915GM(pI830))) {
+ } else if (attribute == xvGamma2 && (IS_I915G(pI830) || IS_I915GM(pI830) || IS_I945G(pI830))) {
*value = pPriv->gamma2;
- } else if (attribute == xvGamma3 && (IS_I915G(pI830) || IS_I915GM(pI830))) {
+ } else if (attribute == xvGamma3 && (IS_I915G(pI830) || IS_I915GM(pI830) || IS_I945G(pI830))) {
*value = pPriv->gamma3;
- } else if (attribute == xvGamma4 && (IS_I915G(pI830) || IS_I915GM(pI830))) {
+ } else if (attribute == xvGamma4 && (IS_I915G(pI830) || IS_I915GM(pI830) || IS_I945G(pI830))) {
*value = pPriv->gamma4;
- } else if (attribute == xvGamma5 && (IS_I915G(pI830) || IS_I915GM(pI830))) {
+ } else if (attribute == xvGamma5 && (IS_I915G(pI830) || IS_I915GM(pI830) || IS_I945G(pI830))) {
*value = pPriv->gamma5;
} else if (attribute == xvColorKey) {
*value = pPriv->colorKey;