xserver/hw/kdrive/src kaa.c, 1.34, 1.35 kaa.h, 1.7, 1.8 kdrive.h, 1.58, 1.59 kinput.c, 1.42, 1.43

Keith Packard xserver-commit at pdx.freedesktop.org
Tue Feb 8 14:43:56 PST 2005


Committed by: keithp

Update of /cvs/xserver/xserver/hw/kdrive/src
In directory gabe:/tmp/cvs-serv18753/hw/kdrive/src

Modified Files:
	kaa.c kaa.h kdrive.h kinput.c 
Log Message:
2005-02-08  Keith Packard  <keithp at keithp.com>

	* hw/kdrive/ati/radeon_composite.c 
	Support linear filtering
	
	* hw/kdrive/fbdev/fbinit.c: (InitInput):
	* hw/kdrive/ipaq/ipaq.c: (InitInput):
	* hw/kdrive/linux/Makefile.am:
	* hw/kdrive/linux/linux.c: (LinuxFini):
	* hw/kdrive/mach64/mach64stub.c: (InitCard):
	* hw/kdrive/src/kaa.c: (kaaFillTiled):
	* hw/kdrive/src/kaa.h:
	* hw/kdrive/src/kdrive.h:
	* hw/kdrive/src/kinput.c: (KdMouseProc), (KdAddMouseDriver),
	(KdInitInput):
	Change how touch screens work -- make them just another 'mouse'
	device.
	Add unfinished (and unused) code to accelerate tiled fills.



Index: kaa.c
===================================================================
RCS file: /cvs/xserver/xserver/hw/kdrive/src/kaa.c,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -d -r1.34 -r1.35
--- kaa.c	30 Aug 2004 22:16:46 -0000	1.34
+++ kaa.c	8 Feb 2005 22:43:54 -0000	1.35
@@ -384,6 +384,53 @@
     return kaaPixmapIsOffscreen (pPixmap);
 }
 
+#if 0
+static void
+kaaFillTiled(int	dst_x,
+	     int	dst_y,
+	     int	width,
+	     int	height,
+	     int	src_x,
+	     int	src_y,
+	     int	src_width,
+	     int	src_height,
+	     void	(*Copy) (int	srcX,
+				 int	srcY,
+				 int	dstX,
+				 int	dstY,
+				 int	width,
+				 int	height))
+{
+    modulus (src_x, src_width, src_x);
+    modulus (src_y, src_height, src_y);
+    
+    while (height)
+    {
+	int dst_x_tmp = dst_x;
+	int src_x_tmp = src_x;
+	int width_tmp = width;
+	int height_left = src_height - src_y;
+	int height_this = min (height, height_left);
+	
+	while (width_tmp)
+	{
+	    int width_left = src_width - src_x_tmp;
+	    int width_this = min (width_tmp, width_left);
+
+	    (*Copy) (src_x_tmp, src_y,
+		     dst_x_tmp, dst_y,
+		     width_this, height_this);
+
+	    width_tmp -= width_this;
+	    dst_x_tmp += width_this;
+	}
+	height -= height_this;
+	dst_y += height_this;
+	src_y = 0;
+    }
+}
+#endif
+
 static void
 kaaFillSpans(DrawablePtr pDrawable, GCPtr pGC, int n, 
 	     DDXPointPtr ppt, int *pwidth, int fSorted)
@@ -956,6 +1003,18 @@
     kaaDrawableDirty (pDrawable);
 }
 
+#if 0
+static void
+kaaFillRegionTiled (DrawablePtr pDrawable,
+		    RegionPtr	pRegion,
+		    Pixmap	pTile)
+{
+    else
+    {
+	KdCheckSync
+}
+#endif
+
 static void
 kaaPaintWindow(WindowPtr pWin, RegionPtr pRegion, int what)
 {
@@ -977,6 +1036,11 @@
 	case BackgroundPixel:
 	    kaaFillRegionSolid((DrawablePtr)pWin, pRegion, pWin->background.pixel);
 	    return;
+#if 0	    
+	case BackgroundPixmap:
+	    kaaFillRegionTiled((DrawablePtr)pWin, pRegion, pWin->background.pixmap);
+	    return;
+#endif
     	}
     	break;
     case PW_BORDER:
@@ -985,6 +1049,13 @@
 	    kaaFillRegionSolid((DrawablePtr)pWin, pRegion, pWin->border.pixel);
 	    return;
 	}
+#if 0
+	else
+	{
+	    kaaFillRegionTiled((DrawablePtr)pWin, pRegion, pWin->border.pixmap);
+	    return;
+	}
+#endif
 	break;
     }
     KdCheckPaintWindow (pWin, pRegion, what);

Index: kaa.h
===================================================================
RCS file: /cvs/xserver/xserver/hw/kdrive/src/kaa.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- kaa.h	11 Sep 2004 09:23:12 -0000	1.7
+++ kaa.h	8 Feb 2005 22:43:54 -0000	1.8
@@ -1,5 +1,5 @@
 /*
- * $RCSId$
+ * $RCSId: $
  *
  * Copyright © 2001 Keith Packard
  *

Index: kdrive.h
===================================================================
RCS file: /cvs/xserver/xserver/hw/kdrive/src/kdrive.h,v
retrieving revision 1.58
retrieving revision 1.59
diff -u -d -r1.58 -r1.59
--- kdrive.h	13 Nov 2004 16:41:00 -0000	1.58
+++ kdrive.h	8 Feb 2005 22:43:54 -0000	1.59
@@ -708,6 +708,9 @@
 void
 KdInitInput(KdMouseFuncs *, KdKeyboardFuncs *);
 
+void
+KdAddMouseDriver(KdMouseFuncs *);
+
 int
 KdAllocInputType (void);
 
@@ -722,11 +725,6 @@
 void
 KdUnregisterFds (int type, Bool do_close);
 
-#ifdef TOUCHSCREEN
-void
-KdInitTouchScreen(KdMouseFuncs *pTsFuncs);
-#endif
-
 void
 KdEnqueueKeyboardEvent(unsigned char	scan_code,
 		       unsigned char	is_up);
@@ -778,6 +776,7 @@
 ProcessInputEvents (void);
 
 extern KdMouseFuncs	LinuxMouseFuncs;
+extern KdMouseFuncs	LinuxEvdevFuncs;
 extern KdMouseFuncs	Ps2MouseFuncs;
 extern KdMouseFuncs	BusMouseFuncs;
 extern KdMouseFuncs	MsMouseFuncs;

Index: kinput.c
===================================================================
RCS file: /cvs/xserver/xserver/hw/kdrive/src/kinput.c,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -d -r1.42 -r1.43
--- kinput.c	13 Nov 2004 16:41:00 -0000	1.42
+++ kinput.c	8 Feb 2005 22:43:54 -0000	1.43
@@ -45,7 +45,10 @@
 
 static DeviceIntPtr	pKdKeyboard, pKdPointer;
 
-static KdMouseFuncs	*kdMouseFuncs;
+#define MAX_MOUSE_DRIVERS   4
+
+static KdMouseFuncs	*kdMouseFuncs[MAX_MOUSE_DRIVERS];
+static int		kdNMouseFuncs;
 static KdKeyboardFuncs	*kdKeyboardFuncs;
 static int		kdBellPitch;
 static int		kdBellDuration;
@@ -58,10 +61,6 @@
      { 0, 1, 0 } }
 };
 
-#ifdef TOUCHSCREEN
-static KdMouseFuncs	*kdTsFuncs;
-#endif
-
 int		kdMouseButtonCount;
 int		kdMinScanCode;
 int		kdMaxScanCode;
@@ -327,12 +326,8 @@
     case DEVICE_ON:
 	pDev->on = TRUE;
 	pKdPointer = pDevice;
-#ifdef TOUCHSCREEN
-	if (kdTsFuncs)
-	    (*kdTsFuncs->Init) ();
-#endif
-	if (kdMouseFuncs)
-	    (*kdMouseFuncs->Init) ();
+	for (i = 0; i < kdNMouseFuncs; i++)
+	    (*kdMouseFuncs[i]->Init)();
 	break;
     case DEVICE_OFF:
     case DEVICE_CLOSE:
@@ -340,12 +335,8 @@
 	{
 	    pDev->on = FALSE;
 	    pKdPointer = 0;
-	    if (kdMouseFuncs)
-		(*kdMouseFuncs->Fini) ();
-#ifdef TOUCHSCREEN
-	    if (kdTsFuncs)
-		(*kdTsFuncs->Fini) ();
-#endif
+	    for (i = 0; i < kdNMouseFuncs; i++)
+		(*kdMouseFuncs[i]->Fini) ();
 	}
 	break;
     }
@@ -579,6 +570,13 @@
 }
 
 void
+KdAddMouseDriver(KdMouseFuncs *pMouseFuncs)
+{
+    if (kdNMouseFuncs < MAX_MOUSE_DRIVERS)
+	kdMouseFuncs[kdNMouseFuncs++] = pMouseFuncs;
+}
+
+void
 KdInitInput(KdMouseFuncs    *pMouseFuncs,
 	    KdKeyboardFuncs *pKeyboardFuncs)
 {
@@ -594,7 +592,8 @@
 	    kdMouseButtonCount = mi->nbutton;
     }
 
-    kdMouseFuncs = pMouseFuncs;
+    kdNMouseFuncs = 0;
+    KdAddMouseDriver (pMouseFuncs);
     kdKeyboardFuncs = pKeyboardFuncs;
     memset (kdKeyState, '\0', sizeof (kdKeyState));
     if (kdKeyboardFuncs)
@@ -629,14 +628,6 @@
 #endif
 }
 
-#ifdef TOUCHSCREEN
-void
-KdInitTouchScreen(KdMouseFuncs *pTsFuncs)
-{
-    kdTsFuncs = pTsFuncs;
-}
-#endif
-
 /*
  * Middle button emulation state machine
  *



More information about the xserver-commit mailing list