Check return value of i830InitDma() and fail to initialize the DRI

if that fails.
Also, check the DRM module name that it matches i915 and not the
older i830 driver which some people were still trying to use
and was causing Dma Initialization failures and lockups.
This commit is contained in:
Alan Hourihane
2005-02-01 19:47:32 +00:00
parent 7ff7cec922
commit a103496e08

View File

@@ -586,6 +586,13 @@ I830DRIScreenInit(ScreenPtr pScreen)
drmFreeVersion(version);
return FALSE;
}
if (strncmp(version->name, I830KernelDriverName, strlen(I830KernelDriverName))) {
xf86DrvMsg(pScreen->myNum, X_WARNING,
"i830 Kernel module detected, Use the i915 Kernel module instead, aborting DRI init.\n");
I830DRICloseScreen(pScreen);
drmFreeVersion(version);
return FALSE;
}
if (version->version_minor < 2)
xf86DrvMsg(pScreen->myNum, X_WARNING,
"Resume functionality not available with DRM < 1.2\n");
@@ -593,6 +600,7 @@ I830DRIScreenInit(ScreenPtr pScreen)
drmFreeVersion(version);
}
}
return TRUE;
}
@@ -676,7 +684,10 @@ I830DRIDoMappings(ScreenPtr pScreen)
xf86DrvMsg(pScreen->myNum, X_INFO, "[drm] textures = 0x%08lx\n",
pI830DRI->textures);
I830InitDma(pScrn);
if (!I830InitDma(pScrn)) {
DRICloseScreen(pScreen);
return FALSE;
}
if (pI830->PciInfo->chipType != PCI_CHIP_845_G &&
pI830->PciInfo->chipType != PCI_CHIP_I830_M) {