summaryrefslogtreecommitdiff
path: root/driver/xf86-video-intel/src/legacy/i810/i810_driver.c
diff options
context:
space:
mode:
authorMatthieu Herrb <matthieu@cvs.openbsd.org>2013-02-14 15:15:38 +0000
committerMatthieu Herrb <matthieu@cvs.openbsd.org>2013-02-14 15:15:38 +0000
commitf46d4f6ec184f6cab615a5002956bc3d7152d0f2 (patch)
tree569ffbbf1a42940c0b56d281851c58a1d55f4ebf /driver/xf86-video-intel/src/legacy/i810/i810_driver.c
parent2585b2108c5467bacebeba973beb61d00b1e194b (diff)
Repair the legacy i810 driver. Problem reported and fix
successfully tested by schwarze@
Diffstat (limited to 'driver/xf86-video-intel/src/legacy/i810/i810_driver.c')
-rw-r--r--driver/xf86-video-intel/src/legacy/i810/i810_driver.c35
1 files changed, 33 insertions, 2 deletions
diff --git a/driver/xf86-video-intel/src/legacy/i810/i810_driver.c b/driver/xf86-video-intel/src/legacy/i810/i810_driver.c
index fc6369ee2..5ac646370 100644
--- a/driver/xf86-video-intel/src/legacy/i810/i810_driver.c
+++ b/driver/xf86-video-intel/src/legacy/i810/i810_driver.c
@@ -152,7 +152,7 @@ static int i810_pitches[] = {
static Bool
I810GetRec(ScrnInfoPtr scrn)
{
- if (((uintptr_t)scrn->driverPrivate & 1) == 0)
+ if (scrn->driverPrivate != NULL)
return TRUE;
scrn->driverPrivate = xnfcalloc(sizeof(I810Rec), 1);
@@ -232,6 +232,7 @@ I810DoDDC(ScrnInfoPtr scrn, int index)
static Bool
I810PreInit(ScrnInfoPtr scrn, int flags)
{
+ vgaHWPtr hwp;
I810Ptr pI810;
ClockRangePtr clockRanges;
int i;
@@ -240,6 +241,7 @@ I810PreInit(ScrnInfoPtr scrn, int flags)
rgb defaultWeight = { 0, 0, 0 };
int mem;
Bool enable;
+ struct intel_chipset chipset;
if (scrn->numEntities != 1)
return FALSE;
@@ -267,6 +269,9 @@ I810PreInit(ScrnInfoPtr scrn, int flags)
if (!vgaHWGetHWRec(scrn))
return FALSE;
+ hwp = VGAHWPTR(scrn);
+ vgaHWSetStdFuncs(hwp);
+
pI810->PciInfo = xf86GetPciInfoForEntity(pI810->pEnt->index);
/* Set scrn->monitor */
@@ -364,8 +369,34 @@ I810PreInit(ScrnInfoPtr scrn, int flags)
*/
I810DoDDC(scrn, pI810->pEnt->index);
- intel_detect_chipset(scrn, pI810->pEnt, pI810->PciInfo);
+ intel_detect_chipset(scrn, pI810->PciInfo, &chipset);
+ /*
+ * Set the Chipset and ChipRev, allowing config file entries to
+ * override.
+ */
+ if (pI810->pEnt->device->chipset && *pI810->pEnt->device->chipset) {
+ scrn->chipset = pI810->pEnt->device->chipset;
+ from = X_CONFIG;
+ } else if (pI810->pEnt->device->chipID >= 0) {
+ scrn->chipset = (char *)xf86TokenToString(intel_chipsets,
+ pI810->pEnt->device->chipID);
+ from = X_CONFIG;
+ xf86DrvMsg(scrn->scrnIndex, X_CONFIG, "ChipID override: 0x%04X\n",
+ pI810->pEnt->device->chipID);
+ } else {
+ from = X_PROBED;
+ scrn->chipset = (char *)xf86TokenToString(intel_chipsets,
+ DEVICE_ID(pI810->PciInfo));
+ }
+ if (pI810->pEnt->device->chipRev >= 0) {
+ xf86DrvMsg(scrn->scrnIndex, X_CONFIG, "ChipRev override: %d\n",
+ pI810->pEnt->device->chipRev);
+ }
+
+ xf86DrvMsg(scrn->scrnIndex, from, "Chipset: \"%s\"\n",
+ (scrn->chipset != NULL) ? scrn->chipset : "Unknown i810");
+
pI810->LinearAddr = pI810->PciInfo->regions[0].base_addr;
xf86DrvMsg(scrn->scrnIndex, X_PROBED, "Linear framebuffer at 0x%lX\n",
(unsigned long)pI810->LinearAddr);