Module Name:    xsrc
Committed By:   macallan
Date:           Thu May 20 07:55:20 UTC 2010

Modified Files:
        xsrc/external/mit/xf86-video-igs/dist/src: igs.h igs_accel.c
            igs_driver.c

Log Message:
pick up some nits accidentially left in:
- get rid of usleep() while waiting for the blitter - way too crude
- sanitize some register writes
since last time I looked at this some other problem crept in - we now have
syncing issues with text drawing


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 xsrc/external/mit/xf86-video-igs/dist/src/igs.h \
    xsrc/external/mit/xf86-video-igs/dist/src/igs_driver.c
cvs rdiff -u -r1.2 -r1.3 \
    xsrc/external/mit/xf86-video-igs/dist/src/igs_accel.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-igs/dist/src/igs.h
diff -u xsrc/external/mit/xf86-video-igs/dist/src/igs.h:1.1 xsrc/external/mit/xf86-video-igs/dist/src/igs.h:1.2
--- xsrc/external/mit/xf86-video-igs/dist/src/igs.h:1.1	Tue Nov 10 21:39:45 2009
+++ xsrc/external/mit/xf86-video-igs/dist/src/igs.h	Thu May 20 07:55:19 2010
@@ -1,5 +1,5 @@
 /* $OpenBSD: wsfb_driver.c,v 1.18 2003/04/02 16:42:13 jason Exp $ */
-/* $NetBSD: igs.h,v 1.1 2009/11/10 21:39:45 macallan Exp $ */
+/* $NetBSD: igs.h,v 1.2 2010/05/20 07:55:19 macallan Exp $ */
 /*
  * Copyright (c) 2001 Matthieu Herrb
  *		 2009 Michael Lorenz
@@ -57,7 +57,7 @@
 	int			fd; /* file descriptor of open device */
 	struct wsdisplay_fbinfo info; /* frame buffer characteristics */
 	int			linebytes; /* number of bytes per row */
-	uint8_t			*reg;
+	volatile uint8_t	*reg;
 	unsigned char*		fbstart;
 	unsigned char*		fbmem;
 	size_t			fbmem_len;
@@ -81,6 +81,7 @@
 	int			nDGAMode;
 #endif
 	OptionInfoPtr		Options;
+	uint8_t			mapfmt;
 } IgsRec, *IgsPtr;
 
 #define IGSPTR(p) ((IgsPtr)((p)->driverPrivate))
Index: xsrc/external/mit/xf86-video-igs/dist/src/igs_driver.c
diff -u xsrc/external/mit/xf86-video-igs/dist/src/igs_driver.c:1.1 xsrc/external/mit/xf86-video-igs/dist/src/igs_driver.c:1.2
--- xsrc/external/mit/xf86-video-igs/dist/src/igs_driver.c:1.1	Tue Nov 10 21:39:45 2009
+++ xsrc/external/mit/xf86-video-igs/dist/src/igs_driver.c	Thu May 20 07:55:20 2010
@@ -1,5 +1,5 @@
 /* $OpenBSD: wsfb_driver.c,v 1.19 2003/04/27 16:42:32 matthieu Exp $ */
-/* $NetBSD: igs_driver.c,v 1.1 2009/11/10 21:39:45 macallan Exp $ */
+/* $NetBSD: igs_driver.c,v 1.2 2010/05/20 07:55:20 macallan Exp $ */
 /*
  * Copyright (c) 2001 Matthieu Herrb
  *		 2009 Michael Lorenz
@@ -416,7 +416,7 @@
 IgsPreInit(ScrnInfoPtr pScrn, int flags)
 {
 	IgsPtr fPtr;
-	int default_depth, vram_size;
+	int default_depth, vram_size = 2 * 1024 * 1024;
 	char *dev, *s;
 	char *mod = NULL;
 	const char *reqSym = NULL;

Index: xsrc/external/mit/xf86-video-igs/dist/src/igs_accel.c
diff -u xsrc/external/mit/xf86-video-igs/dist/src/igs_accel.c:1.2 xsrc/external/mit/xf86-video-igs/dist/src/igs_accel.c:1.3
--- xsrc/external/mit/xf86-video-igs/dist/src/igs_accel.c:1.2	Sat Nov 21 22:22:27 2009
+++ xsrc/external/mit/xf86-video-igs/dist/src/igs_accel.c	Thu May 20 07:55:20 2010
@@ -21,7 +21,7 @@
  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  */
 
-/* $NetBSD: igs_accel.c,v 1.2 2009/11/21 22:22:27 macallan Exp $ */
+/* $NetBSD: igs_accel.c,v 1.3 2010/05/20 07:55:20 macallan Exp $ */
 
 #include <sys/types.h>
 
@@ -71,12 +71,12 @@
 	int bail = 0x0fffffff;
 
 	ENTER;
-	IgsWrite1(fPtr, IGS_COP_MAP_FMT_REG, (fPtr->info.depth >> 3) - 1);
+	IgsWrite1(fPtr, IGS_COP_MAP_FMT_REG, fPtr->mapfmt);
 	while ((IgsRead1(fPtr,
 	    IGS_COP_CTL_REG) & (IGS_COP_CTL_BUSY | IGS_COP_CTL_HFEMPTZ) != 0)
 	    && (bail > 0)) {
 		bail--;
-		usleep(1);
+		IgsWrite1(fPtr, IGS_COP_MAP_FMT_REG, fPtr->mapfmt);
 	}
 
 	/* reset the coprocessor if we run into a timeout */
@@ -100,12 +100,12 @@
 	int bail = 0x0fffffff;
 
 	ENTER;
-	IgsWrite1(fPtr, IGS_COP_MAP_FMT_REG, (fPtr->info.depth >> 3) - 1);
+	IgsWrite1(fPtr, IGS_COP_MAP_FMT_REG, fPtr->mapfmt);
 	while (((IgsRead1(fPtr,
 	    IGS_COP_CTL_REG) & (IGS_COP_CTL_BUSY | IGS_COP_CTL_HFEMPTZ)) != 0)
 	    && (bail > 0)) {
 		bail--;
-		usleep(1);
+		IgsWrite1(fPtr, IGS_COP_MAP_FMT_REG, fPtr->mapfmt);
 	}
 
 	/* reset the coprocessor if we run into a timeout */
@@ -261,12 +261,14 @@
 	int    dst_pitch  = exaGetPixmapPitch(pDst);
 
 	int bpp    = pDst->drawable.bitsPerPixel;
-	int cpp    = (bpp + 7) / 8;
+	int cpp    = (bpp + 7) >> 3;
 	int wBytes = w * cpp;
 
 	ENTER;
 	dst += (x * cpp) + (y * dst_pitch);
 
+	IgsWaitReady(fPtr);
+
 	while (h--) {
 		memcpy(dst, src, wBytes);
 		src += src_pitch;
@@ -289,12 +291,14 @@
 	int    src_pitch  = exaGetPixmapPitch(pSrc);
 
 	int bpp    = pSrc->drawable.bitsPerPixel;
-	int cpp    = (bpp + 7) / 8;
+	int cpp    = (bpp + 7) >> 3;
 	int wBytes = w * cpp;
 
 	ENTER;
 	src += (x * cpp) + (y * src_pitch);
 
+	IgsWaitReady(fPtr);
+
 	while (h--) {
 		memcpy(dst, src, wBytes);
 		src += src_pitch;
@@ -343,14 +347,22 @@
 	switch(fPtr->info.depth) {
 		case 8:
 			fPtr->shift = 0;
+			fPtr->mapfmt = IGS_COP_MAP_8BPP;
 			break;
 		case 16:
 			fPtr->shift = 1;
+			fPtr->mapfmt = IGS_COP_MAP_16BPP;
 			break;
+		case 24:
 		case 32:
 			fPtr->shift = 2;
+			fPtr->mapfmt = IGS_COP_MAP_32BPP;
 			break;
+		default:	
+			ErrorF("Unsupported depth: %d\n", fPtr->info.depth);
 	}
+	IgsWrite1(fPtr, IGS_COP_MAP_FMT_REG, fPtr->mapfmt);
+
 	/* EXA hits more optimized paths when it does not have to fallback 
 	 * because of missing UTS/DFS, hook memcpy-based UTS/DFS.
 	 */

Reply via email to