glint_shadow.c revision 518bcf38
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 "xf86PciInfo.h" 16#include "xf86Pci.h" 17#include "glint.h" 18#include "shadowfb.h" 19#include "servermd.h" 20 21 22 23void 24GLINTRefreshArea(ScrnInfoPtr pScrn, int num, BoxPtr pbox) 25{ 26 GLINTPtr pGlint = GLINTPTR(pScrn); 27 int width, height, Bpp, FBPitch; 28 unsigned char *src, *dst; 29 30 Bpp = pScrn->bitsPerPixel >> 3; 31 FBPitch = BitmapBytePad(pScrn->displayWidth * pScrn->bitsPerPixel); 32 33 while(num--) { 34 width = (pbox->x2 - pbox->x1) * Bpp; 35 height = pbox->y2 - pbox->y1; 36 src = pGlint->ShadowPtr + (pbox->y1 * pGlint->ShadowPitch) + 37 (pbox->x1 * Bpp); 38 dst = pGlint->FbBase + (pbox->y1 * FBPitch) + (pbox->x1 * Bpp); 39 40 while(height--) { 41 memcpy(dst, src, width); 42 dst += FBPitch; 43 src += pGlint->ShadowPitch; 44 } 45 46 pbox++; 47 } 48} 49