Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[xsrc/trunk]: xsrc/external/mit/xf86-video-suncg14/dist/src poll SX_BZ instea...



details:   https://anonhg.NetBSD.org/xsrc/rev/4613b9efb77a
branches:  trunk
changeset: 10108:4613b9efb77a
user:      macallan <macallan%NetBSD.org@localhost>
date:      Fri Mar 01 02:22:27 2019 +0000

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

diffstat:

 external/mit/xf86-video-suncg14/dist/src/cg14_accel.c |  15 ++++++++++++---
 1 files changed, 12 insertions(+), 3 deletions(-)

diffs (29 lines):

diff -r 7c019b55e23f -r 4613b9efb77a external/mit/xf86-video-suncg14/dist/src/cg14_accel.c
--- a/external/mit/xf86-video-suncg14/dist/src/cg14_accel.c     Wed Feb 06 16:38:23 2019 +0000
+++ b/external/mit/xf86-video-suncg14/dist/src/cg14_accel.c     Fri Mar 01 02:22:27 2019 +0000
@@ -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 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



Home | Main Index | Thread Index | Old Index