Module Name:    xsrc
Committed By:   snj
Date:           Fri Oct 16 06:54:59 UTC 2009

Modified Files:
        xsrc/external/mit/xf86-video-crime/dist/src [netbsd-5]: crime_driver.c

Log Message:
Pull up following revision(s) (requested by macallan in ticket #1092):
        external/mit/xf86-video-crime/dist/src/crime_driver.c: revision 1.5
make X -configure work with the crime driver


To generate a diff of this commit:
cvs rdiff -u -r1.2.2.5 -r1.2.2.6 \
    xsrc/external/mit/xf86-video-crime/dist/src/crime_driver.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: xsrc/external/mit/xf86-video-crime/dist/src/crime_driver.c
diff -u xsrc/external/mit/xf86-video-crime/dist/src/crime_driver.c:1.2.2.5 xsrc/external/mit/xf86-video-crime/dist/src/crime_driver.c:1.2.2.6
--- xsrc/external/mit/xf86-video-crime/dist/src/crime_driver.c:1.2.2.5	Fri Oct 16 06:20:23 2009
+++ xsrc/external/mit/xf86-video-crime/dist/src/crime_driver.c	Fri Oct 16 06:54:59 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: crime_driver.c,v 1.2.2.5 2009/10/16 06:20:23 snj Exp $ */
+/* $NetBSD: crime_driver.c,v 1.2.2.6 2009/10/16 06:54:59 snj Exp $ */
 /*
  * Copyright (c) 2008 Michael Lorenz
  * All rights reserved.
@@ -304,8 +304,6 @@
 	char *dev;
 	Bool foundScreen = FALSE;
 
-	xf86Msg(X_ERROR, "%s\n", __func__);
-
 	if ((numDevSections = xf86MatchDevice(CRIME_DRIVER_NAME,
 					      &devSections)) <= 0)
 		return FALSE;
@@ -313,45 +311,60 @@
 
 	if ((fd = crime_open(CRIME_DEFAULT_DEV)) == 0)
 		return FALSE;
-	xf86Msg(X_ERROR, "%s: fd found\n", __func__);
+	xf86Msg(X_DEBUG, "%s: fd found\n", __func__);
 
 	if (ioctl(fd, WSDISPLAYIO_GTYPE, &wstype) == -1)
 		return FALSE;
-	xf86Msg(X_ERROR, "%s: type: %d\n", __func__, wstype);
+	xf86Msg(X_DEBUG, "%s: type: %d\n", __func__, wstype);
 	if (wstype != WSDISPLAY_TYPE_CRIME)
 		return FALSE;
 
-	xf86Msg(X_ERROR, "%s: CRIME found\n", __func__);
+	xf86Msg(X_INFO, "%s: CRIME found\n", __func__);
+
+	if ( xf86DoConfigure && xf86DoConfigurePass1 ) {
+		GDevPtr pGDev;
+
+		xf86Msg(X_DEBUG, "writing device section\n");
+		pGDev = xf86AddBusDeviceToConfigure(CRIME_DRIVER_NAME, BUS_NONE,
+			NULL, 0);
+		if (pGDev) {
+			/*
+			 * XF86Match???Instances() treat chipID and chipRev as
+			 * overrides, so clobber them here.
+			 */
+			xf86Msg(X_DEBUG, "clobbering chipID etc. \n");
+			pGDev->chipID = pGDev->chipRev = -1;
+	    	}
+	}
 
-	if (flags & PROBE_DETECT)
+	if (flags & PROBE_DETECT) {
 		return TRUE;
+	}
 
+	if (numDevSections > 1) {
+		xf86Msg(X_ERROR, "Ignoring additional device sections\n");
+		numDevSections = 1;
+	}
 	/* ok, at this point we know we've got a CRIME */
 	for (i = 0; i < numDevSections; i++) {
 	
-		dev = xf86FindOptionValue(devSections[i]->options, "device");
-		if ((fd = crime_open(dev)) >= 0) {
-			entity = xf86ClaimFbSlot(drv, 0, devSections[i], TRUE);
-			pScrn = xf86ConfigFbEntity(NULL,0,entity,
-						   NULL,NULL,NULL,NULL);
-			if (pScrn != NULL) {
-				foundScreen = TRUE;
-				pScrn->driverVersion = VERSION;
-				pScrn->driverName = CRIME_DRIVER_NAME;
-				pScrn->name = CRIME_NAME;
-				pScrn->Probe = CrimeProbe;
-				pScrn->PreInit = CrimePreInit;
-				pScrn->ScreenInit = CrimeScreenInit;
-				pScrn->SwitchMode = CrimeSwitchMode;
-				pScrn->AdjustFrame = NULL;
-				pScrn->EnterVT = CrimeEnterVT;
-				pScrn->LeaveVT = CrimeLeaveVT;
-				pScrn->ValidMode = CrimeValidMode;
-
-				xf86DrvMsg(pScrn->scrnIndex, X_INFO,
-				    "using %s\n", dev != NULL ? dev :
-				    "default device");
-			}
+		entity = xf86ClaimFbSlot(drv, 0, devSections[i], TRUE);
+		pScrn = xf86ConfigFbEntity(NULL, 0, entity,
+		    NULL, NULL, NULL, NULL);
+		if (pScrn != NULL) {
+			foundScreen = TRUE;
+			pScrn->driverVersion = VERSION;
+			pScrn->driverName = CRIME_DRIVER_NAME;
+			pScrn->name = CRIME_NAME;
+			pScrn->Probe = CrimeProbe;
+			pScrn->PreInit = CrimePreInit;
+			pScrn->ScreenInit = CrimeScreenInit;
+			pScrn->SwitchMode = CrimeSwitchMode;
+			pScrn->AdjustFrame = NULL;
+			pScrn->EnterVT = CrimeEnterVT;
+			pScrn->LeaveVT = CrimeLeaveVT;
+			pScrn->ValidMode = CrimeValidMode;
+
 		}
 	}
 	xfree(devSections);

Reply via email to