summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGareth Hughes <gareth@users.sourceforge.net>2000-11-30 01:29:52 +0000
committerGareth Hughes <gareth@users.sourceforge.net>2000-11-30 01:29:52 +0000
commitaa1a793f55a3d1b723e9bf3bfffb25bf97530753 (patch)
treef050e26de294d66addff730c1a9d08c5211e5266
parent1f86294ff77ec1ca3a9969f470e5c7c0d085f1a3 (diff)
- Revert texture LRU changes back to 4.0.1 code for now.
- Fix GL_BLEND implementation, correctly fall back to software rendering when required. - Depth buffer tiling for up to 60% performance boost. Need to fix depth span functions as a result. - Fixed scissor. Again. I mean it this time...
-rw-r--r--linux/r128_cce.c10
-rw-r--r--linux/r128_drv.h5
-rw-r--r--linux/r128_state.c136
3 files changed, 36 insertions, 115 deletions
diff --git a/linux/r128_cce.c b/linux/r128_cce.c
index f3358337..cab9acd6 100644
--- a/linux/r128_cce.c
+++ b/linux/r128_cce.c
@@ -450,6 +450,14 @@ static int r128_do_init_cce( drm_device_t *dev, drm_r128_init_t *init )
dev_priv->depth_x = init->depth_x;
dev_priv->depth_y = init->depth_y;
+ dev_priv->front_pitch_offset_c = (((dev_priv->front_pitch/8) << 21) |
+ (dev_priv->front_offset >> 5));
+ dev_priv->back_pitch_offset_c = (((dev_priv->back_pitch/8) << 21) |
+ (dev_priv->back_offset >> 5));
+ dev_priv->depth_pitch_offset_c = (((dev_priv->depth_pitch/8) << 21) |
+ (dev_priv->depth_offset >> 5) |
+ R128_DST_TILE);
+
/* FIXME: We want multiple shared areas, including one shared
* only by the X Server and kernel module.
*/
@@ -821,8 +829,10 @@ void r128_update_ring_snapshot( drm_r128_private_t *dev_priv )
drm_r128_ring_buffer_t *ring = &dev_priv->ring;
ring->space = *ring->head - ring->tail;
+#if R128_PERFORMANCE_BOXES
if ( ring->space == 0 )
atomic_inc( &dev_priv->idle_count );
+#endif
if ( ring->space <= 0 )
ring->space += ring->size;
}
diff --git a/linux/r128_drv.h b/linux/r128_drv.h
index 7ada6e5b..1aa6bde5 100644
--- a/linux/r128_drv.h
+++ b/linux/r128_drv.h
@@ -86,6 +86,10 @@ typedef struct drm_r128_private {
unsigned int depth_x;
unsigned int depth_y;
+ u32 front_pitch_offset_c;
+ u32 back_pitch_offset_c;
+ u32 depth_pitch_offset_c;
+
drm_map_t *sarea;
drm_map_t *fb;
drm_map_t *mmio;
@@ -232,6 +236,7 @@ extern int r128_context_switch_complete(drm_device_t *dev, int new);
# define R128_ROP3_P 0x00f00000
#define R128_DP_WRITE_MASK 0x16cc
#define R128_DST_PITCH_OFFSET_C 0x1c80
+# define R128_DST_TILE (1 << 31)
#define R128_GEN_RESET_CNTL 0x00f0
# define R128_SOFT_RESET_GUI (1 << 0)
diff --git a/linux/r128_state.c b/linux/r128_state.c
index 9694c4c7..6671518f 100644
--- a/linux/r128_state.c
+++ b/linux/r128_state.c
@@ -33,8 +33,6 @@
#include "r128_drv.h"
#include "drm.h"
-#define USE_OLD_BLITS 1
-
/* ================================================================
* CCE hardware state programming functions
@@ -424,76 +422,6 @@ static void r128_cce_dispatch_clear( drm_device_t *dev,
ADVANCE_RING();
}
-#if USE_OLD_BLITS
- if ( flags & R128_FRONT ) {
- int fx = x + dev_priv->front_x;
- int fy = y + dev_priv->front_y;
-
- DRM_DEBUG( "clear front: x=%d y=%d\n",
- dev_priv->front_x, dev_priv->front_y );
- BEGIN_RING( 5 );
-
- OUT_RING( CCE_PACKET3( R128_CNTL_PAINT_MULTI, 3 ) );
- OUT_RING( R128_GMC_BRUSH_SOLID_COLOR
- | fb_bpp
- | R128_GMC_SRC_DATATYPE_COLOR
- | R128_ROP3_P
- | R128_GMC_CLR_CMP_CNTL_DIS
- | R128_GMC_AUX_CLIP_DIS );
- OUT_RING( clear_color );
- OUT_RING( (fx << 16) | fy );
- OUT_RING( (w << 16) | h );
-
- ADVANCE_RING();
- }
-
- if ( flags & R128_BACK ) {
- int bx = x + dev_priv->back_x;
- int by = y + dev_priv->back_y;
-
- DRM_DEBUG( "clear back: x=%d y=%d\n",
- dev_priv->back_x, dev_priv->back_y );
- BEGIN_RING( 5 );
-
- OUT_RING( CCE_PACKET3( R128_CNTL_PAINT_MULTI, 3 ) );
- OUT_RING( R128_GMC_BRUSH_SOLID_COLOR
- | fb_bpp
- | R128_GMC_SRC_DATATYPE_COLOR
- | R128_ROP3_P
- | R128_GMC_CLR_CMP_CNTL_DIS
- | R128_GMC_AUX_CLIP_DIS );
- OUT_RING( clear_color );
- OUT_RING( (bx << 16) | by );
- OUT_RING( (w << 16) | h );
-
- ADVANCE_RING();
- }
-
- if ( flags & R128_DEPTH ) {
- int dx = x + dev_priv->depth_x;
- int dy = y + dev_priv->depth_y;
-
- DRM_DEBUG( "clear depth: x=%d y=%d\n",
- dev_priv->depth_x, dev_priv->depth_y );
- BEGIN_RING( 7 );
-
- OUT_RING( CCE_PACKET0( R128_DP_WRITE_MASK, 0 ) );
- OUT_RING( depth_mask );
-
- OUT_RING( CCE_PACKET3( R128_CNTL_PAINT_MULTI, 3 ) );
- OUT_RING( R128_GMC_BRUSH_SOLID_COLOR
- | depth_bpp
- | R128_GMC_SRC_DATATYPE_COLOR
- | R128_ROP3_P
- | R128_GMC_CLR_CMP_CNTL_DIS
- | R128_GMC_AUX_CLIP_DIS );
- OUT_RING( clear_depth );
- OUT_RING( (dx << 16) | dy );
- OUT_RING( (w << 16) | h );
-
- ADVANCE_RING();
- }
-#else
if ( flags & R128_FRONT ) {
BEGIN_RING( 6 );
@@ -506,8 +434,7 @@ static void r128_cce_dispatch_clear( drm_device_t *dev,
| R128_GMC_CLR_CMP_CNTL_DIS
| R128_GMC_AUX_CLIP_DIS );
- OUT_RING( ((dev_priv->front_pitch/8) << 21) |
- (dev_priv->front_offset >> 5) );
+ OUT_RING( dev_priv->front_pitch_offset_c );
OUT_RING( clear_color );
OUT_RING( (x << 16) | y );
@@ -528,8 +455,7 @@ static void r128_cce_dispatch_clear( drm_device_t *dev,
| R128_GMC_CLR_CMP_CNTL_DIS
| R128_GMC_AUX_CLIP_DIS );
- OUT_RING( ((dev_priv->back_pitch/8) << 21) |
- (dev_priv->back_offset >> 5) );
+ OUT_RING( dev_priv->back_pitch_offset_c );
OUT_RING( clear_color );
OUT_RING( (x << 16) | y );
@@ -553,8 +479,7 @@ static void r128_cce_dispatch_clear( drm_device_t *dev,
| R128_GMC_CLR_CMP_CNTL_DIS
| R128_GMC_AUX_CLIP_DIS );
- OUT_RING( ((dev_priv->depth_pitch/8) << 21) |
- (dev_priv->depth_offset >> 5) );
+ OUT_RING( dev_priv->depth_pitch_offset_c );
OUT_RING( clear_depth );
OUT_RING( (x << 16) | y );
@@ -562,7 +487,6 @@ static void r128_cce_dispatch_clear( drm_device_t *dev,
ADVANCE_RING();
}
-#endif
}
}
@@ -599,35 +523,11 @@ static void r128_cce_dispatch_swap( drm_device_t *dev )
}
for ( i = 0 ; i < nbox ; i++ ) {
- int fx = pbox[i].x1;
- int fy = pbox[i].y1;
- int fw = pbox[i].x2 - fx;
- int fh = pbox[i].y2 - fy;
-#if USE_OLD_BLITS
- int bx = fx + dev_priv->back_x;
- int by = fy + dev_priv->back_y;
-
- fx += dev_priv->front_x;
- fy += dev_priv->front_x;
-
- BEGIN_RING( 5 );
-
- OUT_RING( CCE_PACKET3( R128_CNTL_BITBLT_MULTI, 3 ) );
- OUT_RING( R128_GMC_BRUSH_NONE
- | R128_GMC_SRC_DATATYPE_COLOR
- | R128_DP_SRC_SOURCE_MEMORY
- | fb_bpp
- | R128_ROP3_S
- | R128_GMC_CLR_CMP_CNTL_DIS
- | R128_GMC_AUX_CLIP_DIS
- | R128_GMC_WR_MSK_DIS );
-
- OUT_RING( (bx << 16) | by );
- OUT_RING( (fx << 16) | fy );
- OUT_RING( (fw << 16) | fh );
+ int x = pbox[i].x1;
+ int y = pbox[i].y1;
+ int w = pbox[i].x2 - x;
+ int h = pbox[i].y2 - y;
- ADVANCE_RING();
-#else
BEGIN_RING( 7 );
OUT_RING( CCE_PACKET3( R128_CNTL_BITBLT_MULTI, 5 ) );
@@ -642,17 +542,23 @@ static void r128_cce_dispatch_swap( drm_device_t *dev )
| R128_GMC_AUX_CLIP_DIS
| R128_GMC_WR_MSK_DIS );
- OUT_RING( ((dev_priv->back_pitch/8) << 21) |
- (dev_priv->back_offset >> 5) );
- OUT_RING( ((dev_priv->front_pitch/8) << 21) |
- (dev_priv->front_offset >> 5) );
+#if 1
+ OUT_RING( dev_priv->back_pitch_offset_c );
+ OUT_RING( dev_priv->front_pitch_offset_c );
- OUT_RING( (fx << 16) | fy );
- OUT_RING( (fx << 16) | fy );
- OUT_RING( (fw << 16) | fh );
+ OUT_RING( (x << 16) | y );
+ OUT_RING( (x << 16) | y );
+ OUT_RING( (w << 16) | h );
+#else
+ OUT_RING( dev_priv->depth_pitch_offset_c & ~R128_DST_TILE );
+ OUT_RING( dev_priv->front_pitch_offset_c );
- ADVANCE_RING();
+ OUT_RING( (0 << 16) | 0 );
+ OUT_RING( (0 << 16) | 0 );
+ OUT_RING( (1024 << 16) | 768 );
#endif
+
+ ADVANCE_RING();
}
/* Increment the frame counter. The client-side 3D driver must