summaryrefslogtreecommitdiffstats
path: root/src/gallium/winsys/drm/nouveau/dri
diff options
context:
space:
mode:
authorBen Skeggs <[email protected]>2009-02-05 14:04:45 +1000
committerBen Skeggs <[email protected]>2009-02-05 14:04:45 +1000
commit13393736dbab1087589f8dd788bc412d16b431d1 (patch)
treed9059a37412b5aed40b14745bbd896131e6d2cc7 /src/gallium/winsys/drm/nouveau/dri
parentae8a7544d1ab96240f646ea91fb149227067a2db (diff)
nv50: move 2d blit/fill code into pipe driver
Diffstat (limited to 'src/gallium/winsys/drm/nouveau/dri')
-rw-r--r--src/gallium/winsys/drm/nouveau/dri/nouveau_swapbuffers.c42
1 files changed, 30 insertions, 12 deletions
diff --git a/src/gallium/winsys/drm/nouveau/dri/nouveau_swapbuffers.c b/src/gallium/winsys/drm/nouveau/dri/nouveau_swapbuffers.c
index e111eec9327..450c981ca44 100644
--- a/src/gallium/winsys/drm/nouveau/dri/nouveau_swapbuffers.c
+++ b/src/gallium/winsys/drm/nouveau/dri/nouveau_swapbuffers.c
@@ -28,18 +28,36 @@ nouveau_copy_buffer(__DRIdrawablePrivate *dPriv, struct pipe_surface *surf,
pbox = dPriv->pClipRects;
nbox = dPriv->numClipRects;
- nv->base.surface_copy_prep(&nv->base, nv->base.frontbuffer, surf);
- for (i = 0; i < nbox; i++, pbox++) {
- int sx, sy, dx, dy, w, h;
-
- sx = pbox->x1 - dPriv->x;
- sy = pbox->y1 - dPriv->y;
- dx = pbox->x1;
- dy = pbox->y1;
- w = pbox->x2 - pbox->x1;
- h = pbox->y2 - pbox->y1;
-
- nv->base.surface_copy(&nv->base, dx, dy, sx, sy, w, h);
+ if (nv->base.surface_copy_prep) {
+ nv->base.surface_copy_prep(&nv->base, nv->base.frontbuffer, surf);
+ for (i = 0; i < nbox; i++, pbox++) {
+ int sx, sy, dx, dy, w, h;
+
+ sx = pbox->x1 - dPriv->x;
+ sy = pbox->y1 - dPriv->y;
+ dx = pbox->x1;
+ dy = pbox->y1;
+ w = pbox->x2 - pbox->x1;
+ h = pbox->y2 - pbox->y1;
+
+ nv->base.surface_copy(&nv->base, dx, dy, sx, sy, w, h);
+ }
+ } else {
+ struct pipe_context *pipe = nv->base.nvc->pctx[nv->base.pctx_id];
+
+ for (i = 0; i < nbox; i++, pbox++) {
+ int sx, sy, dx, dy, w, h;
+
+ sx = pbox->x1 - dPriv->x;
+ sy = pbox->y1 - dPriv->y;
+ dx = pbox->x1;
+ dy = pbox->y1;
+ w = pbox->x2 - pbox->x1;
+ h = pbox->y2 - pbox->y1;
+
+ pipe->surface_copy(pipe, FALSE, nv->base.frontbuffer,
+ dx, dy, surf, sx, sy, w, h);
+ }
}
FIRE_RING(nv->base.nvc->channel);