Re: xts5-5.1.5 RC1 is available now

Rui Feng <[email protected]> Wed, 30 Nov 2005 17:31:33 +0800
Newsgroups gmane.linux.lsb.test-suite
Message-ID <OF36F48CBF.133954AB-ON482570C9.003078B1-482570C9.0034269E@cn.ibm.com>
We have to enable XInputExtension when building Xvfb.
The first attached patch (xc-lsb.patch) can solve most
of the failures.

If you are trying to run xts5 on ppc64/s390x, you also
need the second patch(s390x_64bit_s.patch); otherwise,
Xvfb will hang when executing /tset/Xlib10/rprntwdw.

Note: the patch can not solve the problem completely,
but it can show how xts5 behaves correctly.

Best Regards!
Rui Feng

(See attached file: xc-lsb.patch)(See attached file: s390x_64bit_s.patch)

[email protected] wrote on 2005-11-29 23:06:45:

>
> On Tue, 29 Nov 2005, Rui Feng wrote:
>
> > >
> > > [root@presario30 lsb-xts5]# tjreport xts5/results/0001e/journal
> > > /tset/Xlib13/allwevnts/Test 20 FAIL
> > > /tset/Xlib13/allwevnts/Test 24 FAIL
> >
> > These two cases need XInputExtension for the xserver.
> >
>
> How does one enable this, at build time? I tried modifying run_xts5.sh
> with:
>
> Xvfb +extension XInputExtension
>
> Xvfb didn't mind running with this option but my results were the same
>
> --
> Stew Benedict
> Mandriva
> Mandrakesoft becomes Mandriva
> _______________________________________________
> lsb-test mailing list
> [email protected]
> http://mail.freestandards.org/mailman/listinfo/lsb-test

_______________________________________________
lsb-test mailing list
[email protected]
http://mail.freestandards.org/mailman/listinfo/lsb-test
xc-lsb.patch (application/octet-stream, 6.6 KB)
diff -uNr xc/config/cf/host.def xc.lsb/config/cf/host.def
--- xc/config/cf/host.def	1970-01-01 08:00:00.000000000 +0800
+++ xc.lsb/config/cf/host.def	2005-11-30 12:49:23.000000000 +0800
@@ -0,0 +1 @@
+#define BuildXInputExt          YES
diff -uNr xc/lib/Xt/Geometry.c xc.lsb/lib/Xt/Geometry.c
--- xc/lib/Xt/Geometry.c	2005-05-18 23:38:31.000000000 +0800
+++ xc.lsb/lib/Xt/Geometry.c	2005-11-30 12:50:34.000000000 +0800
@@ -173,7 +173,7 @@
 	}
     }
 
-#if 0
+#if 1
     /*
      * The Xt spec says that these conditions must generate
      * error messages (not warnings), but many Xt applications
diff -uNr xc/programs/Xserver/dix/events.c xc.lsb/programs/Xserver/dix/events.c
--- xc/programs/Xserver/dix/events.c	2005-08-26 06:11:04.000000000 +0800
+++ xc.lsb/programs/Xserver/dix/events.c	2005-11-30 12:50:34.000000000 +0800
@@ -3024,7 +3024,7 @@
 #if !defined(XFree86Server) || !defined(XINPUT)
 	    xE->u.u.detail = butc->map[key];
 #endif
-	    if (xE->u.u.detail == 0)
+	    if ((xE->u.u.detail == 0) || (butc->map[key] == 0))
 		return;
 	    if (xE->u.u.detail <= 5)
 		butc->state |= (Button1Mask >> 1) << xE->u.u.detail;
@@ -3043,7 +3043,7 @@
 #if !defined(XFree86Server) || !defined(XINPUT)
 	    xE->u.u.detail = butc->map[key];
 #endif
-	    if (xE->u.u.detail == 0)
+	    if ((xE->u.u.detail == 0) || (butc->map[key] == 0))
 		return;
 	    if (xE->u.u.detail <= 5)
 		butc->state &= ~((Button1Mask >> 1) << xE->u.u.detail);
diff -uNr xc/programs/Xserver/mi/miinitext.c xc.lsb/programs/Xserver/mi/miinitext.c
--- xc/programs/Xserver/mi/miinitext.c	2005-07-16 11:49:59.000000000 +0800
+++ xc.lsb/programs/Xserver/mi/miinitext.c	2005-11-30 12:56:23.000000000 +0800
@@ -555,7 +555,7 @@
 #ifdef MULTIBUFFER
     if (!noMultibufferExtension) MultibufferExtensionInit();
 #endif
-#if defined(XINPUT) && !defined(NO_HW_ONLY_EXTS)
+#if defined(XINPUT) 
     if (!noXInputExtension) XInputExtensionInit();
 #endif
 #ifdef XTEST
diff -uNr xc/programs/Xserver/os/io.c xc.lsb/programs/Xserver/os/io.c
--- xc/programs/Xserver/os/io.c	2005-07-03 16:53:51.000000000 +0800
+++ xc.lsb/programs/Xserver/os/io.c	2005-11-30 12:50:34.000000000 +0800
@@ -432,15 +432,138 @@
 		else
 		    needed = get_big_req_len(request, client);
 	    }
+
+	    /* added by phost on 20050901, begin */
+/*	    if (needed > maxBigRequestSize)
+		    return BadLength; */
+	    /* added by phost on 20050901, end */
 #endif
 	    client->req_len = needed;
 	    needed <<= 2;
 	}
 	if (gotnow < needed)
 	{
+/* trying to fix the bigrequest bug, added by phost on 20050903, start */
+
+	    if (client->big_requests && gotnow == oci->size )
+	    {
+		/* for bigrequest, we need to read the whole request from buffer */
+
+		/* oci->lenLastReq = 0; */
+		if (needed > (MAXBUFSIZE << 2))
+		{
+	    		/* request is too big for us to handle */
+	    		YieldControlDeath();
+	    		return needed;
+		}	
+	   	if ((oci->bufptr - oci->buffer + needed) > oci->size)
+		{
+	    		/*the request is too big to fit in the buffer */
+
+		    	if ((gotnow > 0) && (oci->bufptr != oci->buffer))
+				/* save the data we've already read */
+				memmove(oci->buffer, oci->bufptr, gotnow);
+	    		if (needed > oci->size)
+	    		{
+				/* make buffer bigger to accomodate request */
+				char *ibuf;
+
+				ibuf = (char *)xrealloc(oci->buffer, needed);
+				if (!ibuf)
+				{
+		    			YieldControlDeath();
+		    			return -1;
+				}
+				oci->size = needed;
+				oci->buffer = ibuf;
+			/*	memmove(oci->buffer, oci->bufptr, gotnow); */
+			/* not sure, maybe should add this line, 20050904 by phost */
+	   	 	}
+	    		oci->bufptr = oci->buffer;
+	    		oci->bufcnt = gotnow;
+		}
+		/*  XXX this is a workaround.  This function is sometimes called
+	 	*  after the trans_conn has been freed.  In this case trans_conn
+	 	*  will be null.  Really ought to restructure things so that we
+	 	*  never get here in those circumstances.
+	 	*/
+		if (!oc->trans_conn)
+		{
+	    		/*  treat as if an error occured on the read, which is what
+	     		*  used to happen
+	     		*/
+	    		YieldControlDeath();
+	    		return -1;
+		}
+
+while (gotnow < needed)
+{
+#ifdef LBX
+		if (oc->proxy && oc->proxy->compHandle)
+	    		result = (*oc->proxy->streamOpts.streamCompRead)(fd,
+			     (unsigned char *)oci->buffer + oci->bufcnt,
+			     oci->size - oci->bufcnt);
+	else
+#endif
+	    	result = _XSERVTransRead(oc->trans_conn, oci->buffer + oci->bufcnt,
+				     oci->size - oci->bufcnt); 
+		if (result < 0)
+		{
+	    		if ((result < 0) && ETEST(errno))
+	    		{
+#if defined(SVR4) && defined(i386) && !defined(sun)
+#if defined(LBX) && 0
+			/*
+		 	* For LBX connections, we can get a valid EWOULDBLOCK
+		 	* There is probably a better way of distinguishing LBX
+		 	* connections, but this works. (DHD)
+		 	*/
+			extern int LbxRead();
+				if (oc->Read == LbxRead)
+#else
+				if (0)
+#endif
+#endif
+				{
+		    			YieldControlNoInput();
+		    			return 0;
+				}
+	    		}
+	    		YieldControlDeath();
+	    		return -1;
+		}
+
+		if (result == 0)
+			break;
+
+		oci->bufcnt += result;
+		gotnow += result;
+		result = gotnow;
+
+	usleep(100000);
+}
+		/* free up some space after huge requests */
+		if ((oci->size > BUFWATERMARK) &&
+	    		(oci->bufcnt < BUFSIZE) && (needed < BUFSIZE))
+		{
+	    		char *ibuf;
+
+	    		ibuf = (char *)xrealloc(oci->buffer, BUFSIZE);
+	    		if (ibuf)
+	    		{
+				oci->size = BUFSIZE;
+				oci->buffer = ibuf;
+				oci->bufptr = ibuf + oci->bufcnt - gotnow;
+	    		}
+		}
+	    }
+	    else
+/* trying to fix the bigrequest bug, added by phost on 20050903, end */
 	    /* Still don't have enough; punt. */
-	    YieldControlNoInput();
-	    return 0;
+	    {
+	    	YieldControlNoInput();
+	    	return 0;
+	    }
 	}
     }
     if (needed == 0)
@@ -494,8 +617,9 @@
 	    FD_CLR(fd, &ClientsWithInput);
 	else
 #endif
-	    YieldControlNoInput();
+	   YieldControlNoInput(); 
     }
+
 #ifdef SMART_SCHEDULE
     if (SmartScheduleDisable)
 #endif
@@ -508,14 +632,17 @@
 	oci->bufptr += (sizeof(xBigReq) - sizeof(xReq));
 	*(xReq *)oci->bufptr = *request;
 	oci->lenLastReq -= (sizeof(xBigReq) - sizeof(xReq));
-	client->req_len -= (sizeof(xBigReq) - sizeof(xReq)) >> 2;
+	/* client->req_len -= (sizeof(xBigReq) - sizeof(xReq)) >> 2; */
+	/* added by phost */
+	if (client->req_len != 0)
+		client->req_len -= (sizeof(xBigReq) - sizeof(xReq)) >> 2;
     }
 #endif
     client->requestBuffer = (pointer)oci->bufptr;
 #ifdef DEBUG_COMMUNICATION
     {
 	xReq *req = client->requestBuffer;
-	ErrorF("REQUEST: ClientIDX: %i, type: 0x%x data: 0x%x len: %i\n",
+	ErrorF("REQUEST: ClientIDX: %i, type: 0x%x data: 0x%2x len: %2i\n",
 	       client->index,req->reqType,req->data,req->length);
     }
 #endif
s390x_64bit_s.patch (application/octet-stream, 2.5 KB)
diff -urp xc/programs/Xserver/include/colormapst.h.orig xc/programs/Xserver/include/colormapst.h
--- xc/programs/Xserver/include/colormapst.h.orig	2003-11-14 07:54:52.000000000 -0800
+++ xc/programs/Xserver/include/colormapst.h	2004-11-06 12:22:06.152889040 -0800
@@ -96,7 +96,7 @@ typedef struct _ColormapRec
 {
     VisualPtr	pVisual;
     short	class;		/* PseudoColor or DirectColor */
-    long	mid;		/* client's name for colormap */
+    unsigned int	mid;		/* client's name for colormap */
     ScreenPtr	pScreen;	/* screen map is associated with */
     short	flags;		/* 1 = IsDefault
 				 * 2 = AllAllocated */
diff -urp xc/programs/Xserver/include/pixmapstr.h.orig xc/programs/Xserver/include/pixmapstr.h
--- xc/programs/Xserver/include/pixmapstr.h.orig	2004-03-04 09:48:21.000000000 -0800
+++ xc/programs/Xserver/include/pixmapstr.h	2004-11-06 12:22:17.436905240 -0800
@@ -58,7 +58,7 @@ typedef struct _Drawable {
     unsigned char	class;	/* specific to type */
     unsigned char	depth;
     unsigned char	bitsPerPixel;
-    unsigned long	id;	/* resource id */
+    unsigned int	id;	/* resource id */
     short		x;	/* window: screen absolute, pixmap: 0 */
     short		y;	/* window: screen absolute, pixmap: 0 */
     unsigned short	width;
diff -urp xc/programs/Xserver/mi/miwideline.c.orig xc/programs/Xserver/mi/miwideline.c
--- xc/programs/Xserver/mi/miwideline.c.orig	2004-03-04 09:48:28.000000000 -0800
+++ xc/programs/Xserver/mi/miwideline.c	2004-11-06 12:24:21.405963608 -0800
@@ -101,6 +101,8 @@ miFillPolyHelper (pDrawable, pGC, pixel,
     left_height = 0;
     right_height = 0;
     
+    XID newPixel = (XID)pixel;
+
     if (!spanData)
     {
     	pptInit = (DDXPointPtr) ALLOCATE_LOCAL (overall_height * sizeof(*ppt));
@@ -117,7 +119,7 @@ miFillPolyHelper (pDrawable, pGC, pixel,
     	oldPixel = pGC->fgPixel;
     	if (pixel != oldPixel)
     	{
-    	    DoChangeGC (pGC, GCForeground, (XID *)&pixel, FALSE);
+    	    DoChangeGC (pGC, GCForeground, (XID *)&newPixel, FALSE);
     	    ValidateGC (pDrawable, pGC);
     	}
     }
@@ -206,6 +208,8 @@ miFillRectPolyHelper (
     Spans	spanRec;
     xRectangle  rect;
 
+    XID newPixel = (XID)pixel;
+
     if (!spanData)
     {
 	rect.x = x;
@@ -215,7 +219,7 @@ miFillRectPolyHelper (
     	oldPixel = pGC->fgPixel;
     	if (pixel != oldPixel)
     	{
-    	    DoChangeGC (pGC, GCForeground, (XID *)&pixel, FALSE);
+    	    DoChangeGC (pGC, GCForeground, (XID *)&newPixel, FALSE);
     	    ValidateGC (pDrawable, pGC);
     	}
 	(*pGC->ops->PolyFillRect) (pDrawable, pGC, 1, &rect);