From e81c9a29e6d1c6573892df8601f0361c2b09c659 Mon Sep 17 00:00:00 2001 From: Ben Skeggs Date: Thu, 28 Jun 2007 15:16:35 +1000 Subject: Bail if GlxSetVisualConfigs isn't found. --- src/nv_dri.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/nv_dri.c b/src/nv_dri.c index 857fb42..a489e68 100644 --- a/src/nv_dri.c +++ b/src/nv_dri.c @@ -257,6 +257,19 @@ Bool NVDRIGetVersion(ScrnInfoPtr pScrn) return TRUE; } +Bool NVDRICheckModules(ScrnInfoPtr pScrn) +{ + if (!xf86LoaderCheckSymbol("GlxSetVisualConfigs")) { + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, + "[dri] GlxSetVisualConfigs not found.\n"); + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, + " NVIDIA's glx present, or glx not loaded.\n"); + return FALSE; + } + + return TRUE; +} + Bool NVDRIScreenInit(ScrnInfoPtr pScrn) { DRIInfoPtr pDRIInfo; @@ -267,6 +280,9 @@ Bool NVDRIScreenInit(ScrnInfoPtr pScrn) int drm_page_size; int irq; + if (!NVDRICheckModules(pScrn)) + return FALSE; + drm_page_size = getpagesize(); if (!(pDRIInfo = DRICreateInfoRec())) return FALSE; -- cgit v1.2.1