summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Whitwell <keith@tungstengraphics.com>2002-07-04 12:03:15 +0000
committerKeith Whitwell <keith@tungstengraphics.com>2002-07-04 12:03:15 +0000
commit24025ca5f78c15ced14490532b4410730353d2c1 (patch)
tree290d11d687621d7c4de74bb121a359a8ca890526
parentca81e1334edebb90b0528baad089fbc6df937fb6 (diff)
Fix some more pageflipping issues -- existing code was doing MMIO writestrunk-20020705
while ring was active. There is still an MMIO read in there, but I haven't seen any lockups that could be attributed to it.
-rw-r--r--linux/radeon_state.c24
1 files changed, 14 insertions, 10 deletions
diff --git a/linux/radeon_state.c b/linux/radeon_state.c
index 163a41cb..b4c5cc63 100644
--- a/linux/radeon_state.c
+++ b/linux/radeon_state.c
@@ -1078,15 +1078,18 @@ int radeon_cp_clear( struct inode *inode, struct file *filp,
static int radeon_do_init_pageflip( drm_device_t *dev )
{
drm_radeon_private_t *dev_priv = dev->dev_private;
+ RING_LOCALS;
+
DRM_DEBUG( "%s\n", __FUNCTION__ );
- dev_priv->crtc_offset = RADEON_READ( RADEON_CRTC_OFFSET );
dev_priv->crtc_offset_cntl = RADEON_READ( RADEON_CRTC_OFFSET_CNTL );
- RADEON_WRITE( RADEON_CRTC_OFFSET, dev_priv->front_offset );
- RADEON_WRITE( RADEON_CRTC_OFFSET_CNTL,
- dev_priv->crtc_offset_cntl |
- RADEON_CRTC_OFFSET_FLIP_CNTL );
+ BEGIN_RING( 4 );
+ RADEON_WAIT_UNTIL_3D_IDLE();
+ OUT_RING( CP_PACKET0( RADEON_CRTC_OFFSET_CNTL, 0 ) );
+ OUT_RING( dev_priv->crtc_offset_cntl | RADEON_CRTC_OFFSET_FLIP_CNTL );
+ ADVANCE_RING();
+
dev_priv->page_flipping = 1;
dev_priv->current_page = 0;
@@ -1100,13 +1103,14 @@ int radeon_do_cleanup_pageflip( drm_device_t *dev )
drm_radeon_private_t *dev_priv = dev->dev_private;
DRM_DEBUG( "%s\n", __FUNCTION__ );
- RADEON_WRITE( RADEON_CRTC_OFFSET, dev_priv->crtc_offset );
- RADEON_WRITE( RADEON_CRTC_OFFSET_CNTL, dev_priv->crtc_offset_cntl );
+ if (dev_priv->current_page != 0)
+ radeon_cp_dispatch_flip( dev );
+ /* FIXME: If the X server changes screen resolution, it
+ * clobbers the value of RADEON_CRTC_OFFSET_CNTL, above,
+ * leading to a flashing efect.
+ */
dev_priv->page_flipping = 0;
- dev_priv->current_page = 0;
- dev_priv->sarea_priv->pfCurrentPage = dev_priv->current_page;
-
return 0;
}