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