From c3edb8efeac95e07e21a2111c6c203550ee16e52 Mon Sep 17 00:00:00 2001 From: Emil Velikov Date: Mon, 17 Jul 2017 12:13:10 +0100 Subject: xf86-video-via: remove the GlxSetVisualConfigs stubs and friends The function was an empty since 2008 at least. Remove it alongside the unused GLX visuals code. With this all the GL/GLX dependencies in the driver are gone. Note: the driver currently does not build if XAA is missing Signed-off-by: Emil Velikov --- Analogous to the radeonhd one - patch is for posterity. Feel free to pick or ignore. --- src/via_dri.c | 248 +------------------------------------------------------ src/via_dri.h | 4 - src/via_driver.c | 1 - src/via_driver.h | 4 - 4 files changed, 1 insertion(+), 256 deletions(-) diff --git a/src/via_dri.c b/src/via_dri.c index 98956bc..c19b65d 100644 --- a/src/via_dri.c +++ b/src/via_dri.c @@ -34,7 +34,6 @@ #include "xf86Pci.h" #define _XF86DRI_SERVER_ -#include "GL/glxtokens.h" #include "sarea.h" #include "via.h" @@ -60,12 +59,6 @@ #define VIA_AGP_1X_MODE 0x01 #define VIA_AGP_FW_MODE 0x10 -extern void GlxSetVisualConfigs( - int nconfigs, - __GLXvisualConfig *configs, - void **configprivs -); - typedef struct { int major; int minor; @@ -79,7 +72,6 @@ static const ViaDRMVersion drmCompat = {2, 0, 0}; int test_alloc_FB(ScreenPtr pScreen, VIAPtr pVia, int Size); int test_alloc_AGP(ScreenPtr pScreen, VIAPtr pVia, int Size); -static Bool VIAInitVisualConfigs(ScreenPtr pScreen); static Bool VIADRIAgpInit(ScreenPtr pScreen, VIAPtr pVia); static Bool VIADRIPciInit(ScreenPtr pScreen, VIAPtr pVia); static Bool VIADRIFBInit(ScreenPtr pScreen, VIAPtr pVia); @@ -395,230 +387,6 @@ static Bool VIADRIPciInit(ScreenPtr pScreen, VIAPtr pVia) return TRUE; } -static Bool -VIAInitVisualConfigs(ScreenPtr pScreen) -{ - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; - VIAPtr pVia = VIAPTR(pScrn); - int numConfigs = 0; - __GLXvisualConfig *pConfigs = 0; - VIAConfigPrivPtr pVIAConfigs = 0; - VIAConfigPrivPtr *pVIAConfigPtrs = 0; - int i, db, stencil, accum; - - switch (pScrn->bitsPerPixel) { - case 8: - case 24: - break; - case 16: - numConfigs = 12; - if (!(pConfigs = (__GLXvisualConfig*)xcalloc(sizeof(__GLXvisualConfig), - numConfigs))) - return FALSE; - if (!(pVIAConfigs = (VIAConfigPrivPtr)xcalloc(sizeof(VIAConfigPrivRec), - numConfigs))) { - xfree(pConfigs); - return FALSE; - } - if (!(pVIAConfigPtrs = (VIAConfigPrivPtr*)xcalloc(sizeof(VIAConfigPrivPtr), - numConfigs))) { - xfree(pConfigs); - xfree(pVIAConfigs); - return FALSE; - } - for (i=0; iscrnIndex, X_ERROR, - "[dri] Incorrect initialization of visuals. Disabling DRI.\n"); - return FALSE; - } - break; - - case 32: - numConfigs = 12; - if (!(pConfigs = (__GLXvisualConfig*)xcalloc(sizeof(__GLXvisualConfig), - numConfigs))) - return FALSE; - if (!(pVIAConfigs = (VIAConfigPrivPtr)xcalloc(sizeof(VIAConfigPrivRec), - numConfigs))) { - xfree(pConfigs); - return FALSE; - } - if (!(pVIAConfigPtrs = (VIAConfigPrivPtr*)xcalloc(sizeof(VIAConfigPrivPtr), - numConfigs))) { - xfree(pConfigs); - xfree(pVIAConfigs); - return FALSE; - } - for (i=0; iscrnIndex, X_ERROR, - "[dri] Incorrect initialization of visuals. Disabling DRI.\n"); - return FALSE; - } - - break; - } - - pVia->numVisualConfigs = numConfigs; - pVia->pVisualConfigs = pConfigs; - pVia->pVisualConfigsPriv = pVIAConfigs; - GlxSetVisualConfigs(numConfigs, pConfigs, (void**)pVIAConfigPtrs); - - return TRUE; -} - Bool VIADRIScreenInit(ScreenPtr pScreen) { ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; @@ -630,9 +398,8 @@ Bool VIADRIScreenInit(ScreenPtr pScreen) /* if symbols or version check fails, we still want this to be NULL */ pVia->pDRIInfo = NULL; - /* Check that the GLX, DRI, and DRM modules have been loaded by testing + /* Check that the DRI, and DRM modules have been loaded by testing * for canonical symbols in each module. */ - if (!xf86LoaderCheckSymbol("GlxSetVisualConfigs")) return FALSE; if (!xf86LoaderCheckSymbol("drmAvailable")) return FALSE; if (!xf86LoaderCheckSymbol("DRIQueryVersion")) { xf86DrvMsg(pScreen->myNum, X_ERROR, @@ -759,10 +526,6 @@ Bool VIADRIScreenInit(ScreenPtr pScreen) drmFreeVersion(drmVer); - if (!(VIAInitVisualConfigs(pScreen))) { - VIADRICloseScreen(pScreen); - return FALSE; - } xf86DrvMsg(pScrn->scrnIndex, X_INFO, "[dri] visual configs initialized.\n" ); /* DRIScreenInit doesn't add all the common mappings. Add additional mappings here. */ @@ -812,15 +575,6 @@ VIADRICloseScreen(ScreenPtr pScreen) DRIDestroyInfoRec(pVia->pDRIInfo); pVia->pDRIInfo = NULL; } - - if (pVia->pVisualConfigs) { - xfree(pVia->pVisualConfigs); - pVia->pVisualConfigs = NULL; - } - if (pVia->pVisualConfigsPriv) { - xfree(pVia->pVisualConfigsPriv); - pVia->pVisualConfigsPriv = NULL; - } } /* TODO: xserver receives driver's swapping event and does something diff --git a/src/via_dri.h b/src/via_dri.h index e7e9f32..fb8821b 100644 --- a/src/via_dri.h +++ b/src/via_dri.h @@ -67,10 +67,6 @@ typedef struct { unsigned int reg_pause_addr; } VIADRIRec, *VIADRIPtr; -typedef struct { - int dummy; -} VIAConfigPrivRec, *VIAConfigPrivPtr; - typedef struct { int dummy; } VIADRIContextRec, *VIADRIContextPtr; diff --git a/src/via_driver.c b/src/via_driver.c index fe59dfe..7880653 100644 --- a/src/via_driver.c +++ b/src/via_driver.c @@ -349,7 +349,6 @@ static const char *driSymbols[] = { "DRIUnlock", "DRIOpenConnection", "DRICloseConnection", - "GlxSetVisualConfigs", NULL }; #endif diff --git a/src/via_driver.h b/src/via_driver.h index 9a984fe..d6839fc 100644 --- a/src/via_driver.h +++ b/src/via_driver.h @@ -61,7 +61,6 @@ #define _XF86DRI_SERVER_ #include "sarea.h" #include "dri.h" -#include "GL/glxint.h" #include "via_dri.h" #endif @@ -292,9 +291,6 @@ typedef struct _VIA { Bool XvMCEnabled; DRIInfoPtr pDRIInfo; int drmFD; - int numVisualConfigs; - __GLXvisualConfig* pVisualConfigs; - VIAConfigPrivPtr pVisualConfigsPriv; drm_handle_t agpHandle; drm_handle_t registerHandle; drm_handle_t frameBufferHandle; -- cgit v1.2.3