summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrancisco Jerez <currojerez@riseup.net>2010-10-22 23:05:24 +0200
committerFrancisco Jerez <currojerez@riseup.net>2010-10-22 23:05:24 +0200
commitc61e8d03161adcfbba4162172153814accf9e86b (patch)
treec4b71737e1d315f6ccc330afd3696bf614b7e0b4
parenta685a5c3be12f3e95a6ec1140af115e7ef28fcaa (diff)
downloadxorg-driver-xf86-video-nouveau-c61e8d03161adcfbba4162172153814accf9e86b.tar.gz
Make the sync-to-vblank helpers take a box as argument.
Signed-off-by: Francisco Jerez <currojerez@riseup.net>
-rw-r--r--src/nouveau_dri2.c20
-rw-r--r--src/nv04_xv_blit.c3
-rw-r--r--src/nv30_xv_tex.c3
-rw-r--r--src/nv40_xv_tex.c3
-rw-r--r--src/nv50_accel.c6
-rw-r--r--src/nv50_xv.c3
-rw-r--r--src/nv_accel_common.c6
-rw-r--r--src/nv_proto.h4
8 files changed, 22 insertions, 26 deletions
diff --git a/src/nouveau_dri2.c b/src/nouveau_dri2.c
index c8d5c57..b006cfc 100644
--- a/src/nouveau_dri2.c
+++ b/src/nouveau_dri2.c
@@ -198,26 +198,26 @@ nouveau_dri2_finish_swap(DrawablePtr draw, unsigned int frame,
struct nouveau_bo *dst_bo = nouveau_pixmap_bo(dst_pix);
struct nouveau_bo *src_bo = nouveau_pixmap_bo(src_pix);
struct nouveau_channel *chan = pNv->chan;
+ RegionRec reg;
int type, ret;
+ RegionInit(&reg, &(BoxRec){ 0, 0, draw->width, draw->height }, 0);
+ RegionTranslate(&reg, draw->x, draw->y);
+
/* Throttle on the previous frame before swapping */
nouveau_bo_map(dst_bo, NOUVEAU_BO_RD);
nouveau_bo_unmap(dst_bo);
if (can_sync_to_vblank(draw)) {
- int x1 = draw->x, y1 = draw->y,
- x2 = draw->x + draw->width,
- y2 = draw->y + draw->height;
-
/* Reference the back buffer to sync it to vblank */
WAIT_RING(chan, 1);
OUT_RELOC(chan, src_bo, 0,
NOUVEAU_BO_VRAM | NOUVEAU_BO_RD, 0, 0);
if (pNv->Architecture >= NV_ARCH_50)
- NV50SyncToVBlank(dst_pix, x1, y1, x2, y2);
+ NV50SyncToVBlank(dst_pix, RegionExtents(&reg));
else
- NV11SyncToVBlank(dst_pix, x1, y1, x2, y2);
+ NV11SyncToVBlank(dst_pix, RegionExtents(&reg));
FIRE_RING(chan);
}
@@ -236,13 +236,9 @@ nouveau_dri2_finish_swap(DrawablePtr draw, unsigned int frame,
SWAP(nouveau_pixmap(dst_pix)->bo, nouveau_pixmap(src_pix)->bo);
} else {
- BoxRec box = { 0, 0, draw->width, draw->height };
- RegionRec region;
-
- RegionInit(&region, &box, 0);
-
type = DRI2_BLIT_COMPLETE;
- nouveau_dri2_copy_region(draw, &region, s->dst, s->src);
+ RegionTranslate(&reg, -draw->x, -draw->y);
+ nouveau_dri2_copy_region(draw, &reg, s->dst, s->src);
}
/*
diff --git a/src/nv04_xv_blit.c b/src/nv04_xv_blit.c
index 55d82c4..be39c0d 100644
--- a/src/nv04_xv_blit.c
+++ b/src/nv04_xv_blit.c
@@ -130,8 +130,7 @@ NVPutBlitImage(ScrnInfoPtr pScrn, struct nouveau_bo *src, int src_offset,
if(pPriv->SyncToVBlank) {
FIRE_RING(chan);
- NV11SyncToVBlank(ppix, dstBox->x1, dstBox->y1,
- dstBox->x2, dstBox->y2);
+ NV11SyncToVBlank(ppix, dstBox);
}
if (pNv->dev->chipset >= 0x05) {
diff --git a/src/nv30_xv_tex.c b/src/nv30_xv_tex.c
index 61558e9..ffa68e4 100644
--- a/src/nv30_xv_tex.c
+++ b/src/nv30_xv_tex.c
@@ -350,8 +350,7 @@ NV30PutTextureImage(ScrnInfoPtr pScrn, struct nouveau_bo *src, int src_offset,
/* Just before rendering we wait for vblank in the non-composited case. */
if (pPriv->SyncToVBlank) {
FIRE_RING(chan);
- NV11SyncToVBlank(ppix, dstBox->x1, dstBox->y1,
- dstBox->x2, dstBox->y2);
+ NV11SyncToVBlank(ppix, dstBox);
}
/* These are fixed point values in the 16.16 format. */
diff --git a/src/nv40_xv_tex.c b/src/nv40_xv_tex.c
index 602bb7a..e0444e8 100644
--- a/src/nv40_xv_tex.c
+++ b/src/nv40_xv_tex.c
@@ -339,8 +339,7 @@ NV40PutTextureImage(ScrnInfoPtr pScrn,
/* Just before rendering we wait for vblank in the non-composited case. */
if (pPriv->SyncToVBlank) {
FIRE_RING(chan);
- NV11SyncToVBlank(ppix, dstBox->x1, dstBox->y1,
- dstBox->x2, dstBox->y2);
+ NV11SyncToVBlank(ppix, dstBox);
}
/* These are fixed point values in the 16.16 format. */
diff --git a/src/nv50_accel.c b/src/nv50_accel.c
index d0def57..95d1886 100644
--- a/src/nv50_accel.c
+++ b/src/nv50_accel.c
@@ -24,7 +24,7 @@
#include "nv50_accel.h"
void
-NV50SyncToVBlank(PixmapPtr ppix, int x1, int y1, int x2, int y2)
+NV50SyncToVBlank(PixmapPtr ppix, BoxPtr box)
{
ScrnInfoPtr pScrn = xf86Screens[ppix->drawable.pScreen->myNum];
NVPtr pNv = NVPTR(pScrn);
@@ -35,7 +35,9 @@ NV50SyncToVBlank(PixmapPtr ppix, int x1, int y1, int x2, int y2)
if (!nouveau_exa_pixmap_is_onscreen(ppix))
return;
- crtcs = nv_window_belongs_to_crtc(pScrn, x1, y1, x2 - x1, y2 - y1);
+ crtcs = nv_window_belongs_to_crtc(pScrn, box->x1, box->y1,
+ box->x2 - box->x1,
+ box->y2 - box->y1);
if (!crtcs)
return;
diff --git a/src/nv50_xv.c b/src/nv50_xv.c
index 87e22b5..e02f86d 100644
--- a/src/nv50_xv.c
+++ b/src/nv50_xv.c
@@ -289,8 +289,7 @@ nv50_xv_image_put(ScrnInfoPtr pScrn,
return BadAlloc;
if (pPriv->SyncToVBlank) {
- NV50SyncToVBlank(ppix, dstBox->x1, dstBox->y1,
- dstBox->x2, dstBox->y2);
+ NV50SyncToVBlank(ppix, dstBox);
}
/* These are fixed point values in the 16.16 format. */
diff --git a/src/nv_accel_common.c b/src/nv_accel_common.c
index 3739c79..1ade291 100644
--- a/src/nv_accel_common.c
+++ b/src/nv_accel_common.c
@@ -90,7 +90,7 @@ nouveau_allocate_surface(ScrnInfoPtr scrn, int width, int height, int bpp,
}
void
-NV11SyncToVBlank(PixmapPtr ppix, int x1, int y1, int x2, int y2)
+NV11SyncToVBlank(PixmapPtr ppix, BoxPtr box)
{
ScrnInfoPtr pScrn = xf86Screens[ppix->drawable.pScreen->myNum];
NVPtr pNv = NVPTR(pScrn);
@@ -101,7 +101,9 @@ NV11SyncToVBlank(PixmapPtr ppix, int x1, int y1, int x2, int y2)
if (!nouveau_exa_pixmap_is_onscreen(ppix))
return;
- crtcs = nv_window_belongs_to_crtc(pScrn, x1, y1, x2 - x1, y2 - y1);
+ crtcs = nv_window_belongs_to_crtc(pScrn, box->x1, box->y1,
+ box->x2 - box->x1,
+ box->y2 - box->y1);
if (!crtcs)
return;
diff --git a/src/nv_proto.h b/src/nv_proto.h
index 8514af9..888e74e 100644
--- a/src/nv_proto.h
+++ b/src/nv_proto.h
@@ -17,7 +17,7 @@ Bool NVAccelGetCtxSurf2DFormatFromPixmap(PixmapPtr pPix, int *fmt_ret);
Bool NVAccelGetCtxSurf2DFormatFromPicture(PicturePtr pPix, int *fmt_ret);
PixmapPtr NVGetDrawablePixmap(DrawablePtr pDraw);
void NVAccelFree(ScrnInfoPtr pScrn);
-void NV11SyncToVBlank(PixmapPtr ppix, int x1, int y1, int x2, int y2);
+void NV11SyncToVBlank(PixmapPtr ppix, BoxPtr box);
Bool nouveau_allocate_surface(ScrnInfoPtr scrn, int width, int height,
int bpp, int usage_hint, int *pitch,
struct nouveau_bo **bo);
@@ -132,7 +132,7 @@ int NV40GetTexturePortAttribute(ScrnInfoPtr, Atom, INT32 *, pointer);
int NV40SetTexturePortAttribute(ScrnInfoPtr, Atom, INT32, pointer);
/* in nv50_accel.c */
-void NV50SyncToVBlank(PixmapPtr ppix, int x1, int y1, int x2, int y2);
+void NV50SyncToVBlank(PixmapPtr ppix, BoxPtr box);
Bool NVAccelInitNV50TCL(ScrnInfoPtr pScrn);
/* in nv50_exa.c */