summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/r200/r200_ioctl.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2006-03-31 15:48:04 +0000
committerBrian Paul <[email protected]>2006-03-31 15:48:04 +0000
commitf2ad1b60c0da11283b399008f491792790cea294 (patch)
treeed81cb738dd06f961713fb9e34827a3b57832cca /src/mesa/drivers/dri/r200/r200_ioctl.c
parentdf3d4e0bb9ce40b3380734cf4f209a7363d5dcfd (diff)
Dave Reveman's patch for GLX_MESA_copy_sub_buffer support
Diffstat (limited to 'src/mesa/drivers/dri/r200/r200_ioctl.c')
-rw-r--r--src/mesa/drivers/dri/r200/r200_ioctl.c56
1 files changed, 41 insertions, 15 deletions
diff --git a/src/mesa/drivers/dri/r200/r200_ioctl.c b/src/mesa/drivers/dri/r200/r200_ioctl.c
index 5a2f7e2ad61..ae0f35cb398 100644
--- a/src/mesa/drivers/dri/r200/r200_ioctl.c
+++ b/src/mesa/drivers/dri/r200/r200_ioctl.c
@@ -420,7 +420,8 @@ static void r200WaitForFrameCompletion( r200ContextPtr rmesa )
/* Copy the back color buffer to the front color buffer.
*/
-void r200CopyBuffer( const __DRIdrawablePrivate *dPriv )
+void r200CopyBuffer( const __DRIdrawablePrivate *dPriv,
+ const drm_clip_rect_t *rect)
{
r200ContextPtr rmesa;
GLint nbox, i, ret;
@@ -446,9 +447,12 @@ void r200CopyBuffer( const __DRIdrawablePrivate *dPriv )
* request at a time.
*/
r200WaitForFrameCompletion( rmesa );
- UNLOCK_HARDWARE( rmesa );
- driWaitForVBlank( dPriv, & rmesa->vbl_seq, rmesa->vblank_flags, & missed_target );
- LOCK_HARDWARE( rmesa );
+ if (!rect)
+ {
+ UNLOCK_HARDWARE( rmesa );
+ driWaitForVBlank( dPriv, & rmesa->vbl_seq, rmesa->vblank_flags, & missed_target );
+ LOCK_HARDWARE( rmesa );
+ }
nbox = dPriv->numClipRects; /* must be in locked region */
@@ -459,8 +463,27 @@ void r200CopyBuffer( const __DRIdrawablePrivate *dPriv )
GLint n = 0;
for ( ; i < nr ; i++ ) {
- *b++ = box[i];
- n++;
+
+ *b = box[i];
+
+ if (rect)
+ {
+ if (rect->x1 > b->x1)
+ b->x1 = rect->x1;
+ if (rect->y1 > b->y1)
+ b->y1 = rect->y1;
+ if (rect->x2 < b->x2)
+ b->x2 = rect->x2;
+ if (rect->y2 < b->y2)
+ b->y2 = rect->y2;
+
+ if (b->x1 < b->x2 && b->y1 < b->y2)
+ b++;
+ }
+ else
+ b++;
+
+ n++;
}
rmesa->sarea->nbox = n;
@@ -474,18 +497,21 @@ void r200CopyBuffer( const __DRIdrawablePrivate *dPriv )
}
UNLOCK_HARDWARE( rmesa );
- rmesa->hw.all_dirty = GL_TRUE;
+ if (!rect)
+ {
+ rmesa->hw.all_dirty = GL_TRUE;
- rmesa->swap_count++;
- (*dri_interface->getUST)( & ust );
- if ( missed_target ) {
- rmesa->swap_missed_count++;
- rmesa->swap_missed_ust = ust - rmesa->swap_ust;
- }
+ rmesa->swap_count++;
+ (*dri_interface->getUST)( & ust );
+ if ( missed_target ) {
+ rmesa->swap_missed_count++;
+ rmesa->swap_missed_ust = ust - rmesa->swap_ust;
+ }
- rmesa->swap_ust = ust;
+ rmesa->swap_ust = ust;
- sched_yield();
+ sched_yield();
+ }
}
void r200PageFlip( const __DRIdrawablePrivate *dPriv )