From a103496e08f699b609be875827ecf1f3afa45e68 Mon Sep 17 00:00:00 2001 From: Alan Hourihane Date: Tue, 1 Feb 2005 19:47:32 +0000 Subject: [PATCH] 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. --- src/i830_dri.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/i830_dri.c b/src/i830_dri.c index 034b0960..01f02513 100644 --- a/src/i830_dri.c +++ b/src/i830_dri.c @@ -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) {