Apply the following patches from NetBSD xsrc/external/mit/xorg-server/dist; thanks to joerg for providing a list of changes to apply. 2009-02-19 20:02 macallan * hw/xfree86/xaa/: xaaFillRect.c (1.2), xaaInitAccel.c (1.2), xaalocal.h (1.2): Actually use scanline image writes to upload images if available 2009-02-09 09:49 plunky * hw/xfree86/os-support/bsd/bsd_mouse.c (1.5): add horizontal mouse-wheel functionality to USB and WSMOUSE drivers 2009-02-02 03:06 christos * hw/xfree86/os-support/: bsd/bsd_mouse.c (1.4), xf86OSmouse.h (1.2): add a SetupMouse proc to condition the fd. Convert NetBSD's SetupAuto to SetupMouse. 2009-01-19 00:54 christos * hw/xfree86/os-support/bsd/bsd_mouse.c (1.3): fix ioctl. 2009-01-13 18:43 christos * hw/xfree86/os-support/bsd/bsd_mouse.c (1.2): Set the mouse event protocol version. (untested, but head will be broken unless I add this).
124 lines
3.4 KiB
Text
124 lines
3.4 KiB
Text
$NetBSD: patch-aj,v 1.3 2009/03/14 11:00:22 apb Exp $
|
|
|
|
Changes from NetBSD xsrc/external/mit/xorg-server/dist/\
|
|
hw/xfree86/xaa/xaaFillRect.c
|
|
|
|
----------------------------
|
|
revision 1.2
|
|
date: 2009/02/19 20:02:02; author: macallan; state: Exp; lines: +104 -0
|
|
Actually use scanline image writes to upload images if available
|
|
----------------------------
|
|
|
|
--- hw/xfree86/xaa/xaaFillRect.c.orig 2008-06-06 12:03:10.000000000 +0200
|
|
+++ hw/xfree86/xaa/xaaFillRect.c
|
|
@@ -779,6 +779,110 @@ XAAFillCacheExpandRects(
|
|
with reading past the edge of the pattern otherwise */
|
|
|
|
static void
|
|
+WriteColumnScanlines(
|
|
+ ScrnInfoPtr pScrn,
|
|
+ unsigned char *pSrc,
|
|
+ int x, int y, int w, int h,
|
|
+ int xoff, int yoff,
|
|
+ int pHeight,
|
|
+ int srcwidth,
|
|
+ int Bpp
|
|
+) {
|
|
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
|
|
+ unsigned char *src;
|
|
+ int skipleft, bytes, line, sline;
|
|
+ int buffer;
|
|
+
|
|
+ pSrc += (Bpp * xoff);
|
|
+
|
|
+ if((skipleft = (long)pSrc & 0x03L)) {
|
|
+ if(Bpp == 3)
|
|
+ skipleft = 4 - skipleft;
|
|
+ else
|
|
+ skipleft /= Bpp;
|
|
+
|
|
+ x -= skipleft;
|
|
+ w += skipleft;
|
|
+
|
|
+ if(Bpp == 3)
|
|
+ pSrc -= 3 * skipleft;
|
|
+ else /* is this Alpha friendly ? */
|
|
+ pSrc = (unsigned char*)((long)pSrc & ~0x03L);
|
|
+ }
|
|
+
|
|
+ src = pSrc + (yoff * srcwidth);
|
|
+
|
|
+ bytes = w * Bpp;
|
|
+
|
|
+ (*infoRec->SubsequentScanlineImageWriteRect)(pScrn, x, y, w, h, skipleft);
|
|
+
|
|
+ buffer = 0;
|
|
+ sline = yoff;
|
|
+ for (line = 0; line < h; line++) {
|
|
+ memcpy(infoRec->ScanlineImageWriteBuffers[buffer], src, bytes);
|
|
+ (*infoRec->SubsequentImageWriteScanline)(pScrn, buffer);
|
|
+ buffer++;
|
|
+ src += srcwidth;
|
|
+ sline++;
|
|
+ if (sline >= pHeight) {
|
|
+ sline = 0;
|
|
+ src = pSrc;
|
|
+ }
|
|
+ if (buffer >= infoRec->NumScanlineImageWriteBuffers)
|
|
+ buffer = 0;
|
|
+ }
|
|
+}
|
|
+
|
|
+void
|
|
+XAAFillScanlineImageWriteRects(
|
|
+ ScrnInfoPtr pScrn,
|
|
+ int rop,
|
|
+ unsigned int planemask,
|
|
+ int nBox,
|
|
+ BoxPtr pBox,
|
|
+ int xorg, int yorg,
|
|
+ PixmapPtr pPix
|
|
+){
|
|
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
|
|
+ int x, phaseY, phaseX, height, width, blit_w;
|
|
+ int pHeight = pPix->drawable.height;
|
|
+ int pWidth = pPix->drawable.width;
|
|
+ int Bpp = pPix->drawable.bitsPerPixel >> 3;
|
|
+ int srcwidth = pPix->devKind;
|
|
+
|
|
+ (*infoRec->SetupForScanlineImageWrite)(pScrn, rop, planemask, -1,
|
|
+ pPix->drawable.bitsPerPixel, pPix->drawable.depth);
|
|
+
|
|
+ while(nBox--) {
|
|
+ x = pBox->x1;
|
|
+ phaseY = (pBox->y1 - yorg) % pHeight;
|
|
+ if(phaseY < 0) phaseY += pHeight;
|
|
+ phaseX = (x - xorg) % pWidth;
|
|
+ if(phaseX < 0) phaseX += pWidth;
|
|
+ height = pBox->y2 - pBox->y1;
|
|
+ width = pBox->x2 - x;
|
|
+
|
|
+ while(1) {
|
|
+ blit_w = pWidth - phaseX;
|
|
+ if(blit_w > width) blit_w = width;
|
|
+
|
|
+ WriteColumnScanlines(pScrn, pPix->devPrivate.ptr, x, pBox->y1,
|
|
+ blit_w, height, phaseX, phaseY, pHeight, srcwidth, Bpp);
|
|
+
|
|
+ width -= blit_w;
|
|
+ if(!width) break;
|
|
+ x += blit_w;
|
|
+ phaseX = (phaseX + blit_w) % pWidth;
|
|
+ }
|
|
+ pBox++;
|
|
+ }
|
|
+
|
|
+ if(infoRec->ScanlineImageWriteFlags & SYNC_AFTER_IMAGE_WRITE)
|
|
+ (*infoRec->Sync)(pScrn);
|
|
+ else SET_SYNC_FLAG(infoRec);
|
|
+}
|
|
+
|
|
+static void
|
|
WriteColumn(
|
|
ScrnInfoPtr pScrn,
|
|
unsigned char *pSrc,
|