1 #include "pipe/p_context.h"
2 #include "nouveau_context.h"
3 #include "nouveau_local.h"
4 #include "nouveau_screen.h"
5 #include "nouveau_swapbuffers.h"
8 nouveau_copy_buffer(dri_drawable_t
*dri_drawable
, struct pipe_surface
*surf
,
9 const drm_clip_rect_t
*rect
)
11 struct nouveau_context
*nv
= dri_drawable
->private;
12 drm_clip_rect_t
*pbox
;
16 if (!dri_drawable
->num_cliprects
) {
20 pbox
= dri_drawable
->cliprects
;
21 nbox
= dri_drawable
->num_cliprects
;
23 nv
->surface_copy_prep(nv
, nv
->frontbuffer
, surf
);
24 for (i
= 0; i
< nbox
; i
++, pbox
++) {
25 int sx
, sy
, dx
, dy
, w
, h
;
27 sx
= pbox
->x1
- dri_drawable
->x
;
28 sy
= pbox
->y1
- dri_drawable
->y
;
31 w
= pbox
->x2
- pbox
->x1
;
32 h
= pbox
->y2
- pbox
->y1
;
34 nv
->surface_copy(nv
, dx
, dy
, sx
, sy
, w
, h
);
37 FIRE_RING(nv
->nvc
->channel
);
40 //if (nv->last_stamp != dri_drawable->last_sarea_stamp)
41 //nv->last_stamp = dri_drawable->last_sarea_stamp;
45 nouveau_copy_sub_buffer(dri_drawable_t
*dri_drawable
, struct pipe_surface
*surf
, int x
, int y
, int w
, int h
)
54 nouveau_copy_buffer(dri_drawable
, surf
, &rect
);
59 nouveau_swap_buffers(dri_drawable_t
*dri_drawable
, struct pipe_surface
*surf
)
62 nouveau_copy_buffer(dri_drawable
, surf
, NULL
);