[xserver-commit] xserver/hw/kdrive/mach64 Makefile.am,1.7,1.7.2.1 mach64.c,1.15,1.15.2.1 mach64.h,1.9,1.9.2.1 mach64draw.c,1.14,1.14.2.1 mach64video.c,1.15,1.15.2.1

Keith Packard xserver-commit@pdx.freedesktop.org
Tue, 21 Oct 2003 23:00:51 -0700


Committed by: keithp

Update of /cvs/xserver/xserver/hw/kdrive/mach64
In directory pdx:/tmp/cvs-serv16351/hw/kdrive/mach64

Modified Files:
      Tag: xfixes_2_branch
	Makefile.am mach64.c mach64.h mach64draw.c mach64video.c 
Log Message:
	* configure.ac:
	Build damage infrastructure.  Don't build layer
	
	* fb/fbcopy.c: (fbCopyNtoN), (fbCopyArea):
	Move check for 24/32 copy to fbCopyNtoN so that other users will hit
	it
	
	* hw/kdrive/fbdev/Makefile.am:
	* hw/kdrive/fbdev/fbdev.c: (fbdevScreenInitialize),
	(fbdevGetPixmap), (fbdevPixmapSet), (fbdevRandRSetConfig),
	(fbdevInitScreen), (fbdevFinishInitScreen):
	* hw/kdrive/fbdev/fbdev.h:
	Eliminate miext/layer
	
	* hw/kdrive/linux/Makefile.am:
	Build damage infrastructure.  Don't build layer
	
	* hw/kdrive/mach64/Makefile.am:
	Build damage infrastructure.  Don't build layer
	
	* hw/kdrive/mach64/mach64.c: (mach64ScreenInit),
	(mach64InitScreen), (mach64ScreenFini), (mach64CardFini):
	* hw/kdrive/mach64/mach64.h:
	* hw/kdrive/mach64/mach64draw.c: (mach64DrawFini):
	* hw/kdrive/mach64/mach64video.c: (mach64InitVideo),
	(mach64FiniVideo):
	Memory leak fix of mach64c on server reset
	Memory leak fix for video on server reset.
	Eliminate layer
	
	* hw/kdrive/mga/Makefile.am:
	* hw/kdrive/mga/mga.c: (mgaScreenInit):
	Build damage infrastructure.  Don't build layer
	
	* hw/kdrive/nvidia/Makefile.am:
	* hw/kdrive/nvidia/nvidia.c: (nvidiaRandRSetConfig),
	(nvidiaPreserve), (nvidiaEnable):
	Build damage infrastructure.  Don't build layer
	
	* hw/kdrive/r128/Makefile.am:
	* hw/kdrive/smi/Makefile.am:
	Build damage infrastructure.  Don't build layer
	
	* hw/kdrive/src/Makefile.am:
	Build damage infrastructure.  Don't build layer
	
	* hw/kdrive/src/kaa.c: (kaaDestroyPixmap), (kaaCreatePixmap),
	(kaaPixmapIsOffscreen), (kaaGetOffscreenPixmap),
	(kaaDrawableIsOffscreen), (kaaFillSpans), (kaaCopyNtoN),
	(kaaPolyFillRect), (kaaSolidBoxClipped), (kaaValidateGC),
	(kaaFillRegionSolid), (kaaDrawInit), (kaaDrawFini):
	Don't assume windows are onscreen, use GetWindowPixmap
	and test devPrivate.ptr.  Make sure depth 24 pixmaps are 24bpp
	when hardware format is 24bpp.
	
	* hw/kdrive/src/kasync.c:
	Get rid of debug KdAssertSync function
	
	* hw/kdrive/src/kdrive.c: (KdCloseScreen), (KdScreenInit):
	* hw/kdrive/src/kdrive.h:
	* hw/kdrive/src/koffscreen.c: (KdOffscreenValidate),
	(KdOffscreenAlloc), (KdOffscreenInit):
	add memory_size to KdScreenInfo, eliminate off_screen_size,
	fix tests to suit.
	
	* hw/kdrive/vesa/Makefile.am:
	* hw/kdrive/vesa/vesa.c: (vesaScreenInitialize), (vesaUpdateMono),
	(vesaGetPixmap), (vesaMapFramebuffer), (vesaPixmapSet),
	(vesaRandRSetConfig), (vesaInitScreen), (vesaFinishInitScreen),
	(vesaScreenFini):
	* hw/kdrive/vesa/vesa.h:
	Build damage infrastructure.  Don't build layer
	
	* hw/xnest/Makefile.am:
	Use damage (for software cursor, I guess)

	* mi/Makefile.am:
	* mi/misprite.c: (miSpriteReportDamage), (miSpriteCopyWindow):
	* mi/mispritest.h:
	Damage is used for software cursor

	* miext/Makefile.am:
	* miext/layer/Makefile.am:
	* miext/layer/layerinit.c: (layerCloseScreen):
	Build damage infrastructure.  Don't build layer
	
	* miext/shadow/Makefile.am:
	* miext/shadow/shadow.c: (shadowRedisplay), (shadowGetImage),
	(shadowCloseScreen), (shadowSetup), (shadowSet), (shadowUnset),
	(shadowInit):
	* miext/shadow/shadow.h:
	* miext/shadow/shpacked.c: (shadowUpdatePacked):
	* miext/shadow/shplanar.c: (shadowUpdatePlanar4):
	* miext/shadow/shplanar8.c: (shadowUpdatePlanar4x8):
	* miext/shadow/shrotate.c: (shadowUpdateRotatePacked):
	* miext/shadow/shrotpack.h:
	Use damage to track changes

	* xfixes/xfixes.c: (XFixesResetProc):
	Fix memory leak


Index: Makefile.am
===================================================================
RCS file: /cvs/xserver/xserver/hw/kdrive/mach64/Makefile.am,v
retrieving revision 1.7
retrieving revision 1.7.2.1
diff -u -d -r1.7 -r1.7.2.1
--- Makefile.am	15 Oct 2003 04:59:45 -0000	1.7
+++ Makefile.am	22 Oct 2003 06:00:49 -0000	1.7.2.1
@@ -4,7 +4,7 @@
 	-I$(top_srcdir)/hw/kdrive/linux		\
 	-I$(top_srcdir)/hw/kdrive/vesa		\
 	-I$(top_srcdir)/mi			\
-	-I$(top_srcdir)/miext/layer		\
+	-I$(top_srcdir)/miext/damage		\
 	-I$(top_srcdir)/miext/shadow		\
 	-I$(top_srcdir)/randr			\
 	-I$(top_srcdir)/render			\
@@ -31,10 +31,10 @@
 	$(top_builddir)/hw/kdrive/vesa/libvesa.a \
 	$(top_builddir)/dix/libdix.a		\
 	$(top_builddir)/os/libos.a		\
-	$(top_builddir)/miext/layer/liblayer.a	\
 	$(top_builddir)/hw/kdrive/src/libkdrive.a  \
 	$(top_builddir)/hw/kdrive/linux/liblinux.a  \
 	$(top_builddir)/miext/shadow/libshadow.a \
+	$(top_builddir)/miext/damage/libdamage.a \
 	$(top_builddir)/randr/librandr.a	\
 	$(top_builddir)/render/librender.a	\
 	$(top_builddir)/xfixes/libxfixes.a	\

Index: mach64.c
===================================================================
RCS file: /cvs/xserver/xserver/hw/kdrive/mach64/mach64.c,v
retrieving revision 1.15
retrieving revision 1.15.2.1
diff -u -d -r1.15 -r1.15.2.1
--- mach64.c	15 Oct 2003 05:34:54 -0000	1.15
+++ mach64.c	22 Oct 2003 06:00:49 -0000	1.15.2.1
@@ -70,7 +70,6 @@
 	screen->dumb = TRUE;
     if (mach64s->vesa.mapping != VESA_LINEAR)
 	screen->dumb = TRUE;
-    screen->memory_base = mach64s->vesa.fb;
     switch (screen->fb[0].depth) {
     case 8:
 	mach64s->colorKey = 0xff;
@@ -86,12 +85,6 @@
 	mach64s->colorKey = 1;
 	break;
     }
-    memory = mach64s->vesa.fb_size;
-    screen_size = screen->fb[0].byteStride * screen->height;
-    memory -= screen_size;
-    screen->softCursor = TRUE;
-    screen->off_screen_base = screen_size;
-    screen->off_screen_size = memory;
     screen->driver = mach64s;
     return TRUE;
 }
@@ -100,10 +93,7 @@
 mach64InitScreen (ScreenPtr pScreen)
 {
 #ifdef XV
-    KdScreenPriv(pScreen);
-    Mach64CardInfo	*mach64c = pScreenPriv->screen->card->driver;
-    if (mach64c->media_reg && mach64c->reg)
-	mach64InitVideo(pScreen);
+    mach64InitVideo(pScreen);
 #endif
     return vesaInitScreen (pScreen);
 }
@@ -385,7 +375,9 @@
 mach64ScreenFini (KdScreenInfo *screen)
 {
     Mach64ScreenInfo	*mach64s = (Mach64ScreenInfo *) screen->driver;
-
+#ifdef XV
+    mach64FiniVideo(screen->pScreen);
+#endif
     vesaScreenFini (screen);
     xfree (mach64s);
     screen->driver = 0;
@@ -398,6 +390,7 @@
 
     mach64UnmapReg (card, mach64c);
     vesaCardFini (card);
+    xfree (mach64c);
 }
 
 #define mach64CursorInit 0       /* initCursor */

Index: mach64.h
===================================================================
RCS file: /cvs/xserver/xserver/hw/kdrive/mach64/mach64.h,v
retrieving revision 1.9
retrieving revision 1.9.2.1
diff -u -d -r1.9 -r1.9.2.1
--- mach64.h	15 Oct 2003 05:34:54 -0000	1.9
+++ mach64.h	22 Oct 2003 06:00:49 -0000	1.9.2.1
@@ -557,6 +557,7 @@
 } Mach64PortPrivRec, *Mach64PortPrivPtr;
 
 Bool mach64InitVideo(ScreenPtr pScreen);
+void mach64FiniVideo(ScreenPtr pScreen);
 
 typedef struct _mach64ScreenInfo {
     VesaScreenPrivRec		vesa;

Index: mach64draw.c
===================================================================
RCS file: /cvs/xserver/xserver/hw/kdrive/mach64/mach64draw.c,v
retrieving revision 1.14
retrieving revision 1.14.2.1
diff -u -d -r1.14 -r1.14.2.1
--- mach64draw.c	15 Oct 2003 05:34:54 -0000	1.14
+++ mach64draw.c	22 Oct 2003 06:00:49 -0000	1.14.2.1
@@ -449,6 +449,7 @@
 void
 mach64DrawFini (ScreenPtr pScreen)
 {
+    kaaDrawFini (pScreen);
 }
 
 void

Index: mach64video.c
===================================================================
RCS file: /cvs/xserver/xserver/hw/kdrive/mach64/mach64video.c,v
retrieving revision 1.15
retrieving revision 1.15.2.1
diff -u -d -r1.15 -r1.15.2.1
--- mach64video.c	14 Oct 2003 21:33:04 -0000	1.15
+++ mach64video.c	22 Oct 2003 06:00:49 -0000	1.15.2.1
@@ -980,7 +980,10 @@
     int			num_adaptors;
     KdCardInfo		*card = pScreenPriv->card;
     Mach64CardInfo	*mach64c = (Mach64CardInfo *) card->driver;
+    Mach64ScreenInfo	*mach64s = (Mach64ScreenInfo *) screen->driver;
     
+    mach64s->pAdaptor = NULL;
+
     if (!mach64c->media_reg)
 	return FALSE;
 
@@ -1017,3 +1020,18 @@
         xfree(newAdaptors);
     return TRUE;
 }
+
+void
+mach64FiniVideo (ScreenPtr pScreen)
+{
+    KdScreenPriv(pScreen);
+    mach64ScreenInfo(pScreenPriv);
+    KdVideoAdaptorPtr adapt = mach64s->pAdaptor;
+
+    if (adapt)
+    {
+	Mach64PortPrivPtr pPortPriv = (Mach64PortPrivPtr)(&adapt->pPortPrivates[1]);
+	REGION_UNINIT (pScreen, &pPortPriv->clip);
+	xfree (adapt);
+    }
+}