summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri
diff options
context:
space:
mode:
authorKeith Whitwell <[email protected]>2004-12-29 14:05:16 +0000
committerKeith Whitwell <[email protected]>2004-12-29 14:05:16 +0000
commitf102f7ae3d45a4a6d6a00d9e389c061a9d4bb852 (patch)
treed0dc9295573b1de2ede3f8f0f5027f9a9d1a8532 /src/mesa/drivers/dri
parentcb0cc796d2eb21bceb3202c7f1cbfa72389cdb56 (diff)
Don't pingpong cliprects through sarea on CopyBuffer().
Diffstat (limited to 'src/mesa/drivers/dri')
-rw-r--r--src/mesa/drivers/dri/unichrome/via_ioctl.c39
1 files changed, 5 insertions, 34 deletions
diff --git a/src/mesa/drivers/dri/unichrome/via_ioctl.c b/src/mesa/drivers/dri/unichrome/via_ioctl.c
index 4fd5b30e998..431a26b2a94 100644
--- a/src/mesa/drivers/dri/unichrome/via_ioctl.c
+++ b/src/mesa/drivers/dri/unichrome/via_ioctl.c
@@ -205,47 +205,20 @@ static void viaClear(GLcontext *ctx, GLbitfield mask, GLboolean all,
*/
void viaCopyBuffer(const __DRIdrawablePrivate *dPriv)
{
- viaContextPtr vmesa;
- drm_clip_rect_t *pbox;
- int nbox, i;
+ viaContextPtr vmesa = (viaContextPtr)dPriv->driContextPriv->driverPrivate;
GLboolean missed_target;
int64_t ust;
- if (VIA_DEBUG) fprintf(stderr, "%s in\n", __FUNCTION__);
- assert(dPriv);
- assert(dPriv->driContextPriv);
- assert(dPriv->driContextPriv->driverPrivate);
-
- vmesa = (viaContextPtr)dPriv->driContextPriv->driverPrivate;
-
VIA_FLUSH_DMA(vmesa);
driWaitForVBlank( dPriv, & vmesa->vbl_seq, vmesa->vblank_flags, & missed_target );
- LOCK_HARDWARE(vmesa);
-
- pbox = vmesa->pClipRects;
- nbox = vmesa->numClipRects;
- if (VIA_DEBUG) fprintf(stderr, "%s %d cliprects (%d)\n",
- __FUNCTION__, nbox, vmesa->drawType);
-
-
+ LOCK_HARDWARE(vmesa);
if (vmesa->drawType == GLX_PBUFFER_BIT) {
viaDoSwapPBuffers(vmesa);
- if (VIA_DEBUG) fprintf(stderr, "%s SwapPBuffers\n", __FUNCTION__);
}
else {
- for (i = 0; i < nbox; ) {
- int nr = MIN2(i + VIA_NR_SAREA_CLIPRECTS, dPriv->numClipRects);
- drm_clip_rect_t *b = (drm_clip_rect_t *)vmesa->sarea->boxes;
-
- vmesa->sarea->nbox = nr - i;
-
- for (; i < nr; i++)
- *b++ = pbox[i];
- viaDoSwapBuffers(vmesa);
- if (VIA_DEBUG) fprintf(stderr, "%s SwapBuffers\n", __FUNCTION__);
- }
+ viaDoSwapBuffers(vmesa);
}
UNLOCK_HARDWARE(vmesa);
@@ -257,8 +230,6 @@ void viaCopyBuffer(const __DRIdrawablePrivate *dPriv)
}
vmesa->swap_ust = ust;
-
- if (VIA_DEBUG) fprintf(stderr, "%s out\n", __FUNCTION__);
}
/*
@@ -886,14 +857,14 @@ void viaDoSwapBuffers(viaContextPtr vmesa)
GLuint nBackPitch;
GLuint nFrontWidth, nFrontHeight;
GLuint nFrontBase, nBackBase;
- drm_clip_rect_t *b = vmesa->sarea->boxes;
+ drm_clip_rect_t *b = vmesa->pClipRects;
GLuint bytePerPixel = vmesa->viaScreen->bitsPerPixel >> 3;
GLuint i;
nFrontPitch = vmesa->front.pitch;
nBackPitch = vmesa->back.pitch;
- for (i = 0; i < vmesa->sarea->nbox; i++) {
+ for (i = 0; i < vmesa->numClipRects; i++) {
/* Width, Height */
nFrontWidth = b->x2 - b->x1;