summaryrefslogtreecommitdiff
path: root/x11/xf86-video-tdfx
diff options
context:
space:
mode:
authorxtraeme <xtraeme@pkgsrc.org>2007-04-09 14:28:00 +0000
committerxtraeme <xtraeme@pkgsrc.org>2007-04-09 14:28:00 +0000
commit14a2c5d3e11900550358f2831856f40ff77a3670 (patch)
tree383d50dac26ebb5c3c4a15c6735458a9f03883d3 /x11/xf86-video-tdfx
parent17b137ff276165279629374730af576110d673c0 (diff)
downloadpkgsrc-14a2c5d3e11900550358f2831856f40ff77a3670.tar.gz
Add xf86-video-tdfx-1.3.0 for modular-xorg, packaged by jmcneill@.
This is the 3Dfx video driver for the modular Xorg server. Supported video cards: Voodoo Banshee, Voodoo3, Voodoo4 and Voodoo5.
Diffstat (limited to 'x11/xf86-video-tdfx')
-rw-r--r--x11/xf86-video-tdfx/DESCR2
-rw-r--r--x11/xf86-video-tdfx/Makefile25
-rw-r--r--x11/xf86-video-tdfx/PLIST6
-rw-r--r--x11/xf86-video-tdfx/distinfo7
-rw-r--r--x11/xf86-video-tdfx/patches/patch-aa33
-rw-r--r--x11/xf86-video-tdfx/patches/patch-ab235
6 files changed, 308 insertions, 0 deletions
diff --git a/x11/xf86-video-tdfx/DESCR b/x11/xf86-video-tdfx/DESCR
new file mode 100644
index 00000000000..a6d908c3b91
--- /dev/null
+++ b/x11/xf86-video-tdfx/DESCR
@@ -0,0 +1,2 @@
+This is the 3Dfx video driver for the modular Xorg server.
+Supported video cards: Voodoo Banshee, Voodoo3, Voodoo4 and Voodoo5.
diff --git a/x11/xf86-video-tdfx/Makefile b/x11/xf86-video-tdfx/Makefile
new file mode 100644
index 00000000000..4af43b3a0e7
--- /dev/null
+++ b/x11/xf86-video-tdfx/Makefile
@@ -0,0 +1,25 @@
+# $NetBSD: Makefile,v 1.1 2007/04/09 14:28:00 xtraeme Exp $
+#
+
+DISTNAME= xf86-video-tdfx-1.3.0
+CATEGORIES= x11
+MASTER_SITES= http://xorg.freedesktop.org/releases/individual/driver/
+EXTRACT_SUFX= .tar.bz2
+
+MAINTAINER= joerg@NetBSD.org
+COMMENT= Modular Xorg 3Dfx video driver
+
+PKG_DESTDIR_SUPPORT= user-destdir
+
+USE_LIBTOOL= yes
+GNU_CONFIGURE= yes
+USE_TOOLS+= pkg-config
+
+.include "../../x11/modular-xorg-server/buildlink3.mk"
+.include "../../x11/randrproto/buildlink3.mk"
+.include "../../x11/renderproto/buildlink3.mk"
+.include "../../x11/videoproto/buildlink3.mk"
+.include "../../x11/xextproto/buildlink3.mk"
+.include "../../x11/glproto/buildlink3.mk"
+.include "../../graphics/MesaLib/buildlink3.mk"
+.include "../../mk/bsd.pkg.mk"
diff --git a/x11/xf86-video-tdfx/PLIST b/x11/xf86-video-tdfx/PLIST
new file mode 100644
index 00000000000..7f14830fa92
--- /dev/null
+++ b/x11/xf86-video-tdfx/PLIST
@@ -0,0 +1,6 @@
+@comment $NetBSD: PLIST,v 1.1 2007/04/09 14:28:00 xtraeme Exp $
+lib/xorg/modules/drivers/tdfx_drv.la
+man/man4/tdfx.4
+@comment @dirrm lib/xorg/modules/drivers
+@comment @dirrm lib/xorg/modules
+@comment @dirrm lib/xorg
diff --git a/x11/xf86-video-tdfx/distinfo b/x11/xf86-video-tdfx/distinfo
new file mode 100644
index 00000000000..7ba2c7b9128
--- /dev/null
+++ b/x11/xf86-video-tdfx/distinfo
@@ -0,0 +1,7 @@
+$NetBSD: distinfo,v 1.1 2007/04/09 14:28:00 xtraeme Exp $
+
+SHA1 (xf86-video-tdfx-1.3.0.tar.bz2) = 8089883c87b64c2876b9152b4820901cc6273f57
+RMD160 (xf86-video-tdfx-1.3.0.tar.bz2) = 31fc8fa884ad669278344164bc7118b1f5edcec8
+Size (xf86-video-tdfx-1.3.0.tar.bz2) = 261448 bytes
+SHA1 (patch-aa) = c6a83f95062b7e7cdf4eedab6dfb1112def41bb9
+SHA1 (patch-ab) = c6167275098624bc3542306f10bfde81f3e9ff7f
diff --git a/x11/xf86-video-tdfx/patches/patch-aa b/x11/xf86-video-tdfx/patches/patch-aa
new file mode 100644
index 00000000000..3f54816c913
--- /dev/null
+++ b/x11/xf86-video-tdfx/patches/patch-aa
@@ -0,0 +1,33 @@
+$NetBSD: patch-aa,v 1.1 2007/04/09 14:28:01 xtraeme Exp $
+
+--- src/tdfxdefs.h.orig 2007-03-27 07:50:42.000000000 -0400
++++ src/tdfxdefs.h 2007-03-27 08:14:29.000000000 -0400
+@@ -384,4 +384,28 @@
+
+ #define SST_POWERDOWN_DAC BIT(8)
+
++/* VIDSERIALPARALELPORT */
++#define VSP_TVOUT_RESET 0x80000000 /* 0 forces TVout reset */
++#define VSP_GPIO2_IN 0x40000000
++#define VSP_GPIO1_OUT 0x20000000
++#define VSP_VMI_RESET_N 0x10000000 /* 0 forces a VMI reset */
++#define VSP_SDA1_IN 0x08000000 /* i2c bus on the feature connector */
++#define VSP_SCL1_IN 0x04000000
++#define VSP_SDA1_OUT 0x02000000
++#define VSP_SCL1_OUT 0x01000000
++#define VSP_ENABLE_IIC1 0x00800000 /* 1 enables I2C bus 1 */
++#define VSP_SDA0_IN 0x00400000 /* i2c bus on the monitor connector */
++#define VSP_SCL0_IN 0x00200000
++#define VSP_SDA0_OUT 0x00100000
++#define VSP_SCL0_OUT 0x00080000
++#define VSP_ENABLE_IIC0 0x00040000 /* 1 enables I2C bus 0 */
++#define VSP_VMI_ADDRESS 0x0003c000 /* mask */
++#define VSP_VMI_DATA 0x00003fc0 /* mask */
++#define VSP_VMI_DISABLE 0x00000020 /* 0 enables VMI output */
++#define VSP_VMI_RDY_N 0x00000010
++#define VSP_RW_N 0x00000008
++#define VSP_DS_N 0x00000004
++#define VSP_CS_N 0x00000002
++#define VSP_HOST_ENABLE 0x00000001 /* 1 enables VMI host control*/
++
+ #endif
diff --git a/x11/xf86-video-tdfx/patches/patch-ab b/x11/xf86-video-tdfx/patches/patch-ab
new file mode 100644
index 00000000000..97997d51bec
--- /dev/null
+++ b/x11/xf86-video-tdfx/patches/patch-ab
@@ -0,0 +1,235 @@
+$NetBSD: patch-ab,v 1.1 2007/04/09 14:28:01 xtraeme Exp $
+
+--- src/tdfx_driver.c.orig 2006-09-02 14:03:07.000000000 -0400
++++ src/tdfx_driver.c 2007-03-27 23:19:20.000000000 -0400
+@@ -141,6 +141,8 @@
+ static void TDFXDisplayPowerManagementSet(ScrnInfoPtr pScrn,
+ int PowerManagermentMode, int flags);
+
++static xf86MonPtr doTDFXDDC(ScrnInfoPtr pScrn);
++
+ _X_EXPORT DriverRec TDFX = {
+ TDFX_VERSION,
+ TDFX_DRIVER_NAME,
+@@ -217,6 +219,13 @@
+ static const char *ddcSymbols[] = {
+ "xf86PrintEDID",
+ "xf86SetDDCproperties",
++ "xf86DoEDID_DDC2",
++ NULL
++};
++
++static const char *i2cSymbols[] = {
++ "xf86CreateI2CBusRec",
++ "xf86I2CBusInit",
+ NULL
+ };
+
+@@ -677,6 +686,7 @@
+ {
+ TDFXPtr pTDFX;
+ ClockRangePtr clockRanges;
++ xf86MonPtr pMon;
+ int i;
+ MessageType from;
+ int flags24;
+@@ -978,32 +988,6 @@
+ availableMem = pScrn->videoRam - 4096 -
+ (((255 <= CMDFIFO_PAGES) ? 255 : CMDFIFO_PAGES) << 12);
+
+- i = xf86ValidateModes(pScrn, pScrn->monitor->Modes,
+- pScrn->display->modes, clockRanges,
+- 0, 320, 2048, 16*pScrn->bitsPerPixel,
+- 200, 2047,
+- pScrn->display->virtualX, pScrn->display->virtualY,
+- availableMem, LOOKUP_BEST_REFRESH);
+-
+- if (i==-1) {
+- TDFXFreeRec(pScrn);
+- return FALSE;
+- }
+-
+- xf86PruneDriverModes(pScrn);
+-
+- if (!i || !pScrn->modes) {
+- xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "No valid modes found\n");
+- TDFXFreeRec(pScrn);
+- return FALSE;
+- }
+-
+- xf86SetCrtcForModes(pScrn, 0);
+-
+- pScrn->currentMode = pScrn->modes;
+-
+- xf86PrintModes(pScrn);
+-
+ xf86SetDpi(pScrn, 0, 0);
+
+ if (!xf86LoadSubModule(pScrn, "fb")) {
+@@ -1046,18 +1030,26 @@
+ xf86LoaderReqSymLists(ramdacSymbols, NULL);
+ }
+
+-#if USE_INT10
+-#if !defined(__powerpc__)
+- /* Load DDC if needed */
+- /* This gives us DDC1 - we should be able to get DDC2B using i2c */
++ if (!xf86LoadSubModule(pScrn, "i2c")) {
++ TDFXFreeRec(pScrn);
++ return FALSE;
++ }
++ xf86LoaderReqSymLists(i2cSymbols, NULL);
++
+ if (!xf86LoadSubModule(pScrn, "ddc")) {
+ TDFXFreeRec(pScrn);
+ return FALSE;
+ }
+ xf86LoaderReqSymLists(ddcSymbols, NULL);
+
+- /* Initialize DDC1 if possible */
+- if (xf86LoadSubModule(pScrn, "vbe")) {
++ pMon = doTDFXDDC(pScrn);
++ if (pMon != NULL) {
++ xf86SetDDCproperties(pScrn, xf86PrintEDID(pMon));
++ } else {
++ /* Initialize DDC1 if possible */
++#if USE_INT10
++#if !defined(__powerpc__)
++ if (xf86LoadSubModule(pScrn, "vbe")) {
+ xf86MonPtr pMon;
+ vbeInfoPtr pVbe = VBEInit(NULL,pTDFX->pEnt->index);
+
+@@ -1065,14 +1057,40 @@
+ pMon = vbeDoEDID(pVbe, NULL);
+ vbeFree(pVbe);
+ xf86SetDDCproperties(pScrn,xf86PrintEDID(pMon));
+- }
++ }
+ #endif
+ #endif
++ }
+
+ if (xf86ReturnOptValBool(pTDFX->Options, OPTION_USE_PIO, FALSE)) {
+ pTDFX->usePIO=TRUE;
+ }
+
++ i = xf86ValidateModes(pScrn, pScrn->monitor->Modes,
++ pScrn->display->modes, clockRanges,
++ 0, 320, 2048, 16*pScrn->bitsPerPixel,
++ 200, 2047,
++ pScrn->display->virtualX, pScrn->display->virtualY,
++ availableMem, LOOKUP_BEST_REFRESH);
++ if (i==-1) {
++ TDFXFreeRec(pScrn);
++ return FALSE;
++ }
++
++ xf86PruneDriverModes(pScrn);
++
++ if (!i || !pScrn->modes) {
++ xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "No valid modes found\n");
++ TDFXFreeRec(pScrn);
++ return FALSE;
++ }
++
++ xf86SetCrtcForModes(pScrn, 0);
++
++ pScrn->currentMode = pScrn->modes;
++
++ xf86PrintModes(pScrn);
++
+ #if X_BYTE_ORDER == X_BIG_ENDIAN
+ pTDFX->ModeReg.miscinit0 = pTDFX->readLong(pTDFX, MISCINIT0);
+ pTDFX->SavedReg.miscinit0 = pTDFX->ModeReg.miscinit0;
+@@ -1640,8 +1658,8 @@
+
+ /* Calculate the CRTC values */
+ hd = (mode->CrtcHDisplay>>3)-1;
+- hss = (mode->CrtcHSyncStart>>3);
+- hse = (mode->CrtcHSyncEnd>>3);
++ hss = (mode->CrtcHSyncStart>>3)-1;
++ hse = (mode->CrtcHSyncEnd>>3)-1;
+ ht = (mode->CrtcHTotal>>3)-5;
+ hbs = (mode->CrtcHBlankStart>>3)-1;
+ hbe = (mode->CrtcHBlankEnd>>3)-1;
+@@ -2524,3 +2542,80 @@
+ dacmode|=state;
+ pTDFX->writeLong(pTDFX, DACMODE, dacmode);
+ }
++
++void
++TDFXPutBits(I2CBusPtr b, int scl, int sda)
++{
++ TDFXPtr pTDFX;
++ CARD32 reg;
++
++ pTDFX = b->DriverPrivate.ptr;
++ reg = pTDFX->readLong(pTDFX, VIDSERIALPARALLELPORT);
++ reg = (reg & ~(VSP_SDA0_OUT | VSP_SCL0_OUT)) |
++ (scl ? VSP_SCL0_OUT : 0) |
++ (sda ? VSP_SDA0_OUT : 0);
++ pTDFX->writeLong(pTDFX, VIDSERIALPARALLELPORT, reg);
++ (void)pTDFX->readLong(pTDFX, VIDSERIALPARALLELPORT); /* flush */
++}
++
++void
++TDFXGetBits(I2CBusPtr b, int *scl, int *sda)
++{
++ TDFXPtr pTDFX;
++ CARD32 reg;
++
++ pTDFX = b->DriverPrivate.ptr;
++
++ reg = pTDFX->readLong(pTDFX, VIDSERIALPARALLELPORT);
++ *sda = (reg & VSP_SDA0_IN) ? 1 : 0;
++ *scl = (reg & VSP_SCL0_IN) ? 1 : 0;
++}
++
++static xf86MonPtr
++doTDFXDDC(ScrnInfoPtr pScrn)
++{
++ TDFXPtr pTDFX;
++ I2CBusPtr pI2CBus;
++ xf86MonPtr pMon = NULL;
++ CARD32 reg;
++
++ pTDFX = TDFXPTR(pScrn);
++
++ if (!(pI2CBus = xf86CreateI2CBusRec()))
++ {
++ xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "Unable to allocate I2C Bus record.\n");
++ return NULL;
++ }
++
++ /* Fill in generic structure fields */
++ pI2CBus->BusName = "DDC";
++ pI2CBus->scrnIndex = pScrn->scrnIndex;
++ pI2CBus->I2CPutBits = TDFXPutBits;
++ pI2CBus->I2CGetBits = TDFXGetBits;
++
++ pI2CBus->DriverPrivate.ptr = pTDFX;
++
++ pI2CBus->ByteTimeout = 2200;
++ pI2CBus->StartTimeout = 550;
++ pI2CBus->BitTimeout = 40;
++ /*pI2CBus->ByteTimeout = 40;*/
++ pI2CBus->AcknTimeout = 40;
++
++#if 1
++ reg = pTDFX->readLong(pTDFX, VIDSERIALPARALLELPORT);
++ pTDFX->writeLong(pTDFX, VIDSERIALPARALLELPORT, reg | VSP_ENABLE_IIC0);
++#else
++ pTDFX->writeLong(pTDFX, VIDSERIALPARALLELPORT, 0xcffc0020);
++#endif
++
++ if (xf86I2CBusInit(pI2CBus))
++ {
++ pMon = xf86DoEDID_DDC2(pScrn->scrnIndex, pI2CBus);
++ if (pMon == NULL)
++ xf86Msg(X_WARNING, "No DDC2 capable monitor found\n");
++ xf86DestroyI2CBusRec(pI2CBus, TRUE, TRUE);
++ }
++ pTDFX->writeLong(pTDFX, VIDSERIALPARALLELPORT, reg);
++
++ return pMon;
++}