pkgsrc-wip/xorg-server-snap/nbsd-r300-lockup-fix-test.diff
Blair Sadewitz 9c5c436bb3 Added a few more bug fixes from GIT, plus a possible fix for r300 problems
from the mailing list.  One part of the fix is in patches/patch-bo, the
other--for the kernel--is in the diff you see above this message.

Feedback is welcome so that  I know how much of this morass of patches
I can consolidate, etc.
2007-07-25 19:38:29 +00:00

97 lines
2.4 KiB
Diff

Index: sys/dev/pci/drm/radeon_cp.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/drm/radeon_cp.c,v
retrieving revision 1.3
diff -u -d -r1.3 radeon_cp.c
--- sys/dev/pci/drm/radeon_cp.c 21 Mar 2007 22:44:28 -0000 1.3
+++ sys/dev/pci/drm/radeon_cp.c 25 Jul 2007 19:34:27 -0000
@@ -1922,7 +1922,7 @@
drm_radeon_private_t *dev_priv = dev->dev_private;
DRM_DEBUG("\n");
- LOCK_TEST_WITH_RETURN(dev, filp);
+ LOCK_TEST_WITH_RETURN(dev, filp); /* XXX causes lockups on r300 */
if (!dev_priv) {
DRM_DEBUG("%s called before init done\n", __FUNCTION__);
@@ -1942,9 +1942,9 @@
DRM_DEVICE;
drm_radeon_private_t *dev_priv = dev->dev_private;
DRM_DEBUG("\n");
-
- LOCK_TEST_WITH_RETURN(dev, filp);
-
+#if 0
+ LOCK_TEST_WITH_RETURN(dev, filp);
+#endif
return radeon_do_cp_idle(dev_priv);
}
@@ -1961,9 +1961,9 @@
{
DRM_DEVICE;
DRM_DEBUG("\n");
-
+#if 0
LOCK_TEST_WITH_RETURN(dev, filp);
-
+#endif
return radeon_do_engine_reset(dev);
}
@@ -2155,9 +2155,9 @@
int ret = 0;
drm_dma_t __user *argp = (void __user *)data;
drm_dma_t d;
-
+#if 0
LOCK_TEST_WITH_RETURN(dev, filp);
-
+#endif
DRM_COPY_FROM_USER_IOCTL(d, argp, sizeof(d));
/* Please don't send us buffers.
Index: sys/dev/pci/drm/radeon_state.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/drm/radeon_state.c,v
retrieving revision 1.3
diff -u -d -r1.3 radeon_state.c
--- sys/dev/pci/drm/radeon_state.c 22 Mar 2007 01:36:42 -0000 1.3
+++ sys/dev/pci/drm/radeon_state.c 25 Jul 2007 19:34:27 -0000
@@ -2386,8 +2386,9 @@
drm_radeon_indirect_t indirect;
RING_LOCALS;
+#if 0 /* lockup fix for r300 */
LOCK_TEST_WITH_RETURN(dev, filp);
-
+#endif
if (!dev_priv) {
DRM_ERROR("%s called with no initialization\n", __FUNCTION__);
return DRM_ERR(EINVAL);
@@ -2812,6 +2813,7 @@
drm_radeon_cmd_header_t header;
int orig_nbox, orig_bufsz;
char *kbuf = NULL;
+ RING_LOCALS;
LOCK_TEST_WITH_RETURN(dev, filp);
@@ -2852,6 +2854,17 @@
orig_nbox = cmdbuf.nbox;
+#if 1 /* r300 lockup fix */
+
+ /* Wait for the engine to idle before the indirect buffer
+ * is processed.
+ */
+
+ BEGIN_RING(2);
+ RADEON_WAIT_UNTIL_IDLE();
+ ADVANCE_RING();
+#endif
+
if (dev_priv->microcode_version == UCODE_R300) {
int temp;
temp = r300_do_cp_cmdbuf(dev, filp, filp_priv, &cmdbuf);