[PATCH cirrus 2/2] Don't build split alpine and laguna support

Adam Jackson ajax at redhat.com
Wed Apr 27 16:25:32 UTC 2016


Before:

   text	   data	    bss	    dec	    hex	filename
  25772	   2040	     16	  27828	   6cb4	src/.libs/cirrus_alpine.so
  11429	   1552	    112	  13093	   3325	src/.libs/cirrus_drv.so
  21968	   2016	     16	  24000	   5dc0	src/.libs/cirrus_laguna.so
  59169	   5608	    114	  64921	   fd99	(TOTALS)

After:

   text	   data	    bss	    dec	    hex	filename
  47831	   3840	    112	  51783	   ca47	src/.libs/cirrus_drv.so

So, in the worst case, you're using roughly two more pages for (clean,
evictable) text, but two fewer (dirty) pages for data and bss. Fixing
this also allows the X server to clean up module loading a bit by
enforcing the _drv.so suffix, and since this is the only driver pulling
such shenanigans...

Signed-off-by: Adam Jackson <ajax at redhat.com>
---
 src/Makefile.am  | 24 ++++++------------------
 src/cir_driver.c | 43 ++-----------------------------------------
 2 files changed, 8 insertions(+), 59 deletions(-)

diff --git a/src/Makefile.am b/src/Makefile.am
index 36b8d8b..2ceb828 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -35,32 +35,20 @@ cirrus_drv_la_SOURCES = \
          CirrusClk.c \
          cir_shadow.c \
          cir_pcirename.h \
-         compat-api.h
-
-cirrus_alpine_la_LTLIBRARIES = cirrus_alpine.la
-cirrus_alpine_la_LDFLAGS = -module -avoid-version
-cirrus_alpine_ladir = @moduledir@/drivers
-cirrus_alpine_la_SOURCES = \
+         compat-api.h \
          alp_driver.c \
          alp.h \
          alp_hwcurs.c \
-         alp_i2c.c
-if XAA
-cirrus_alpine_la_SOURCES += \
-         alp_xaa.c \
-         alp_xaam.c
-endif
-
-cirrus_laguna_la_LTLIBRARIES = cirrus_laguna.la
-cirrus_laguna_la_LDFLAGS = -module -avoid-version
-cirrus_laguna_ladir = @moduledir@/drivers
-cirrus_laguna_la_SOURCES = \
+         alp_i2c.c \
          lg_driver.c \
          lg.h \
          lg_hwcurs.c \
          lg_i2c.c
+
 if XAA
-cirrus_laguna_la_SOURCES += \
+cirrus_drv_la_SOURCES += \
+         alp_xaa.c \
+         alp_xaam.c
          lg_xaa.c \
          lg_xaa.h
 endif
diff --git a/src/cir_driver.c b/src/cir_driver.c
index 2df4a2e..bbd8bbc 100644
--- a/src/cir_driver.c
+++ b/src/cir_driver.c
@@ -43,9 +43,6 @@ static const OptionInfoRec *	CIRAvailableOptions(int chipid, int busid);
 static void	CIRIdentify(int flags);
 static Bool	CIRProbe(DriverPtr drv, int flags);
 
-static Bool lg_loaded = FALSE;
-static Bool alp_loaded = FALSE;
-
 #define CIR_VERSION 4000
 #define CIR_NAME "CIRRUS"
 #define CIR_DRIVER_NAME "cirrus"
@@ -170,16 +167,10 @@ CIRAvailableOptions(int chipid, int busid)
 	case PCI_CHIP_GD5464:
 	case PCI_CHIP_GD5464BD:
 	case PCI_CHIP_GD5465:
-		if (lg_loaded)
-			return LgAvailableOptions(chipid);
-		else
-			return NULL;
+		return LgAvailableOptions(chipid);
 
 	default:
-		if (alp_loaded)
-			return AlpAvailableOptions(chipid);
-		else
-			return NULL;
+		return AlpAvailableOptions(chipid);
 	}
 }
 
@@ -199,25 +190,6 @@ CIRProbe(DriverPtr drv, int flags)
     ErrorF("CirProbe\n");
 #endif
   
-    /*
-     * For PROBE_DETECT, make sure both sub-modules are loaded before
-     * calling xf86MatchPciInstances(), because the AvailableOptions()
-     * functions may be called before xf86MatchPciInstances() returns.
-     */
-    
-    if (flags & PROBE_DETECT) {
-	if (!lg_loaded) {
-	    if (xf86LoadDrvSubModule(drv, "cirrus_laguna")) {
-		lg_loaded = TRUE;
-	    }
-	}
-	if (!alp_loaded) {
-	    if (xf86LoadDrvSubModule(drv, "cirrus_alpine")) {
-		alp_loaded = TRUE;
-	    }
-	}
-    }
-
     if ((numDevSections = xf86MatchDevice(CIR_DRIVER_NAME,
 					  &devSections)) <= 0) {
 	return FALSE;
@@ -272,19 +244,8 @@ CIRProbe(DriverPtr drv, int flags)
 		     PCI_DEV_DEVICE_ID(pPci) == PCI_CHIP_GD5464 ||
 		     PCI_DEV_DEVICE_ID(pPci) == PCI_CHIP_GD5464BD ||
 		     PCI_DEV_DEVICE_ID(pPci) == PCI_CHIP_GD5465)) {
- 	    
- 	    if (!lg_loaded) {
- 		if (!xf86LoadDrvSubModule(drv, "cirrus_laguna")) 
-		    continue;
- 		lg_loaded = TRUE;
- 	    }
 	    pScrn = LgProbe(usedChips[i]);
  	} else {
- 	    if (!alp_loaded) {
- 		if (!xf86LoadDrvSubModule(drv, "cirrus_alpine")) 
- 		    continue;
- 		alp_loaded = TRUE;
- 	    }
  	    pScrn = AlpProbe(usedChips[i]);
  	}
  	
-- 
2.7.4



More information about the xorg-devel mailing list