[PATCH xf86-video-savage] xf86-video-savage: remove the GlxSetVisualConfigs stub and friends

Emil Velikov emil.l.velikov at gmail.com
Mon Jul 31 13:13:53 UTC 2017


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: Stefan Dirsch <sndirsch at suse.de>
Cc: Hans de Goede <hdegoede at redhat.com>
Signed-off-by: Emil Velikov <emil.velikov at collabora.com>
---
 src/savage_dri.c     | 157 +--------------------------------------------------
 src/savage_dripriv.h |  11 ----
 src/savage_driver.h  |   4 --
 3 files changed, 1 insertion(+), 171 deletions(-)

diff --git a/src/savage_dri.c b/src/savage_dri.c
index 0842821..2d79943 100644
--- a/src/savage_dri.c
+++ b/src/savage_dri.c
@@ -50,7 +50,6 @@
 #include "savage_common.h"
 
 #define _XF86DRI_SERVER_
-#include "GL/glxtokens.h"
 #include "sarea.h"
 #include "savage_dri.h"
 #include "savage_sarea.h"
@@ -98,149 +97,6 @@ SAVAGEDRISubsequentScreenToScreenCopy(
     ScrnInfoPtr pScrn, int x1, int y1, int x2, int y2,
     int w, int h);
 
-
-/* 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 SAVAGEInitVisualConfigs( ScreenPtr pScreen )
-{
-   ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
-   SavagePtr psav = SAVPTR(pScrn);
-   int numConfigs = 0;
-   __GLXvisualConfig *pConfigs = 0;
-   SAVAGEConfigPrivPtr pSAVAGEConfigs = 0;
-   SAVAGEConfigPrivPtr *pSAVAGEConfigPtrs = 0;
-   int i, db, stencil, accum, visNum;
-
-   switch ( pScrn->bitsPerPixel ) {
-   case 8:
-   case 24:
-      break;
-
-   case 16:
-   case 32:
-      numConfigs = 8;
-
-      pConfigs = (__GLXvisualConfig*)calloc( sizeof(__GLXvisualConfig),
-						numConfigs );
-      if ( !pConfigs ) {
-	 return FALSE;
-      }
-
-      pSAVAGEConfigs = (SAVAGEConfigPrivPtr)calloc( sizeof(SAVAGEConfigPrivRec),
-						 numConfigs );
-      if ( !pSAVAGEConfigs ) {
-	 free( pConfigs );
-	 return FALSE;
-      }
-
-      pSAVAGEConfigPtrs = (SAVAGEConfigPrivPtr*)calloc( sizeof(SAVAGEConfigPrivPtr),
-						     numConfigs );
-      if ( !pSAVAGEConfigPtrs ) {
-	 free( pConfigs );
-	 free( pSAVAGEConfigs );
-	 return FALSE;
-      }
-
-      for ( i = 0 ; i < numConfigs ; i++ ) {
-	 pSAVAGEConfigPtrs[i] = &pSAVAGEConfigs[i];
-      }
-
-      for (visNum = 0; SAVAGEVisuals[visNum].bpp != 0; visNum++) {
-         if ( SAVAGEVisuals[visNum].bpp == pScrn->bitsPerPixel )
-            break;
-      }
-      if ( SAVAGEVisuals[visNum].bpp == 0 ) {
-	 free( pConfigs );
-	 free( pSAVAGEConfigs );
-         return FALSE;
-      }
-
-      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	= SAVAGEVisuals[visNum].redSize;
-               pConfigs[i].greenSize	= SAVAGEVisuals[visNum].greenSize;
-               pConfigs[i].blueSize	= SAVAGEVisuals[visNum].blueSize;
-               pConfigs[i].alphaSize	= SAVAGEVisuals[visNum].alphaSize;
-               pConfigs[i].redMask	= SAVAGEVisuals[visNum].redMask;
-               pConfigs[i].greenMask	= SAVAGEVisuals[visNum].greenMask;
-               pConfigs[i].blueMask	= SAVAGEVisuals[visNum].blueMask;
-               pConfigs[i].alphaMask	= SAVAGEVisuals[visNum].alphaMask;
-
-               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		= pScrn->bitsPerPixel;
-               pConfigs[i].depthSize	= SAVAGEVisuals[visNum].depthSize;
-               if ( stencil ) {
-                  pConfigs[i].stencilSize	= 8;
-               } else {
-                  pConfigs[i].stencilSize	= 0;
-               }
-
-               pConfigs[i].auxBuffers		= 0;
-               pConfigs[i].level		= 0;
-
-               pConfigs[i].visualRating	= GLX_NONE;
-               if ( pScrn->bitsPerPixel == 16 ) {
-                  if ( accum || stencil ) {
-                     pConfigs[i].visualRating	= GLX_SLOW_CONFIG;
-                  }
-               } else if ( accum ) {
-                  pConfigs[i].visualRating	= GLX_SLOW_VISUAL_EXT;
-               }
-               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;
-   }
-
-   psav->numVisualConfigs = numConfigs;
-   psav->pVisualConfigs = pConfigs;
-   psav->pVisualConfigsPriv = pSAVAGEConfigs;
-
-   GlxSetVisualConfigs( numConfigs, pConfigs, (void **)pSAVAGEConfigPtrs );
-
-   return TRUE;
-}
-
 static Bool SAVAGECreateContext( ScreenPtr pScreen, VisualPtr visual,
 			      drm_context_t hwContext, void *pVisualConfigPriv,
 			      DRIContextType contextStore )
@@ -799,10 +655,9 @@ Bool SAVAGEDRIScreenInit( ScreenPtr pScreen )
    SAVAGEDRIPtr pSAVAGEDRI;
    SAVAGEDRIServerPrivatePtr pSAVAGEDRIServer;
 
-   /* 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,
@@ -1013,10 +868,6 @@ Bool SAVAGEDRIScreenInit( ScreenPtr pScreen )
       return FALSE;
    }
 
-   if ( !SAVAGEInitVisualConfigs( pScreen ) ) {
-      SAVAGEDRICloseScreen( pScreen );
-      return FALSE;
-   }
    xf86DrvMsg( pScrn->scrnIndex, X_INFO, "[dri] visual configs initialized\n" );
 
    return TRUE;
@@ -1333,12 +1184,6 @@ void SAVAGEDRICloseScreen( ScreenPtr pScreen )
       free( psav->DRIServerInfo );
       psav->DRIServerInfo = 0;
    }
-   if ( psav->pVisualConfigs ) {
-      free( psav->pVisualConfigs );
-   }
-   if ( psav->pVisualConfigsPriv ) {
-      free( psav->pVisualConfigsPriv );
-   }
 }
 
 void
diff --git a/src/savage_dripriv.h b/src/savage_dripriv.h
index 4206a9f..a2abf2b 100644
--- a/src/savage_dripriv.h
+++ b/src/savage_dripriv.h
@@ -25,19 +25,8 @@
 #ifndef SAVAGE_DRIPRIV_H
 #define SAVAGE_DRIPRIV_H
 
-#include "GL/glxint.h"
-
 #define SAVAGE_MAX_DRAWABLES 256
 
-extern void GlxSetVisualConfigs( int nconfigs,
-				 __GLXvisualConfig *configs,
-				 void **configprivs );
-
-typedef struct {
-  /* Nothing here yet */
-  int dummy;
-} SAVAGEConfigPrivRec, *SAVAGEConfigPrivPtr;
-
 typedef struct {
   /* Nothing here yet */
   int dummy;
diff --git a/src/savage_driver.h b/src/savage_driver.h
index de042af..f7f3fbb 100644
--- a/src/savage_driver.h
+++ b/src/savage_driver.h
@@ -83,7 +83,6 @@
 #include "savage_dripriv.h"
 #include "savage_dri.h"
 #include "dri.h"
-#include "GL/glxint.h"
 #include "xf86drm.h"
 
 /* Totals 2 Mbytes which equals 2^16 32-byte vertices divided among up
@@ -474,9 +473,6 @@ typedef struct _Savage {
     Bool 		directRenderingEnabled;
     DRIInfoPtr 		pDRIInfo;
     int 		drmFD;
-    int 		numVisualConfigs;
-    __GLXvisualConfig*	pVisualConfigs;
-    SAVAGEConfigPrivPtr 	pVisualConfigsPriv;
     SAVAGEDRIServerPrivatePtr DRIServerInfo;
     ScreenWakeupHandlerProcPtr coreWakeupHandler;
     ScreenBlockHandlerProcPtr  coreBlockHandler;
-- 
2.13.0



More information about the xorg-devel mailing list