1/*
2   Copyright (c) 1999,  The XFree86 Project Inc.
3   Code adapted from mga/mga_shadow.c (Mark Vojkovich <markv@valinux.com>)
4   by Michel Dänzer <michdaen@iiic.ethz.ch>
5*/
6
7#ifdef HAVE_CONFIG_H
8#include "config.h"
9#endif
10
11#include "xf86.h"
12#include "xf86_OSproc.h"
13#include "xf86Pci.h"
14#include "glint.h"
15#include "shadowfb.h"
16#include "servermd.h"
17
18
19
20void
21GLINTRefreshArea(ScrnInfoPtr pScrn, int num, BoxPtr pbox)
22{
23    GLINTPtr pGlint = GLINTPTR(pScrn);
24    int width, height, Bpp, FBPitch;
25    unsigned char *src, *dst;
26
27    Bpp = pScrn->bitsPerPixel >> 3;
28    FBPitch = BitmapBytePad(pScrn->displayWidth * pScrn->bitsPerPixel);
29
30    while(num--) {
31	width = (pbox->x2 - pbox->x1) * Bpp;
32	height = pbox->y2 - pbox->y1;
33	src = pGlint->ShadowPtr + (pbox->y1 * pGlint->ShadowPitch) +
34						(pbox->x1 * Bpp);
35	dst = pGlint->FbBase + (pbox->y1 * FBPitch) + (pbox->x1 * Bpp);
36
37	while(height--) {
38	    memcpy(dst, src, width);
39	    dst += FBPitch;
40	    src += pGlint->ShadowPitch;
41	}
42
43	pbox++;
44    }
45}
46