summaryrefslogtreecommitdiff
path: root/xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_driver.c
diff options
context:
space:
mode:
Diffstat (limited to 'xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_driver.c')
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_driver.c82
1 files changed, 63 insertions, 19 deletions
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_driver.c b/xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_driver.c
index 658e1f541..ec2729055 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_driver.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_driver.c
@@ -25,13 +25,12 @@ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
**************************************************************************/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_driver.c,v 1.21 2000/02/21 19:23:09 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_driver.c,v 1.30 2000/03/06 23:54:13 dawes Exp $ */
/*
* Authors:
* Daryll Strauss <daryll@precisioninsight.com>
*
- * $PI$
*/
/*
@@ -50,7 +49,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "xf86_OSproc.h"
#include "xf86Resources.h"
#include "xf86RAC.h"
-#include "xf86int10.h"
+#include "vbe.h"
#include "xf86cmap.h"
/* If the driver uses port I/O directly, it needs: */
@@ -249,6 +248,18 @@ static const char *ramdacSymbols[] = {
NULL
};
+static const char *ddcSymbols[] = {
+ "xf86PrintEDID",
+ "xf86DoEDID_DDC1",
+ NULL
+};
+
+static const char *vbeSymbols[] = {
+ "VBEInit",
+ "vbeDoEDID",
+ NULL
+};
+
#ifdef XF86DRI
static const char *drmSymbols[] = {
"drmAddBufs",
@@ -323,7 +334,7 @@ tdfxSetup(pointer module, pointer opts, int *errmaj, int *errmin)
* might refer to.
*/
LoaderRefSymLists(vgahwSymbols, cfbSymbols, xaaSymbols,
- xf8_32bppSymbols, ramdacSymbols,
+ xf8_32bppSymbols, ramdacSymbols, vbeSymbols,
#ifdef XF86DRI
drmSymbols, driSymbols,
#endif
@@ -415,9 +426,8 @@ TDFXProbe(DriverPtr drv, int flags) {
if (numUsed<=0) return FALSE;
if (flags & PROBE_DETECT)
- return TRUE;
-
- for (i=0; i<numUsed; i++) {
+ foundScreen = TRUE;
+ else for (i=0; i<numUsed; i++) {
ScrnInfoPtr pScrn;
/* Allocate new ScrnInfoRec and claim the slot */
@@ -518,6 +528,19 @@ TDFXCountRam(ScrnInfoPtr pScrn) {
return memSize*1024;
}
+extern xf86MonPtr ConfiguredMonitor;
+
+void
+TDFXProbeDDC(ScrnInfoPtr pScrn, int index)
+{
+ vbeInfoPtr pVbe;
+ if (xf86LoadSubModule(pScrn, "vbe")) {
+ pVbe = VBEInit(NULL,index);
+ ConfiguredMonitor = vbeDoEDID(pVbe);
+ }
+}
+
+
/*
* TDFXPreInit --
*
@@ -539,14 +562,6 @@ TDFXPreInit(ScrnInfoPtr pScrn, int flags) {
TDFXTRACE("TDFXPreInit start\n");
if (pScrn->numEntities != 1) return FALSE;
- /* The vgahw module should be loaded here when needed */
- if (!xf86LoadSubModule(pScrn, "vgahw")) return FALSE;
-
- xf86LoaderReqSymLists(vgahwSymbols, NULL);
-
- /* Allocate a vgaHWRec */
- if (!vgaHWGetHWRec(pScrn)) return FALSE;
-
/* Allocate driverPrivate */
if (!TDFXGetRec(pScrn)) {
return FALSE;
@@ -587,6 +602,11 @@ TDFXPreInit(ScrnInfoPtr pScrn, int flags) {
else
pScrn->racMemFlags = RAC_FB | RAC_COLORMAP | RAC_CURSOR | RAC_VIEWPORT;
+ if (flags & PROBE_DETECT) {
+ TDFXProbeDDC(pScrn, pTDFX->pEnt->index);
+ return FALSE;
+ }
+
/* Set pScrn->monitor */
pScrn->monitor = pScrn->confScreen->monitor;
@@ -627,6 +647,14 @@ TDFXPreInit(ScrnInfoPtr pScrn, int flags) {
}
}
+ /* The vgahw module should be loaded here when needed */
+ if (!xf86LoadSubModule(pScrn, "vgahw")) return FALSE;
+
+ xf86LoaderReqSymLists(vgahwSymbols, NULL);
+
+ /* Allocate a vgaHWRec */
+ if (!vgaHWGetHWRec(pScrn)) return FALSE;
+
/* We use a programamble clock */
pScrn->progClock = TRUE;
@@ -775,7 +803,7 @@ TDFXPreInit(ScrnInfoPtr pScrn, int flags) {
clockRanges->maxClock=pTDFX->MaxClock;
clockRanges->clockIndex = -1;
clockRanges->interlaceAllowed = TRUE;
- clockRanges->doubleScanAllowed = FALSE;
+ clockRanges->doubleScanAllowed = TRUE;
i = xf86ValidateModes(pScrn, pScrn->monitor->Modes,
pScrn->display->modes, clockRanges,
@@ -844,6 +872,22 @@ TDFXPreInit(ScrnInfoPtr pScrn, int flags) {
xf86LoaderReqSymLists(ramdacSymbols, NULL);
}
+ /* Load DDC if needed */
+ /* This gives us DDC1 - we should be able to get DDC2B using i2c */
+ if (!xf86LoadSubModule(pScrn, "ddc")) {
+ TDFXFreeRec(pScrn);
+ return FALSE;
+ }
+ xf86LoaderReqSymLists(ddcSymbols, NULL);
+
+ /* Initialize DDC1 if possible */
+ if (xf86LoadSubModule(pScrn, "vbe")) {
+ xf86MonPtr pMon;
+ pMon = vbeDoEDID(VBEInit(NULL,pTDFX->pEnt->index));
+ xf86SetDDCproperties(pScrn,xf86PrintEDID(pMon));
+ }
+
+
/* We wont be using the VGA access after the probe */
if (!xf86ReturnOptValBool(TDFXOptions, OPTION_USE_PIO, FALSE)) {
resRange vgaio[] = { {ResShrIoBlock,0x3B0,0x3BB},
@@ -1327,7 +1371,7 @@ TDFXModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode)
#ifdef XF86DRI
if (pTDFX->directRenderingEnabled) {
- DRILock(screenInfo.screens[pScrn->scrnIndex]);
+ DRILock(screenInfo.screens[pScrn->scrnIndex], 0);
TDFXSwapContextPrivate(screenInfo.screens[pScrn->scrnIndex]);
}
#endif
@@ -1706,7 +1750,7 @@ TDFXScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) {
XF86VideoAdaptorPtr *ptr;
int n;
- n = xf86XVListGenericAdaptors(&ptr);
+ n = xf86XVListGenericAdaptors(pScrn,&ptr);
if (n) {
xf86XVScreenInit(pScreen, ptr, n);
}
@@ -1787,7 +1831,7 @@ TDFXLeaveVT(int scrnIndex, int flags) {
#ifdef XF86DRI
pTDFX = TDFXPTR(pScrn);
if (pTDFX->directRenderingEnabled) {
- DRILock(pScreen);
+ DRILock(pScreen, 0);
}
#endif
}