[xserver-commit] xserver/fb fb.h,1.39,1.40 fbpixmap.c,1.12,1.13 fbwindow.c,1.12,1.13

Keith Packard xserver-commit@pdx.freedesktop.org
Fri, 07 Nov 2003 15:29:31 -0800


Committed by: keithp

Update of /cvs/xserver/xserver/fb
In directory pdx:/tmp/cvs-serv8754/fb

Modified Files:
	fb.h fbpixmap.c fbwindow.c 
Log Message:
	* composite/compalloc.c: (compReportDamage), (compRedirectWindow),
	(compFreeClientWindow), (compFreeClientSubwindows),
	(compRedirectOneSubwindow), (compUnredirectOneSubwindow),
	(compAllocPixmap), (compFreePixmap), (compReallocPixmap):
	* composite/compext.c: (CompositeExtensionInit):
	* composite/compinit.c: (compScreenInit):
	* composite/compint.h:
	* composite/compwindow.c: (compCheckRedirect),
	(compReparentWindow), (compCopyWindow), (compDestroyWindow),
	(compSetRedirectBorderClip), (compGetRedirectBorderClip),
	(compWindowUpdateAutomatic), (compWindowUpdate):
	* fb/fb.h:
	* fb/fbpixmap.c: (fbCreatePixmapBpp):
	* fb/fbwindow.c: (fbCopyWindow):
	* hw/kdrive/fbdev/fbdev.c: (fbdevInitialize), (fbdevScreenInit):
	* hw/kdrive/linux/keyboard.c: (readKernelMapping):
	* hw/kdrive/linux/linux.c: (LinuxInit), (LinuxSpecialKey),
	(LinuxFini):
	* hw/kdrive/linux/mouse.c: (MouseWaitForReadable), (MouseReadByte),
	(ps2SkipInit), (MouseRead):
	* hw/kdrive/smi/smi.c: (smiScreenInit):
	* include/pixmapstr.h:
	* mi/mi.h:
	* mi/midispcur.c:
	* mi/mivaltree.c: (miRegisterRedirectBorderClipProc),
	(miComputeClips):
	* miext/damage/damage.c: (DamageDamageRegion):
	* miext/damage/damage.h:
	* render/mipict.c: (miValidatePicture):
	Ok, Composite extension is semi-working; when no-one asks
	for redirection, the server seems to act as before.  With
	RedirectSubwindows (root, automatic), the server looks just
	like a regular X server.  Now to go rewrite the (currently lame)
	compositing manager to get some real action on the screen.
	
	Some of the fixes here are to make valgrind quiet with
	various ioctls used by kdrive/linux.

	Also fixed a bug where fbdev initialization was out of order
	in fbdev.c and smi.c


Index: fb.h
===================================================================
RCS file: /cvs/xserver/xserver/fb/fb.h,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -d -r1.39 -r1.40
--- fb.h	5 Nov 2003 05:45:31 -0000	1.39
+++ fb.h	7 Nov 2003 23:29:29 -0000	1.40
@@ -637,33 +637,46 @@
 	((WindowPtr) (pWin))->devPrivates[fbWinPrivateIndex].ptr)
 #endif
 
-#define __fbPixOriginX(pPix)	((pPix)->drawable.x)
-#define __fbPixOriginY(pPix)	((pPix)->drawable.y)
+#ifdef COMPOSITE
+#define __fbPixOffXWin(pPix)	((pPix)->drawable.y-(pPix)->screen_x)
+#define __fbPixOffYWin(pPix)	((pPix)->drawable.x-(pPix)->screen_y)
+#else
+#define __fbPixOffXWin(pPix)	((pPix)->drawable.x)
+#define __fbPixOffYWin(pPix)	((pPix)->drawable.y)
+#endif
+#define __fbPixOffXPix(pPix)	((pPix)->drawable.x)
+#define __fbPixOffYPix(pPix)	((pPix)->drawable.y)
 
 #define fbGetDrawable(pDrawable, pointer, stride, bpp, xoff, yoff) { \
     PixmapPtr   _pPix; \
-    if ((pDrawable)->type != DRAWABLE_PIXMAP) \
+    if ((pDrawable)->type != DRAWABLE_PIXMAP) { \
 	_pPix = fbGetWindowPixmap(pDrawable); \
-    else \
+	(xoff) = __fbPixOffXWin(_pPix); \
+	(yoff) = __fbPixOffYWin(_pPix); \
+    } else { \
 	_pPix = (PixmapPtr) (pDrawable); \
+	(xoff) = __fbPixOffXPix(_pPix); \
+	(yoff) = __fbPixOffYPix(_pPix); \
+    } \
     (pointer) = (FbBits *) _pPix->devPrivate.ptr; \
     (stride) = ((int) _pPix->devKind) / sizeof (FbBits); \
     (bpp) = _pPix->drawable.bitsPerPixel; \
-    (xoff) = __fbPixOriginX(_pPix); \
-    (yoff) = __fbPixOriginY(_pPix); \
 }
 
 #define fbGetStipDrawable(pDrawable, pointer, stride, bpp, xoff, yoff) { \
     PixmapPtr   _pPix; \
-    if ((pDrawable)->type != DRAWABLE_PIXMAP) \
+    if ((pDrawable)->type != DRAWABLE_PIXMAP) { \
 	_pPix = fbGetWindowPixmap(pDrawable); \
-    else \
+	(xoff) = __fbPixOffXWin(_pPix); \
+	(yoff) = __fbPixOffYWin(_pPix); \
+    } else { \
 	_pPix = (PixmapPtr) (pDrawable); \
+	(xoff) = __fbPixOffXPix(_pPix); \
+	(yoff) = __fbPixOffYPix(_pPix); \
+    } \
     (pointer) = (FbStip *) _pPix->devPrivate.ptr; \
     (stride) = ((int) _pPix->devKind) / sizeof (FbStip); \
     (bpp) = _pPix->drawable.bitsPerPixel; \
-    (xoff) = __fbPixOriginX(_pPix); \
-    (yoff) = __fbPixOriginY(_pPix); \
 }
 
 /*

Index: fbpixmap.c
===================================================================
RCS file: /cvs/xserver/xserver/fb/fbpixmap.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- fbpixmap.c	11 Sep 2003 05:12:50 -0000	1.12
+++ fbpixmap.c	7 Nov 2003 23:29:29 -0000	1.13
@@ -68,6 +68,10 @@
     pPixmap->drawable.y = 0;
     pPixmap->drawable.width = width;
     pPixmap->drawable.height = height;
+#ifdef COMPOSITE
+    pPixmap->screen_x = 0;
+    pPixmap->screen_y = 0;
+#endif
     pPixmap->devKind = paddedWidth;
     pPixmap->refcnt = 1;
     pPixmap->devPrivate.ptr = (pointer) ((char *)pPixmap + base + adjust);

Index: fbwindow.c
===================================================================
RCS file: /cvs/xserver/xserver/fb/fbwindow.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- fbwindow.c	7 Nov 2003 04:26:08 -0000	1.12
+++ fbwindow.c	7 Nov 2003 23:29:29 -0000	1.13
@@ -133,6 +133,11 @@
     REGION_INIT (pWin->drawable.pScreen, &rgnDst, NullBox, 0);
     
     REGION_INTERSECT(pWin->drawable.pScreen, &rgnDst, &pWin->borderClip, prgnSrc);
+#ifdef COMPOSITE
+    if (pPixmap->screen_x || pPixmap->screen_y)
+	REGION_TRANSLATE (pWin->drawable.pScreen, &rgnDst, 
+			  -pPixmap->screen_x, -pPixmap->screen_y);
+#endif
 
     fbCopyRegion (&pPixmap->drawable, &pPixmap->drawable,
 		  0,