diff options
author | Emil Velikov <emil.velikov@collabora.com> | 2017-07-17 11:05:57 +0100 |
---|---|---|
committer | Emil Velikov <emil.l.velikov@gmail.com> | 2017-07-17 13:56:35 +0100 |
commit | 2998868964b2f3a56b6759fd8dc4462d812dbe1a (patch) | |
tree | 68149701d274a6ae07a49c6cb3fc9f33f8286e3c | |
parent | 42fabf69c33d0e803eb661cc06217611bc3c9048 (diff) |
xf86-video-mga: remove the GlxSetVisualConfigs stub 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.
Cc: Mathieu Larouche <mathieu.larouche@matrox.com>
Cc: Dave Airlie <airlied@redhat.com>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
---
There's a GLX reference in mga_ucode.h - a file which was seemingly
never used since day 1. I'm not going to bother with that, since I've
taken enough of a diversion already ;-)
-rw-r--r-- | src/mga.h | 7 | ||||
-rw-r--r-- | src/mga_dri.c | 236 | ||||
-rw-r--r-- | src/mga_dripriv.h | 11 | ||||
-rw-r--r-- | src/mga_storm.c | 4 |
4 files changed, 2 insertions, 256 deletions
@@ -41,11 +41,7 @@ #define _XF86DRI_SERVER_ #include "mga_dripriv.h" #include "dri.h" -#include "GL/glxint.h" -#include "dri.h" - -#include "GL/glxint.h" #include "mga_dri.h" #endif @@ -611,9 +607,6 @@ typedef struct { Bool directRenderingEnabled; DRIInfoPtr pDRIInfo; int drmFD; - int numVisualConfigs; - __GLXvisualConfig* pVisualConfigs; - MGAConfigPrivPtr pVisualConfigsPriv; MGADRIServerPrivatePtr DRIServerInfo; MGARegRec DRContextRegs; diff --git a/src/mga_dri.c b/src/mga_dri.c index b957028..bb8e84d 100644 --- a/src/mga_dri.c +++ b/src/mga_dri.c @@ -48,15 +48,8 @@ #include "mga_drm.h" #define _XF86DRI_SERVER_ -#include "GL/glxtokens.h" #include "sarea.h" - - - - -#include "GL/glxtokens.h" - #include "mga_reg.h" #include "mga.h" #include "mga_macros.h" @@ -67,224 +60,6 @@ static char MGAKernelDriverName[] = "mga"; static char MGAClientDriverName[] = "mga"; -/* Initialize the visual configs that are supported by the hardware. - * These are combined with the visual configs that the indirect - * rendering core supports, and the intersection is exported to the - * client. - */ -static Bool MGAInitVisualConfigs( ScreenPtr pScreen ) -{ - ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); - MGAPtr pMga = MGAPTR(pScrn); - int numConfigs = 0; - __GLXvisualConfig *pConfigs = 0; - MGAConfigPrivPtr pMGAConfigs = 0; - MGAConfigPrivPtr *pMGAConfigPtrs = 0; - int i, db, depth, stencil, accum; - - switch ( pScrn->bitsPerPixel ) { - case 8: - case 24: - break; - - case 16: - numConfigs = 8; - - pConfigs = (__GLXvisualConfig*)calloc( sizeof(__GLXvisualConfig), - numConfigs ); - if ( !pConfigs ) { - return FALSE; - } - - pMGAConfigs = (MGAConfigPrivPtr)calloc( sizeof(MGAConfigPrivRec), - numConfigs ); - if ( !pMGAConfigs ) { - free(pConfigs); - return FALSE; - } - - pMGAConfigPtrs = (MGAConfigPrivPtr*)calloc( sizeof(MGAConfigPrivPtr), - numConfigs ); - if ( !pMGAConfigPtrs ) { - free(pConfigs); - free(pMGAConfigs); - return FALSE; - } - - for ( i = 0 ; i < numConfigs ; i++ ) { - pMGAConfigPtrs[i] = &pMGAConfigs[i]; - } - - i = 0; - for ( accum = 0 ; accum <= 1 ; accum++ ) { - for ( stencil = 0 ; stencil <= 1 ; stencil++ ) { - for ( db = 1 ; db >= 0 ; db-- ) { - pConfigs[i].vid = -1; - pConfigs[i].class = -1; - pConfigs[i].rgba = TRUE; - pConfigs[i].redSize = 5; - pConfigs[i].greenSize = 6; - pConfigs[i].blueSize = 5; - pConfigs[i].alphaSize = 0; - pConfigs[i].redMask = 0x0000F800; - pConfigs[i].greenMask = 0x000007E0; - pConfigs[i].blueMask = 0x0000001F; - pConfigs[i].alphaMask = 0; - if ( accum ) { - pConfigs[i].accumRedSize = 16; - pConfigs[i].accumGreenSize = 16; - pConfigs[i].accumBlueSize = 16; - pConfigs[i].accumAlphaSize = 0; - } else { - pConfigs[i].accumRedSize = 0; - pConfigs[i].accumGreenSize = 0; - pConfigs[i].accumBlueSize = 0; - pConfigs[i].accumAlphaSize = 0; - } - if ( db ) { - pConfigs[i].doubleBuffer = TRUE; - } else { - pConfigs[i].doubleBuffer = FALSE; - } - pConfigs[i].stereo = FALSE; - pConfigs[i].bufferSize = 16; - pConfigs[i].depthSize = 16; - if ( stencil ) { - pConfigs[i].stencilSize = 8; - } else { - pConfigs[i].stencilSize = 0; - } - pConfigs[i].auxBuffers = 0; - pConfigs[i].level = 0; - if ( accum || stencil ) { - pConfigs[i].visualRating = GLX_SLOW_CONFIG; - } else { - pConfigs[i].visualRating = GLX_NONE; - } - pConfigs[i].transparentPixel = GLX_NONE; - pConfigs[i].transparentRed = 0; - pConfigs[i].transparentGreen = 0; - pConfigs[i].transparentBlue = 0; - pConfigs[i].transparentAlpha = 0; - pConfigs[i].transparentIndex = 0; - i++; - } - } - } - if ( i != numConfigs ) { - xf86DrvMsg( pScrn->scrnIndex, X_ERROR, - "[drm] Incorrect initialization of visuals\n" ); - return FALSE; - } - break; - - case 32: - numConfigs = 8; - - pConfigs = (__GLXvisualConfig*)calloc( sizeof(__GLXvisualConfig), - numConfigs ); - if ( !pConfigs ) { - return FALSE; - } - - pMGAConfigs = (MGAConfigPrivPtr)calloc( sizeof(MGAConfigPrivRec), - numConfigs ); - if ( !pMGAConfigs ) { - free(pConfigs); - return FALSE; - } - - pMGAConfigPtrs = (MGAConfigPrivPtr*)calloc( sizeof(MGAConfigPrivPtr), - numConfigs ); - if ( !pMGAConfigPtrs ) { - free(pConfigs); - free(pMGAConfigs); - return FALSE; - } - - for ( i = 0 ; i < numConfigs ; i++ ) { - pMGAConfigPtrs[i] = &pMGAConfigs[i]; - } - - i = 0; - for ( accum = 0 ; accum <= 1 ; accum++ ) { - for ( depth = 0 ; depth <= 1 ; depth++ ) { /* and stencil */ - for ( db = 1 ; db >= 0 ; db-- ) { - pConfigs[i].vid = -1; - pConfigs[i].class = -1; - pConfigs[i].rgba = TRUE; - pConfigs[i].redSize = 8; - pConfigs[i].greenSize = 8; - pConfigs[i].blueSize = 8; - pConfigs[i].alphaSize = 0; - pConfigs[i].redMask = 0x00FF0000; - pConfigs[i].greenMask = 0x0000FF00; - pConfigs[i].blueMask = 0x000000FF; - pConfigs[i].alphaMask = 0x0; - if ( accum ) { - pConfigs[i].accumRedSize = 16; - pConfigs[i].accumGreenSize = 16; - pConfigs[i].accumBlueSize = 16; - pConfigs[i].accumAlphaSize = 0; - } else { - pConfigs[i].accumRedSize = 0; - pConfigs[i].accumGreenSize = 0; - pConfigs[i].accumBlueSize = 0; - pConfigs[i].accumAlphaSize = 0; - } - if ( db ) { - pConfigs[i].doubleBuffer = TRUE; - } else { - pConfigs[i].doubleBuffer = FALSE; - } - pConfigs[i].stereo = FALSE; - pConfigs[i].bufferSize = 24; - if ( depth ) { - pConfigs[i].depthSize = 24; - pConfigs[i].stencilSize = 8; - } - else { - pConfigs[i].depthSize = 0; - pConfigs[i].stencilSize = 0; - } - pConfigs[i].auxBuffers = 0; - pConfigs[i].level = 0; - if ( accum ) { - pConfigs[i].visualRating = GLX_SLOW_CONFIG; - } else { - pConfigs[i].visualRating = GLX_NONE; - } - pConfigs[i].transparentPixel = GLX_NONE; - pConfigs[i].transparentRed = 0; - pConfigs[i].transparentGreen = 0; - pConfigs[i].transparentBlue = 0; - pConfigs[i].transparentAlpha = 0; - pConfigs[i].transparentIndex = 0; - i++; - } - } - } - if ( i != numConfigs ) { - xf86DrvMsg( pScrn->scrnIndex, X_ERROR, - "[drm] Incorrect initialization of visuals\n" ); - return FALSE; - } - break; - - default: - /* Unexpected bits/pixels */ - break; - } - - pMga->numVisualConfigs = numConfigs; - pMga->pVisualConfigs = pConfigs; - pMga->pVisualConfigsPriv = pMGAConfigs; - - GlxSetVisualConfigs( numConfigs, pConfigs, (void **)pMGAConfigPtrs ); - - return TRUE; -} - static Bool MGACreateContext( ScreenPtr pScreen, VisualPtr visual, drm_context_t hwContext, void *pVisualConfigPriv, DRIContextType contextStore ) @@ -1095,10 +870,9 @@ Bool MGADRIScreenInit( ScreenPtr pScreen ) return FALSE; } - /* 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, @@ -1350,11 +1124,7 @@ Bool MGADRIScreenInit( ScreenPtr pScreen ) &scratch_ptr); } - if ( !MGAInitVisualConfigs( pScreen ) ) { - DRICloseScreen( pScreen ); - return FALSE; - } - xf86DrvMsg( pScrn->scrnIndex, X_INFO, "[dri] visual configs initialized\n" ); + xf85DrvMsg( pScrn->scrnIndex, X_INFO, "[dri] visual configs initialized\n" ); return TRUE; } @@ -1495,6 +1265,4 @@ void MGADRICloseScreen( ScreenPtr pScreen ) } free(pMga->DRIServerInfo); pMga->DRIServerInfo = 0; - free(pMga->pVisualConfigs); - free(pMga->pVisualConfigsPriv); } diff --git a/src/mga_dripriv.h b/src/mga_dripriv.h index feca134..d494665 100644 --- a/src/mga_dripriv.h +++ b/src/mga_dripriv.h @@ -28,19 +28,8 @@ #ifndef __MGA_DRIPRIV_H__ #define __MGA_DRIPRIV_H__ -#include "GL/glxint.h" - #define MGA_MAX_DRAWABLES 256 -extern void GlxSetVisualConfigs( int nconfigs, - __GLXvisualConfig *configs, - void **configprivs ); - -typedef struct { - /* Nothing here yet */ - int dummy; -} MGAConfigPrivRec, *MGAConfigPrivPtr; - typedef struct { /* Nothing here yet */ int dummy; diff --git a/src/mga_storm.c b/src/mga_storm.c index c945971..3e0d382 100644 --- a/src/mga_storm.c +++ b/src/mga_storm.c @@ -23,10 +23,6 @@ #include "miline.h" #include "servermd.h" -#ifdef MGADRI -#include "GL/glxtokens.h" -#endif - #include "mga.h" #include "mga_reg.h" #include "mga_macros.h" |