From 9d47c99aae3925b16812e5455f667c44cd88ef5b Mon Sep 17 00:00:00 2001 From: Francisco Jerez Date: Thu, 11 Dec 2008 16:21:17 +0100 Subject: [PATCH] Fall back to UseBIOS off when VBEInit fails. --- src/smi_driver.c | 17 ++++++++++++----- 1 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/smi_driver.c b/src/smi_driver.c index e251448..4e0cf87 100644 --- a/src/smi_driver.c +++ b/src/smi_driver.c @@ -715,6 +715,11 @@ SMI_PreInit(ScrnInfoPtr pScrn, int flags) xf86LoaderReqSymLists(vbeSymbols, NULL); pSmi->pVbe = VBEInit(pSmi->pInt10, pEnt->index); } + + if(!pSmi->pVbe){ + xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "VBE initialization failed: falling back to UseBIOS disabled.\n"); + pSmi->useBIOS = FALSE; + } } xf86RegisterResources(pEnt->index, NULL, ResExclusive); @@ -932,9 +937,11 @@ SMI_PreInit(ScrnInfoPtr pScrn, int flags) SMI_EnableVideo(pScrn); SMI_UnmapMem(pScrn); - if(pSmi->useBIOS){ + if(pSmi->pVbe){ vbeFree(pSmi->pVbe); pSmi->pVbe = NULL; + } + if(pSmi->pInt10){ xf86FreeInt10(pSmi->pInt10); pSmi->pInt10 = NULL; } @@ -1816,14 +1823,14 @@ SMI_CloseScreen(int scrnIndex, ScreenPtr pScreen) exaDriverFini(pScreen); pSmi->EXADriverPtr = NULL; } - if (pSmi->pInt10 != NULL) { - xf86FreeInt10(pSmi->pInt10); - pSmi->pInt10 = NULL; - } if (pSmi->pVbe != NULL) { vbeFree(pSmi->pVbe); pSmi->pVbe = NULL; } + if (pSmi->pInt10 != NULL) { + xf86FreeInt10(pSmi->pInt10); + pSmi->pInt10 = NULL; + } if (pSmi->ptrAdaptor != NULL) { xfree(pSmi->ptrAdaptor); } -- 1.5.6.5