Article View: comp.sys.ibm.pc.rt
Article #1851Re: compiling X11R4 under AOS for mpel
From: John F Carr
Date: Tue, 09 Jan 1990 20:26
Date: Tue, 09 Jan 1990 20:26
209 lines
6394 bytes
6394 bytes
In article <1990Jan9.154135.13344@ux1.cso.uiuc.edu> steven@pacific.csl.uiuc.edu writes:
>Can anyone (ibm?) recommend the proper compilers to use in compiling
>the server directory for AOS/mpel? I tried a vanilla compile which does
>everything as hc (2.1s) -O and the results seem less than wonderful --
>specifically, magic (6.0 beta) causes the server to go off into the trees
>by trying to draw some scrollbar glyphs manually using XDrawPoint().
I recently sent in a fix for this bug.
Subject: Fix for IBM Megapel PolyPoint
Date: Sat, 06 Jan 90 23:58:48 EST
From: John Carr <jfc@ATHENA.MIT.EDU>
VERSION:
R4
CLIENT MACHINE and OPERATING SYSTEM:
IBM RT, BSD 4.3
DISPLAY TYPE:
IBM Megapel
WINDOW MANAGER:
N/A
AREA:
server
SYNOPSIS:
Large poly point requests hang the server
DESCRIPTION:
The X server does not verify that the size of a command
sent to the megapel adapter is legal. Poly point requests
with 8K or more points are too large. The server hangs in
transmitting such a command because the adapter can not
properly process it.
REPEAT BY:
Run "xgc" and choose the points test.
SAMPLE FIX:
*** /afs/testers/src/x11r4/src/mit/server/ddx/ibm/mpel/mpelPolyPt.c Thu Nov 9 22:52:22 1989
--- mpelPolyPt.c Sat Jan 6 23:34:49 1990
***************
*** 52,57 ****
--- 52,60 ----
extern int mpelCheckCursor() ;
extern void mpelReplaceCursor() ;
+ /* The maximum number of points in a Polymarker request. */
+ #define MAXRQPTS (32760 / sizeof(mpelPoint))
+
void
mpelPolyPoint( pDrawable, pGC, mode, npt, pptInit )
DrawablePtr pDrawable ;
***************
*** 65,74 ****
register RegionPtr pRegion = devPriv->pCompositeClip ;
int cursor_saved ;
! TRACE( ("mpelPolyPoint(0x%x,0x%x,%d,%d,0x%x)\n",
! pDrawable, pGC, mode, npt, pptInit ) ) ;
! if ( pGC->alu == GXnoop || REGION_NIL(pRegion) )
return ;
if ( pDrawable->type == DRAWABLE_PIXMAP ) {
--- 68,78 ----
register RegionPtr pRegion = devPriv->pCompositeClip ;
int cursor_saved ;
! TRACE( ("mpelPolyPoint(0x%x,0x%x,\"%s\",%d,0x%x)\n",
! pDrawable, pGC, (mode == CoordModePrevious) ?
! "Relative" : "Absolute", npt, pptInit));
! if ( pGC->alu == GXnoop || REGION_NIL(pRegion) || npt == 0)
return ;
if ( pDrawable->type == DRAWABLE_PIXMAP ) {
***************
*** 82,128 ****
*/
{
register const int xorg = pDrawable->x ;
! register const int yorg =
! ( MPEL_HEIGHT - 1 ) - pDrawable->y ;
register int nptTmp = npt ;
! if ( mode == CoordModePrevious )
! for ( ppt = pptInit ; --nptTmp ; ) {
ppt++ ;
! ppt->x += (ppt-1)->x + xorg ;
! ppt->y = yorg - ( ppt->y + (ppt-1)->y ) ;
}
! else
for ( ppt = pptInit ; nptTmp-- ; ppt++ ) {
ppt->x += xorg ;
! ppt->y = yorg - ppt->y ;
}
}
!
! { /* Validate & Translate the point list */
! register int (* PointInRegion)() =
! pDrawable->pScreen->PointInRegion ;
! register xPoint *mpt ; /* xPoint is the same as mpelPoint */
! BoxRec box ; /* Scratch Space */
!
! /* NOTE: pGC->miTranslate is always TRUE in mpel */
! for ( ppt = pptInit ;
! npt-- && (* PointInRegion)( pRegion, ppt->x,
! MPEL_HEIGHT - 1 - ppt->y,
! &box ) ;
! ppt++ )
! /* Do Nothing */ ;
! if ( npt > 0 )
! {
! for ( mpt = ppt ; npt-- ; ppt++ )
! if ( (* PointInRegion)( pRegion, ppt->x,
! ppt->y, &box ) )
! *mpt++ = *ppt ;
}
-
- if ( !( npt = mpt - pptInit) )
- return ;
-
}
/* If Cursor Is In The Way Remove It */
cursor_saved = !mpelcursorSemaphore
&& mpelCheckCursor(
--- 86,133 ----
*/
{
register const int xorg = pDrawable->x;
! register const int yorg = pDrawable->y;
register int nptTmp = npt;
! register xPoint *mpt = pptInit;
! register int (* PointInRegion)() = pDrawable->pScreen->PointInRegion;
! BoxRec box;
!
! if ( mode == CoordModePrevious ) {
! ppt = pptInit;
! ppt->x += xorg;
! ppt->y += yorg;
! if((* PointInRegion)( pRegion, ppt->x, ppt->y, &box)) {
! mpt->x = ppt->x;
! mpt->y = (MPEL_HEIGHT - 1) - ppt->y;
! mpt++;
! }
! while (--nptTmp) {
ppt++;
! ppt->x += xorg + (ppt-1)->x;
! ppt->y = yorg + ppt->y + (ppt-1)->y;
! if((* PointInRegion)( pRegion, ppt->x, ppt->y, &box)) {
! mpt->x = ppt->x;
! mpt->y = (MPEL_HEIGHT - 1) - ppt->y;
! mpt++;
}
! }
! npt = mpt - pptInit;
! } else {
for ( ppt = pptInit ; nptTmp-- ; ppt++ ) {
ppt->x += xorg;
! ppt->y += yorg;
! if((* PointInRegion)( pRegion, ppt->x, ppt->y, &box)) {
! mpt->x = ppt->x;
! mpt->y = (MPEL_HEIGHT - 1) - ppt->y;
! mpt++;
}
}
! npt = mpt - pptInit;
}
}
+ TRACE(("mpelPolyPoint: %d points\n", npt));
+ if(!npt) /* Nothing to do */
+ return;
/* If Cursor Is In The Way Remove It */
cursor_saved = !mpelcursorSemaphore
&& mpelCheckCursor(
***************
*** 146,153 ****
MPELSetPolymarkerColor( pGC->fgPixel ) ;
}
MPELSetMarkerType( 1 ) ; /* Magic number for solid dots */
! MPELPolymarker( npt, pptInit ) ;
!
if ( cursor_saved )
mpelReplaceCursor() ;
--- 151,164 ----
MPELSetPolymarkerColor( pGC->fgPixel ) ;
}
MPELSetMarkerType( 1 ) ; /* Magic number for solid dots */
! /* Break into bite-sized pieces */
! {
! register int rem;
! /* MPELPolymarker does not evaluate any of its arguments
! more than once. */
! for(rem = npt;rem > 0;rem -= MAXRQPTS, pptInit+=MAXRQPTS)
! MPELPolymarker((rem>MAXRQPTS)?MAXRQPTS:rem, pptInit);
! }
if ( cursor_saved )
mpelReplaceCursor() ;
--John Carr (jfc@athena.mit.edu)
Project Athena Systems Development
Technical Details
Message-ID:
<1990Jan9.202615.24960@athena.mit.edu>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!uunet!tut.cis.ohio-state.edu!snorkelwacker!bloom-beacon!athena.mit.edu!jfcReferences:
<1990Jan9.154135.13344@ux1.cso.uiuc.edu>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!uunet!tut.cis.ohio-state.edu!snorkelwacker!bloom-beacon!athena.mit.edu!jfc From: jfc@athena.mit.edu (John F Carr) Newsgroups: comp.sys.ibm.pc.rt Subject: Re: compiling X11R4 under AOS for mpel Message-ID: <1990Jan9.202615.24960@athena.mit.edu> Date: 9 Jan 90 20:26:15 GMT References: <1990Jan9.154135.13344@ux1.cso.uiuc.edu> Sender: news@athena.mit.edu (News system) Reply-To: jfc@athena.mit.edu (John F Carr) Organization: Massachusetts Institute of Technology Lines: 209