Module Name:    xsrc
Committed By:   macallan
Date:           Fri Mar  1 02:22:27 UTC 2019

Modified Files:
        xsrc/external/mit/xf86-video-suncg14/dist/src: cg14_accel.c

Log Message:
poll SX_BZ instead of SX_MT, also complain and dump register info if CG14Wait()
times out.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 \
    xsrc/external/mit/xf86-video-suncg14/dist/src/cg14_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-suncg14/dist/src/cg14_accel.c
diff -u xsrc/external/mit/xf86-video-suncg14/dist/src/cg14_accel.c:1.13 xsrc/external/mit/xf86-video-suncg14/dist/src/cg14_accel.c:1.14
--- xsrc/external/mit/xf86-video-suncg14/dist/src/cg14_accel.c:1.13	Thu Dec  7 19:23:22 2017
+++ xsrc/external/mit/xf86-video-suncg14/dist/src/cg14_accel.c	Fri Mar  1 02:22:27 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: cg14_accel.c,v 1.13 2017/12/07 19:23:22 macallan Exp $ */
+/* $NetBSD: cg14_accel.c,v 1.14 2019/03/01 02:22:27 macallan Exp $ */
 /*
  * Copyright (c) 2013 Michael Lorenz
  * All rights reserved.
@@ -69,8 +69,17 @@ static void CG14Copy8(PixmapPtr, int, in
 static inline void
 CG14Wait(Cg14Ptr p)
 {
-	/* we just wait until the instruction queue is empty */
-	while ((read_sx_reg(p, SX_CONTROL_STATUS) & SX_MT) != 0) {};
+	int bail = 10000000;
+	/* we wait for the busy bit to clear */
+	while (((read_sx_reg(p, SX_CONTROL_STATUS) & SX_BZ) != 0) &&
+	       (bail > 0)) {
+		bail--;
+	};
+	if (bail == 0) {
+		xf86Msg(X_ERROR, "SX wait for idle timed out %08x %08x\n",
+		    read_sx_reg(p, SX_CONTROL_STATUS),
+		    read_sx_reg(p, SX_ERROR));
+	}
 }
 
 static void

Reply via email to