-#include "context.h"
+#include "main/glheader.h"
+#include "glapi/glthread.h"
+#include <GL/internal/glcore.h>
#include "pipe/p_context.h"
#include "state_tracker/st_public.h"
+#include "state_tracker/st_context.h"
#include "state_tracker/st_cb_fbo.h"
#include "nouveau_context.h"
const drm_clip_rect_t *rect)
{
struct nouveau_context *nv = dPriv->driContextPriv->driverPrivate;
- struct nouveau_screen *nv_screen = nv->nv_screen;
- struct pipe_region *p_region = surf->region;
drm_clip_rect_t *pbox;
int nbox, i;
pbox = dPriv->pClipRects;
nbox = dPriv->numClipRects;
- BEGIN_RING(NvCtxSurf2D, 0x184, 2);
- OUT_RELOCo(p_region->buffer, NOUVEAU_BO_VRAM | NOUVEAU_BO_RD);
- OUT_RING (nv->channel->vram->handle);
-
- BEGIN_RING(NvCtxSurf2D, 0x300, 4);
- OUT_RING ((p_region->cpp == 4) ? 6 : 4);
- OUT_RING ((nv_screen->front_pitch << 16) |
- (p_region->pitch * p_region->cpp));
- OUT_RELOCl(p_region->buffer, 0, NOUVEAU_BO_VRAM | NOUVEAU_BO_RD);
- OUT_RING (nv_screen->front_offset);
-
+ nv->surface_copy_prep(nv, nv->frontbuffer, surf);
for (i = 0; i < nbox; i++, pbox++) {
int sx, sy, dx, dy, w, h;
w = pbox->x2 - pbox->x1;
h = pbox->y2 - pbox->y1;
- BEGIN_RING(NvImageBlit, 0x300, 3);
- OUT_RING ((sy << 16) | sx);
- OUT_RING ((dy << 16) | dx);
- OUT_RING (( h << 16) | w);
+ nv->surface_copy(nv, dx, dy, sx, sy, w, h);
}
FIRE_RING();