From c44982e1593075a53cc8378db58b418c5badb44f Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 3 Jul 2002 07:54:13 +0000 Subject: Merge from trunk to bsd-3-0-0-branch. --- shared-core/radeon_drv.h | 4 +++- shared-core/radeon_state.c | 7 ++++--- shared/radeon_drv.h | 4 +++- shared/radeon_state.c | 7 ++++--- 4 files changed, 14 insertions(+), 8 deletions(-) diff --git a/shared-core/radeon_drv.h b/shared-core/radeon_drv.h index 981ae20d..ae66f12e 100644 --- a/shared-core/radeon_drv.h +++ b/shared-core/radeon_drv.h @@ -458,6 +458,7 @@ extern int radeon_cp_flip( DRM_IOCTL_ARGS ); # define RADEON_CNTL_HOSTDATA_BLT 0x00009400 # define RADEON_CNTL_PAINT_MULTI 0x00009A00 # define RADEON_CNTL_BITBLT_MULTI 0x00009B00 +# define RADEON_CNTL_SET_SCISSORS 0xC0001E00 #define RADEON_CP_PACKET_MASK 0xC0000000 #define RADEON_CP_PACKET_COUNT_MASK 0x3fff0000 @@ -712,7 +713,8 @@ do { \ } while (0) #define COMMIT_RING() do { \ - RADEON_WRITE( RADEON_CP_RB_WPTR, dev_priv->ring.tail ); \ + radeon_flush_write_combine(); \ + RADEON_WRITE( RADEON_CP_RB_WPTR, dev_priv->ring.tail ); \ } while (0) #define OUT_RING( x ) do { \ diff --git a/shared-core/radeon_state.c b/shared-core/radeon_state.c index ec00b880..88f0605f 100644 --- a/shared-core/radeon_state.c +++ b/shared-core/radeon_state.c @@ -46,10 +46,9 @@ static __inline__ void radeon_emit_clip_rect( drm_radeon_private_t *dev_priv, DRM_DEBUG( " box: x1=%d y1=%d x2=%d y2=%d\n", box->x1, box->y1, box->x2, box->y2 ); - BEGIN_RING( 4 ); - OUT_RING( CP_PACKET0( RADEON_RE_TOP_LEFT, 0 ) ); + BEGIN_RING( 3 ); + OUT_RING( CP_PACKET3( RADEON_CNTL_SET_SCISSORS, 1 )); OUT_RING( (box->y1 << 16) | box->x1 ); - OUT_RING( CP_PACKET0( RADEON_RE_WIDTH_HEIGHT, 0 ) ); /* OUT_RING( ((box->y2 - 1) << 16) | (box->x2 - 1) );*/ OUT_RING( (box->y2 << 16) | box->x2 ); ADVANCE_RING(); @@ -1083,6 +1082,7 @@ static int radeon_do_init_pageflip( drm_device_t *dev ) dev_priv->page_flipping = 1; dev_priv->current_page = 0; + dev_priv->sarea_priv->pfCurrentPage = dev_priv->current_page; return 0; } @@ -1097,6 +1097,7 @@ int radeon_do_cleanup_pageflip( drm_device_t *dev ) dev_priv->page_flipping = 0; dev_priv->current_page = 0; + dev_priv->sarea_priv->pfCurrentPage = dev_priv->current_page; return 0; } diff --git a/shared/radeon_drv.h b/shared/radeon_drv.h index 981ae20d..ae66f12e 100644 --- a/shared/radeon_drv.h +++ b/shared/radeon_drv.h @@ -458,6 +458,7 @@ extern int radeon_cp_flip( DRM_IOCTL_ARGS ); # define RADEON_CNTL_HOSTDATA_BLT 0x00009400 # define RADEON_CNTL_PAINT_MULTI 0x00009A00 # define RADEON_CNTL_BITBLT_MULTI 0x00009B00 +# define RADEON_CNTL_SET_SCISSORS 0xC0001E00 #define RADEON_CP_PACKET_MASK 0xC0000000 #define RADEON_CP_PACKET_COUNT_MASK 0x3fff0000 @@ -712,7 +713,8 @@ do { \ } while (0) #define COMMIT_RING() do { \ - RADEON_WRITE( RADEON_CP_RB_WPTR, dev_priv->ring.tail ); \ + radeon_flush_write_combine(); \ + RADEON_WRITE( RADEON_CP_RB_WPTR, dev_priv->ring.tail ); \ } while (0) #define OUT_RING( x ) do { \ diff --git a/shared/radeon_state.c b/shared/radeon_state.c index ec00b880..88f0605f 100644 --- a/shared/radeon_state.c +++ b/shared/radeon_state.c @@ -46,10 +46,9 @@ static __inline__ void radeon_emit_clip_rect( drm_radeon_private_t *dev_priv, DRM_DEBUG( " box: x1=%d y1=%d x2=%d y2=%d\n", box->x1, box->y1, box->x2, box->y2 ); - BEGIN_RING( 4 ); - OUT_RING( CP_PACKET0( RADEON_RE_TOP_LEFT, 0 ) ); + BEGIN_RING( 3 ); + OUT_RING( CP_PACKET3( RADEON_CNTL_SET_SCISSORS, 1 )); OUT_RING( (box->y1 << 16) | box->x1 ); - OUT_RING( CP_PACKET0( RADEON_RE_WIDTH_HEIGHT, 0 ) ); /* OUT_RING( ((box->y2 - 1) << 16) | (box->x2 - 1) );*/ OUT_RING( (box->y2 << 16) | box->x2 ); ADVANCE_RING(); @@ -1083,6 +1082,7 @@ static int radeon_do_init_pageflip( drm_device_t *dev ) dev_priv->page_flipping = 1; dev_priv->current_page = 0; + dev_priv->sarea_priv->pfCurrentPage = dev_priv->current_page; return 0; } @@ -1097,6 +1097,7 @@ int radeon_do_cleanup_pageflip( drm_device_t *dev ) dev_priv->page_flipping = 0; dev_priv->current_page = 0; + dev_priv->sarea_priv->pfCurrentPage = dev_priv->current_page; return 0; } -- cgit v1.2.3