diff options
author | Luc Verhaegen <libv@skynet.be> | 2008-12-01 20:07:57 +0100 |
---|---|---|
committer | Luc Verhaegen <libv@skynet.be> | 2008-12-01 20:07:57 +0100 |
commit | 8a5fde76400e48343e1c799b592817a9abd828cc (patch) | |
tree | 45f9fd13f5820d39e5cb9a595aec11eb58a749d9 | |
parent | 26a44087efbc09eca15f98feafffbf2171d47062 (diff) |
Change driver name from "via" to "unichrome".
But also include a wrapper driver to automatically load unichrome. Only
wrapper/Makefile.am needs to be adjusted if more wrapper copies need to
be added.
-rw-r--r-- | .gitignore | 13 | ||||
-rw-r--r-- | Makefile.am | 2 | ||||
-rw-r--r-- | configure.ac | 4 | ||||
-rw-r--r-- | man/.gitignore | 6 | ||||
-rw-r--r-- | man/Imakefile | 4 | ||||
-rw-r--r-- | man/Makefile.am | 4 | ||||
-rw-r--r-- | man/unichrome.man (renamed from man/via.man) | 10 | ||||
-rw-r--r-- | src/.gitignore | 10 | ||||
-rw-r--r-- | src/Imakefile | 10 | ||||
-rw-r--r-- | src/Makefile.am | 12 | ||||
-rw-r--r-- | src/via_driver.c | 34 | ||||
-rw-r--r-- | wrapper/Makefile.am | 30 | ||||
-rw-r--r-- | wrapper/wrapper.c | 120 | ||||
-rw-r--r-- | wrapper/wrapper.man | 15 |
14 files changed, 215 insertions, 59 deletions
@@ -1,5 +1,16 @@ +.deps +.libs Makefile Makefile.in +*.loT +*.lo +*.la +*.o +*.so +*~ +*.4 +*._man +*.html aclocal.m4 autom4te.cache config.guess @@ -18,10 +29,10 @@ mkinstalldirs stamp-h.in stamp-h1 git_version.h -*~ *.bak build-stamp debian/files debian/substvars debian/xf86-video-unichrome.substvars debian/xf86-video-unichrome +compile diff --git a/Makefile.am b/Makefile.am index 58cab67..8e73b1a 100644 --- a/Makefile.am +++ b/Makefile.am @@ -19,7 +19,7 @@ # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. AUTOMAKE_OPTIONS = foreign -SUBDIRS = src man +SUBDIRS = src man wrapper BUILT_SOURCES = git_version.h CLEANFILES = git_version.h git_version.h: Makefile git_version.sh diff --git a/configure.ac b/configure.ac index 72a6103..aeb8b7c 100644 --- a/configure.ac +++ b/configure.ac @@ -139,9 +139,6 @@ AC_SUBST([DRI_CFLAGS]) AC_SUBST([XORG_CFLAGS]) AC_SUBST([moduledir]) -DRIVER_NAME=via -AC_SUBST([DRIVER_NAME]) - XORG_MANPAGE_SECTIONS XORG_RELEASE_VERSION @@ -149,4 +146,5 @@ AC_OUTPUT([ Makefile src/Makefile man/Makefile + wrapper/Makefile ]) diff --git a/man/.gitignore b/man/.gitignore deleted file mode 100644 index f6841f2..0000000 --- a/man/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -Makefile -Makefile.in -*.4 -*._man -*.html -*~ diff --git a/man/Imakefile b/man/Imakefile index b218f35..6459806 100644 --- a/man/Imakefile +++ b/man/Imakefile @@ -9,9 +9,9 @@ XCOMM add in defines which are known to xorg but not to xfree86. EXTRAMANDEFS=-D__xservername__=XFree86 -D__xconfigfile__=XF86Config-4 \ -D__appmansuffix__=$(MANSUFFIX) -CppManTarget(via, $(EXTRAMANDEFS)) +CppManTarget(unichrome, $(EXTRAMANDEFS)) #endif -InstallModuleManPage(via) +InstallModuleManPage(unichrome) #endif diff --git a/man/Makefile.am b/man/Makefile.am index c255c5f..1be4d56 100644 --- a/man/Makefile.am +++ b/man/Makefile.am @@ -27,11 +27,11 @@ drivermandir = $(DRIVER_MAN_DIR) -driverman_PRE = @DRIVER_NAME@.man +driverman_PRE = unichrome.man driverman_DATA = $(driverman_PRE:man=@DRIVER_MAN_SUFFIX@) -EXTRA_DIST = @DRIVER_NAME@.man +EXTRA_DIST = wrapper.man unichrome.man CLEANFILES = $(driverman_DATA) diff --git a/man/via.man b/man/unichrome.man index 873eb7e..5820289 100644 --- a/man/via.man +++ b/man/unichrome.man @@ -1,22 +1,22 @@ .\" shorthand for double quote that works everywhere. .ds q \N'34' -.TH VIA __drivermansuffix__ __vendorversion__ +.TH UNICHROME __drivermansuffix__ __vendorversion__ .SH NAME -via \- VIA Unichrome video driver +unichrome \- VIA Unichrome video driver .SH SYNOPSIS .nf .B "Section \*qDevice\*q" .BI " Identifier \*q" devname \*q -.B " Driver \*qvia\*q" +.B " Driver \*qunichrome\*q" \ \ ... .B EndSection .fi .SH DESCRIPTION -.B via +.B unichrome is an __xservername__ driver for VIA Unichrome integrated graphics. .PP The -.B via +.B unichrome driver supports the following devices: .nf VT3122: CLE266 (CastleRock). diff --git a/src/.gitignore b/src/.gitignore deleted file mode 100644 index b4b52f8..0000000 --- a/src/.gitignore +++ /dev/null @@ -1,10 +0,0 @@ -.deps -.libs -Makefile -Makefile.in -*.loT -*.lo -*.la -*.o -*.so -*~ diff --git a/src/Imakefile b/src/Imakefile index 962152d..3f844f9 100644 --- a/src/Imakefile +++ b/src/Imakefile @@ -182,15 +182,15 @@ NormalAsmObjectRule() ModuleObjectRule() #ifdef X_NEED_NEWMODULETARGET -ObjectModuleTarget(via, $(OBJS),drivers) +ObjectModuleTarget(unichrome, $(OBJS),drivers) #else -ObjectModuleTarget(via, $(OBJS)) +ObjectModuleTarget(unichrome, $(OBJS)) #endif #ifdef InstallVideoObjectModule -InstallVideoObjectModule(via,$(MODULEDIR)) +InstallVideoObjectModule(unichrome,$(MODULEDIR)) #else -InstallObjectModule(via,$(MODULEDIR),drivers) +InstallObjectModule(unichrome,$(MODULEDIR),drivers) #endif DependTarget() @@ -233,4 +233,4 @@ InstallDriverSDKNonExecFile(via_videoregs.h,$(DRIVERSDKDIR)/drivers/via) InstallDriverSDKNonExecFile(via_vt162x.c,$(DRIVERSDKDIR)/drivers/via) InstallDriverSDKNonExecFile(via_vt162x.h,$(DRIVERSDKDIR)/drivers/via) -InstallDriverSDKObjectModule(via,$(DRIVERSDKMODULEDIR),drivers) +InstallDriverSDKObjectModule(unichrome,$(DRIVERSDKMODULEDIR),drivers) diff --git a/src/Makefile.am b/src/Makefile.am index 94134b0..d88ec24 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -24,9 +24,9 @@ # _ladir passes a dummy rpath to libtool so the thing will actually link # TODO: -nostdlib/-Bstatic/-lgcc platform magic, not installing the .a, etc. AM_CFLAGS = @XORG_CFLAGS@ @DRI_CFLAGS@ -via_drv_la_LTLIBRARIES = via_drv.la -via_drv_la_LDFLAGS = -module -avoid-version -via_drv_ladir = @moduledir@/drivers +unichrome_drv_la_LTLIBRARIES = unichrome_drv.la +unichrome_drv_la_LDFLAGS = -module -avoid-version +unichrome_drv_ladir = @moduledir@/drivers # rule to generate git_version.h $(top_srcdir)/git_version.h: @@ -36,7 +36,7 @@ $(top_srcdir)/git_version.h: # Add a dependency on git_version.h via_driver.c: $(top_srcdir)/git_version.h -via_drv_la_SOURCES = \ +unichrome_drv_la_SOURCES = \ via_accel.c \ via_ch7xxx.c \ via_ch7xxx.h \ @@ -69,14 +69,14 @@ via_drv_la_SOURCES = \ via_vt162x.h if XV -via_drv_la_SOURCES += \ +unichrome_drv_la_SOURCES += \ via_video.c \ via_video.h \ via_videoregs.h endif if DRI -via_drv_la_SOURCES += \ +unichrome_drv_la_SOURCES += \ via_dri.c \ via_dri.h \ via_drmclient.h diff --git a/src/via_driver.c b/src/via_driver.c index 6b9c2d1..f1be004 100644 --- a/src/via_driver.c +++ b/src/via_driver.c @@ -153,10 +153,10 @@ static PCI_ID_LIST_DECL[] = { }; -_X_EXPORT DriverRec VIA = +_X_EXPORT DriverRec UNICHROME = { VIA_VERSION, - DRIVER_NAME, + "unichrome", VIAIdentify, #ifdef XSERVER_LIBPCIACCESS NULL, @@ -355,10 +355,8 @@ static const char *driSymbols[] = { }; #endif -static MODULESETUPPROTO(VIASetup); - -static XF86ModuleVersionInfo VIAVersRec = { - "via", +static XF86ModuleVersionInfo UNICHROMEVersRec = { + "unichrome", "http://unichrome.sf.net/", MODINFOSTRING1, MODINFOSTRING2, @@ -374,9 +372,7 @@ static XF86ModuleVersionInfo VIAVersRec = { {0, 0, 0, 0} }; -XF86ModuleData viaModuleData = {&VIAVersRec, VIASetup, NULL}; - -static pointer VIASetup( +static pointer UNICHROMESetup( #ifdef HaveModuleDescPtr /* XFree86 4.6.0 */ ModuleDescPtr module, #else @@ -388,7 +384,7 @@ static pointer VIASetup( if (!setupDone) { setupDone = TRUE; - xf86AddDriver(&VIA, module, HaveDriverFuncs); + xf86AddDriver(&UNICHROME, module, HaveDriverFuncs); LoaderRefSymLists(vgaHWSymbols, #ifdef USE_FB fbSymbols, @@ -414,7 +410,9 @@ static pointer VIASetup( return NULL; } -} /* VIASetup */ +} + +XF86ModuleData unichromeModuleData = {&UNICHROMEVersRec, UNICHROMESetup, NULL}; #endif /* XFree86LOADER */ @@ -491,7 +489,7 @@ VIAAvailableOptions(int chipid, int busid) static void VIAIdentify(int flags) { - xf86Msg(X_INFO, "VIA: driver for VIA UniChrome/Chrome integrated graphics.\n"); + xf86Msg(X_INFO, "UNICHROME: driver for VIA UniChrome/Chrome integrated graphics.\n"); xf86Msg(X_INFO, " VT3122: CLE266 (CastleRock).\n"); xf86Msg(X_INFO, " VT7205: KM400, KM400A, KN400, P4M800 (Unichrome).\n"); xf86Msg(X_INFO, " VT3108: K8M800, K8N800, K8N800A (Unichrome Pro, aka Pro B).\n"); @@ -554,8 +552,8 @@ VIAPciProbe(DriverPtr drv, int entityNum, return FALSE; pScrn->driverVersion = VIA_VERSION; - pScrn->driverName = DRIVER_NAME; - pScrn->name = "VIA"; + pScrn->driverName = "unichrome"; + pScrn->name = "UNICHROME"; pScrn->Probe = NULL; pScrn->PreInit = VIAPreInit; pScrn->ScreenInit = VIAScreenInit; @@ -590,8 +588,8 @@ ViaScrnInfoSetup(DriverPtr drv, int entityIndex) if ((pScrn = xf86ConfigPciEntity(pScrn, 0, entityIndex, VIAPciChipsets, 0, 0, 0, 0, 0))) { pScrn->driverVersion = VIA_VERSION; - pScrn->driverName = DRIVER_NAME; - pScrn->name = "VIA"; + pScrn->driverName = "unichrome"; + pScrn->name = "UNICHROME"; pScrn->Probe = VIAProbe; pScrn->PreInit = VIAPreInit; pScrn->ScreenInit = VIAScreenInit; @@ -652,13 +650,13 @@ VIAProbe(DriverPtr drv, int flags) int i; /* sanity checks */ - if ((numDevSections = xf86MatchDevice(DRIVER_NAME, &devSections)) <= 0) + if ((numDevSections = xf86MatchDevice("unichrome", &devSections)) <= 0) return FALSE; if (xf86GetPciVideoInfo() == NULL) return FALSE; - numUsed = xf86MatchPciInstances(DRIVER_NAME, PCI_VENDOR_VIA, VIAChipsets, + numUsed = xf86MatchPciInstances("unichrome", PCI_VENDOR_VIA, VIAChipsets, VIAPciChipsets, devSections, numDevSections, drv, &usedChips); xfree(devSections); diff --git a/wrapper/Makefile.am b/wrapper/Makefile.am new file mode 100644 index 0000000..71cbe62 --- /dev/null +++ b/wrapper/Makefile.am @@ -0,0 +1,30 @@ +AM_CFLAGS = @XORG_CFLAGS@ @DRI_CFLAGS@ +EXTRA_DIST = wrapper.man +drivermandir = $(DRIVER_MAN_DIR) +SED = sed + + +# +# first off; via. +# +# driver. +via_drv_la_LTLIBRARIES = via_drv.la +via_drv_la_LDFLAGS = -module -avoid-version +via_drv_ladir = @moduledir@/drivers +via_drv_la_SOURCES = wrapper.c +via_drv_la_CFLAGS = $(AM_CFLAGS) -D WRAP_NAME=\"via\" -D WRAP_REPLACE\(name\)=NAME_CAT\(via,name\) +# manpage. +VIA_MAN_SUBSTS = \ + -e 's|__xservername__|Xorg|g' \ + -e 's|__drivermansuffix__|$(DRIVER_MAN_SUFFIX)|g' \ + -e 's|__vendorversion__|0\.0\.0|g' \ + -e 's|__wrappernamebig__|VIA|g' \ + -e 's|__wrappernamesmall__|via|g' + +via.$(DRIVER_MAN_SUFFIX): wrapper.man + $(SED) $(VIA_MAN_SUBSTS) < wrapper.man > $@ + +# manpage general +driverman_DATA = via.$(DRIVER_MAN_SUFFIX) +CLEANFILES = $(driverman_DATA) + diff --git a/wrapper/wrapper.c b/wrapper/wrapper.c new file mode 100644 index 0000000..4a2c6b8 --- /dev/null +++ b/wrapper/wrapper.c @@ -0,0 +1,120 @@ +/* + * Copyright 2008 Luc Verhaegen. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sub license, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial portions + * of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +/* + * Wrapper driver that loads unichrome_drv.so. + * + * Compile with: + * -D WRAPPER_NAME="bleh" + * -D WRAPPER_NAME_REPLACE\(name\)=NAME_CAT\(bleh,name\) + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "xf86.h" + +#if !defined(UNIXCPP) || defined(ANSICPP) +#define NAME_CAT(prefix,name) prefix##name +#else +#define NAME_CAT(prefix,name) prefix/**/name +#endif + +/* + * + */ +static XF86ModuleVersionInfo +WRAP_REPLACE(VersRec) = { + WRAP_NAME, + "http://unichrome.sf.net/", + MODINFOSTRING1, + MODINFOSTRING2, +#ifdef XORG_VERSION_CURRENT + XORG_VERSION_CURRENT, +#else + XF86_VERSION_CURRENT, +#endif + 0, 0, 0, + ABI_CLASS_VIDEODRV, + ABI_VIDEODRV_VERSION, + MOD_CLASS_VIDEODRV, + {0, 0, 0, 0} +}; + +/* + * + */ +static pointer +WRAP_REPLACE(Setup)( +#ifdef HaveModuleDescPtr /* XFree86 4.6.0 */ + ModuleDescPtr module, +#else + pointer module, +#endif + pointer options, int *errmaj, int *errmin) +{ + static int Initialised = FALSE; + + if (Initialised) { + if (errmaj) + *errmaj = LDR_ONCEONLY; + + return NULL; + } + + Initialised = TRUE; + + { + GDevPtr *gdevs; + int count, i; + + count = xf86MatchDevice(WRAP_NAME, &gdevs); + + if (!count) { + xf86Msg(X_ERROR, "%s: No devices found.\n", __func__); + return NULL; + } + + /* change the name */ + for (i = 0; i < count; i++) + gdevs[i]->driver = "unichrome"; + + xfree(gdevs); + } + + xf86LoadOneModule("unichrome", options); + + return (pointer) 1; +} + +/* + * + */ +_X_EXPORT XF86ModuleData +WRAP_REPLACE(ModuleData) = +{ + &WRAP_REPLACE(VersRec), + WRAP_REPLACE(Setup), + NULL +}; diff --git a/wrapper/wrapper.man b/wrapper/wrapper.man new file mode 100644 index 0000000..d239cd9 --- /dev/null +++ b/wrapper/wrapper.man @@ -0,0 +1,15 @@ +.\" shorthand for double quote that works everywhere. +.ds q \N'34' +.TH __wrappernamebig__ __drivermansuffix__ +.SH NAME + __wrappernamesmall__ \- Wrapper for VIA Unichrome video driver. + +.SH DESCRIPTION +.B __wrappernamesmall__ +is a wrapper driver for the +.B unichrome +__xservername__ driver for VIA Unichrome integrated graphics. +.PP +.SH SEE ALSO +unichrome(__drivermansuffix__) + |