summaryrefslogtreecommitdiff
path: root/shared-core/radeon_state.c
diff options
context:
space:
mode:
authorKeith Whitwell <keith@tungstengraphics.com>2002-08-26 20:02:26 +0000
committerKeith Whitwell <keith@tungstengraphics.com>2002-08-26 20:02:26 +0000
commitc3d2e90cc79c1b942e184c2dfb708965b38bb344 (patch)
tree846393b13f57e987a9085302901e7568e731a1a4 /shared-core/radeon_state.c
parentc9d387a04851a543dcb0e683dd17006752a07fc3 (diff)
merged trunk into branchr200-0-1-20020822r200-0-1-branch
Diffstat (limited to 'shared-core/radeon_state.c')
-rw-r--r--shared-core/radeon_state.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/shared-core/radeon_state.c b/shared-core/radeon_state.c
index 7b2dbdfb..7f84e739 100644
--- a/shared-core/radeon_state.c
+++ b/shared-core/radeon_state.c
@@ -1936,6 +1936,19 @@ static int radeon_emit_packet3_cliprect( drm_device_t *dev,
if ( i < cmdbuf->nbox ) {
if (DRM_COPY_FROM_USER_UNCHECKED( &box, &boxes[i], sizeof(box) ))
return DRM_ERR(EFAULT);
+ /* FIXME The second and subsequent times round this loop, send a
+ * WAIT_UNTIL_3D_IDLE before calling emit_clip_rect(). This
+ * fixes a lockup on fast machines when sending several
+ * cliprects with a cmdbuf, as when waving a 2D window over
+ * a 3D window. Something in the commands from user space
+ * seems to hang the card when they're sent several times
+ * in a row. That would be the correct place to fix it but
+ * this works around it until I can figure that out - Tim Smith */
+ if ( i ) {
+ BEGIN_RING( 2 );
+ RADEON_WAIT_UNTIL_3D_IDLE();
+ ADVANCE_RING();
+ }
radeon_emit_clip_rect( dev_priv, &box );
}
@@ -1944,7 +1957,6 @@ static int radeon_emit_packet3_cliprect( drm_device_t *dev,
ADVANCE_RING();
} while ( ++i < cmdbuf->nbox );
-
if (cmdbuf->nbox == 1)
cmdbuf->nbox = 0;
@@ -2107,14 +2119,14 @@ int radeon_cp_getparam( DRM_IOCTL_ARGS )
break;
case RADEON_PARAM_LAST_FRAME:
dev_priv->stats.last_frame_reads++;
- value = DRM_READ32(&dev_priv->scratch[0]);
+ value = GET_SCRATCH( 0 );
break;
case RADEON_PARAM_LAST_DISPATCH:
- value = DRM_READ32(&dev_priv->scratch[1]);
+ value = GET_SCRATCH( 1 );
break;
case RADEON_PARAM_LAST_CLEAR:
dev_priv->stats.last_clear_reads++;
- value = DRM_READ32(&dev_priv->scratch[2]);
+ value = GET_SCRATCH( 2 );
break;
default:
return DRM_ERR(EINVAL);