mirror of
https://gitlab.freedesktop.org/mesa/drm.git
synced 2026-05-09 12:08:05 +02:00
- Enable client-side throttling again.
- Work around CCE start/stop/reset issues for now.
This commit is contained in:
parent
4f1b6b9f2b
commit
ce71d0abb9
4 changed files with 34 additions and 15 deletions
|
|
@ -490,8 +490,11 @@ static int r128_do_init_cce( drm_device_t *dev, drm_r128_init_t *init )
|
|||
dev_priv->ring.tail_mask =
|
||||
(dev_priv->ring.size / sizeof(u32)) - 1;
|
||||
|
||||
dev_priv->submit_age = 0;
|
||||
R128_WRITE( R128_VB_AGE_REG, dev_priv->submit_age );
|
||||
dev_priv->sarea_priv->last_frame = 0;
|
||||
R128_WRITE( R128_LAST_FRAME_REG, dev_priv->sarea_priv->last_frame );
|
||||
|
||||
dev_priv->sarea_priv->last_dispatch = 0;
|
||||
R128_WRITE( R128_LAST_VB_REG, dev_priv->sarea_priv->last_dispatch );
|
||||
|
||||
r128_cce_init_ring_buffer( dev );
|
||||
r128_cce_load_microcode( dev_priv );
|
||||
|
|
@ -555,6 +558,8 @@ int r128_cce_start( struct inode *inode, struct file *filp,
|
|||
DRM_ERROR( "r128_cce_start called without lock held\n" );
|
||||
return -EINVAL;
|
||||
}
|
||||
if ( !dev_priv )
|
||||
return -EINVAL;
|
||||
|
||||
if ( dev_priv->cce_running || dev_priv->cce_mode == R128_PM4_NONPM4 )
|
||||
return 0;
|
||||
|
|
@ -577,6 +582,8 @@ int r128_cce_stop( struct inode *inode, struct file *filp,
|
|||
DRM_ERROR( "r128_cce_stop called without lock held\n" );
|
||||
return -EINVAL;
|
||||
}
|
||||
if ( !dev_priv )
|
||||
return -EINVAL;
|
||||
|
||||
if ( !dev_priv->cce_running || dev_priv->cce_mode == R128_PM4_NONPM4 )
|
||||
return 0;
|
||||
|
|
@ -609,6 +616,8 @@ int r128_cce_reset( struct inode *inode, struct file *filp,
|
|||
DRM_ERROR( "r128_cce_reset called without lock held\n" );
|
||||
return -EINVAL;
|
||||
}
|
||||
if ( !dev_priv )
|
||||
return -EINVAL;
|
||||
|
||||
if ( !dev_priv->cce_running || dev_priv->cce_mode == R128_PM4_NONPM4 )
|
||||
return 0;
|
||||
|
|
@ -686,7 +695,7 @@ drm_buf_t *r128_freelist_get( drm_device_t *dev )
|
|||
}
|
||||
|
||||
for ( t = 0 ; t < dev_priv->usec_timeout ; t++ ) {
|
||||
u32 done_age = R128_READ( R128_VB_AGE_REG );
|
||||
u32 done_age = R128_READ( R128_LAST_VB_REG );
|
||||
|
||||
for ( i = 0 ; i < dma->buf_count ; i++ ) {
|
||||
buf = dma->buflist[i];
|
||||
|
|
|
|||
|
|
@ -134,9 +134,16 @@ typedef struct drm_r128_sarea {
|
|||
unsigned int vertsize;
|
||||
unsigned int vc_format;
|
||||
|
||||
/* The current cliprects, or a subset thereof.
|
||||
*/
|
||||
drm_clip_rect_t boxes[R128_NR_SAREA_CLIPRECTS];
|
||||
unsigned int nbox;
|
||||
|
||||
/* Counters for client-side throttling of rendering clients.
|
||||
*/
|
||||
unsigned int last_frame;
|
||||
unsigned int last_dispatch;
|
||||
|
||||
drm_tex_region_t tex_list[R128_NR_TEX_HEAPS][R128_NR_TEX_REGIONS+1];
|
||||
int tex_age[R128_NR_TEX_HEAPS];
|
||||
int ctx_owner;
|
||||
|
|
|
|||
|
|
@ -63,8 +63,6 @@ typedef struct drm_r128_private {
|
|||
drm_r128_freelist_t *head;
|
||||
drm_r128_freelist_t *tail;
|
||||
|
||||
unsigned int submit_age;
|
||||
|
||||
int usec_timeout;
|
||||
int is_pci;
|
||||
|
||||
|
|
@ -346,8 +344,9 @@ extern int r128_context_switch_complete(drm_device_t *dev, int new);
|
|||
|
||||
#define R128_MAX_USEC_TIMEOUT 100000 /* 100 ms */
|
||||
|
||||
#define R128_MAX_VB_AGE 0xffffffff
|
||||
#define R128_VB_AGE_REG R128_GUI_SCRATCH_REG0
|
||||
#define R128_LAST_FRAME_REG R128_GUI_SCRATCH_REG0
|
||||
#define R128_LAST_VB_REG R128_GUI_SCRATCH_REG1
|
||||
#define R128_MAX_VB_AGE 0xffffffff
|
||||
|
||||
|
||||
#define R128_BASE(reg) ((unsigned long)(dev_priv->mmio->handle))
|
||||
|
|
|
|||
|
|
@ -477,14 +477,18 @@ static void r128_cce_dispatch_swap( drm_device_t *dev )
|
|||
ADVANCE_RING();
|
||||
}
|
||||
|
||||
#if 0
|
||||
/* Increment the frame counter. The client-side 3D driver must
|
||||
* throttle the framerate by waiting for this value before
|
||||
* performing the swapbuffer ioctl.
|
||||
*/
|
||||
dev_priv->sarea_priv->last_frame++;
|
||||
|
||||
BEGIN_RING( 2 );
|
||||
|
||||
OUT_RING( CCE_PACKET0( R128_SWAP_AGE_REG, 0 ) );
|
||||
OUT_RING( r128ctx->lastSwapAge );
|
||||
OUT_RING( CCE_PACKET0( R128_LAST_FRAME_REG, 0 ) );
|
||||
OUT_RING( dev_priv->sarea_priv->last_frame );
|
||||
|
||||
ADVANCE_RING();
|
||||
#endif
|
||||
}
|
||||
|
||||
static void r128_cce_dispatch_vertex( drm_device_t *dev,
|
||||
|
|
@ -552,8 +556,8 @@ static void r128_cce_dispatch_vertex( drm_device_t *dev,
|
|||
/* Emit the vertex buffer age */
|
||||
BEGIN_RING( 2 );
|
||||
|
||||
OUT_RING( CCE_PACKET0( R128_VB_AGE_REG, 0 ) );
|
||||
OUT_RING( dev_priv->submit_age );
|
||||
OUT_RING( CCE_PACKET0( R128_LAST_VB_REG, 0 ) );
|
||||
OUT_RING( dev_priv->sarea_priv->last_dispatch );
|
||||
|
||||
ADVANCE_RING();
|
||||
|
||||
|
|
@ -561,10 +565,10 @@ static void r128_cce_dispatch_vertex( drm_device_t *dev,
|
|||
|
||||
/* FIXME: Check dispatched field */
|
||||
buf_priv->dispatched = 0;
|
||||
buf_priv->age = dev_priv->submit_age;
|
||||
buf_priv->age = dev_priv->sarea_priv->last_dispatch;
|
||||
}
|
||||
|
||||
dev_priv->submit_age++;
|
||||
dev_priv->sarea_priv->last_dispatch++;
|
||||
|
||||
#if 0
|
||||
if ( dev_priv->submit_age == R128_MAX_VB_AGE ) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue