Module Name:    src
Committed By:   mrg
Date:           Sun Oct 25 21:44:16 UTC 2015

Modified Files:
        src/sys/external/bsd/drm2/dist/drm/nouveau/core/engine/fifo:
            nouveau_engine_fifo_nvc0.c

Log Message:
don't try to wait if (cold), spin waiting for registers to clear.

same as in nouveau_engine_fifo_nve0.c 1.5.  should fix PR#50362.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 \
    
src/sys/external/bsd/drm2/dist/drm/nouveau/core/engine/fifo/nouveau_engine_fifo_nvc0.c

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

Modified files:

Index: src/sys/external/bsd/drm2/dist/drm/nouveau/core/engine/fifo/nouveau_engine_fifo_nvc0.c
diff -u src/sys/external/bsd/drm2/dist/drm/nouveau/core/engine/fifo/nouveau_engine_fifo_nvc0.c:1.4 src/sys/external/bsd/drm2/dist/drm/nouveau/core/engine/fifo/nouveau_engine_fifo_nvc0.c:1.5
--- src/sys/external/bsd/drm2/dist/drm/nouveau/core/engine/fifo/nouveau_engine_fifo_nvc0.c:1.4	Sat Feb 28 05:38:49 2015
+++ src/sys/external/bsd/drm2/dist/drm/nouveau/core/engine/fifo/nouveau_engine_fifo_nvc0.c	Sun Oct 25 21:44:16 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: nouveau_engine_fifo_nvc0.c,v 1.4 2015/02/28 05:38:49 riastradh Exp $	*/
+/*	$NetBSD: nouveau_engine_fifo_nvc0.c,v 1.5 2015/10/25 21:44:16 mrg Exp $	*/
 
 /*
  * Copyright 2012 Red Hat Inc.
@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: nouveau_engine_fifo_nvc0.c,v 1.4 2015/02/28 05:38:49 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nouveau_engine_fifo_nvc0.c,v 1.5 2015/10/25 21:44:16 mrg Exp $");
 
 #include <core/client.h>
 #include <core/handle.h>
@@ -115,17 +115,26 @@ nvc0_fifo_runlist_update(struct nvc0_fif
 	nv_wr32(priv, 0x002274, 0x01f00000 | (p >> 3));
 
 #ifdef __NetBSD__
-    {
-	int ret;
+	if (cold) {
+		uint count = 2000;
+		while (count-- > 0) {
+			if (!(nv_rd32(priv, 0x00227c) & 0x00100000))
+				break;
+			delay(1000);
+		}
+		if (count == 0)
+			nv_error(priv, "runlist update timeout\n");
+	} else {
+		int ret;
 
-	spin_lock(&priv->runlist.lock);
-	DRM_SPIN_TIMED_WAIT_NOINTR_UNTIL(ret, &priv->runlist.wait,
-	    &priv->runlist.lock, msecs_to_jiffies(2000),
-	    !(nv_rd32(priv, 0x00227c) & 0x00100000));
-	if (ret == 0)
-		nv_error(priv, "runlist update timeout\n");
-	spin_unlock(&priv->runlist.lock);
-    }
+		spin_lock(&priv->runlist.lock);
+		DRM_SPIN_TIMED_WAIT_NOINTR_UNTIL(ret, &priv->runlist.wait,
+		    &priv->runlist.lock, msecs_to_jiffies(2000),
+		    !(nv_rd32(priv, 0x00227c) & 0x00100000));
+		if (ret == 0)
+			nv_error(priv, "runlist update timeout\n");
+		spin_unlock(&priv->runlist.lock);
+	}
 #else
 	if (wait_event_timeout(priv->runlist.wait,
 			       !(nv_rd32(priv, 0x00227c) & 0x00100000),

Reply via email to