diff options
author | Christoph Bumiller <e0425955@student.tuwien.ac.at> | 2013-01-29 16:38:21 +1000 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2013-01-29 16:38:42 +1000 |
commit | 58284cf32778d54cde139423450bc33360784503 (patch) | |
tree | 5a3fc231801768595df8c72d54e9e90518215bd0 | |
parent | 912d418fdfd2e99eef1e5c631c76dda1d82cf451 (diff) | |
download | xorg-driver-xf86-video-nouveau-58284cf32778d54cde139423450bc33360784503.tar.gz |
dri2: fix missing frame throttle on copy_region buffer swaps
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
-rw-r--r-- | src/nouveau_dri2.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/nouveau_dri2.c b/src/nouveau_dri2.c index 036bcff..0c2bdab 100644 --- a/src/nouveau_dri2.c +++ b/src/nouveau_dri2.c @@ -134,6 +134,7 @@ nouveau_dri2_copy_region2(ScreenPtr pScreen, DrawablePtr pDraw, RegionPtr pRegio { struct nouveau_dri2_buffer *src = nouveau_dri2_buffer(pSrcBuffer); struct nouveau_dri2_buffer *dst = nouveau_dri2_buffer(pDstBuffer); + NVPtr pNv = NVPTR(xf86ScreenToScrn(pScreen)); RegionPtr pCopyClip; GCPtr pGC; DrawablePtr src_draw, dst_draw; @@ -178,6 +179,22 @@ nouveau_dri2_copy_region2(ScreenPtr pScreen, DrawablePtr pDraw, RegionPtr pRegio } pGC->funcs->ChangeClip(pGC, CT_REGION, pCopyClip, 0); ValidateGC(dst_draw, pGC); + + /* If this is a full buffer swap or frontbuffer flush, throttle on + * the previous one. + */ + if (dst->base.attachment == DRI2BufferFrontLeft && + REGION_NUM_RECTS(pRegion) == 1) { + BoxPtr extents = REGION_EXTENTS(pScreen, pRegion); + if (extents->x1 == 0 && extents->y1 == 0 && + extents->x2 == pDraw->width && + extents->y2 == pDraw->height) { + struct nouveau_bo *bo = nouveau_pixmap_bo(dst->ppix); + if (bo) + nouveau_bo_wait(bo, NOUVEAU_BO_RD, pNv->client); + } + } + pGC->ops->CopyArea(src_draw, dst_draw, pGC, 0, 0, pDraw->width, pDraw->height, off_x, off_y); |