]> git.pld-linux.org Git - packages/XFree86.git/blob - XFree86-voodoo-Rush.patch
- outdated
[packages/XFree86.git] / XFree86-voodoo-Rush.patch
1 diff -c -N -r xc.old/config/cf/X11.tmpl xc/config/cf/X11.tmpl
2 *** xc.old/config/cf/X11.tmpl   Mon Mar  2 03:55:22 1998
3 --- xc/config/cf/X11.tmpl       Sat Apr 11 13:56:54 1998
4 ***************
5 *** 202,207 ****
6 --- 202,213 ----
7   #ifndef BuildXF86DGALibrary
8   #define BuildXF86DGALibrary   BuildXF86DGA
9   #endif
10 + #ifndef BuildXF86RushExt
11 + #define BuildXF86RushExt      NO
12 + #endif
13 + #ifndef BuildXF86RushLibrary
14 + #define BuildXF86RushLibrary  BuildXF86RushExt
15 + #endif
16   #ifndef BuildDPMSExt
17   #define BuildDPMSExt          NO
18   #endif
19 ***************
20 *** 992,997 ****
21 --- 998,1019 ----
22   #endif
23   #endif
24   
25 + #if BuildXF86RushLibrary
26 + #ifndef SharedLibXxf86rush
27 + #define SharedLibXxf86rush    YES
28 + #endif
29 + #ifndef NormalLibXxf86rush
30 + #define NormalLibXxf86rush    YES
31 + #endif
32 + #ifndef DebugLibXxf86rush
33 + #define DebugLibXxf86rush     NO
34 + #endif
35 + #ifndef ProfileLibXxf86rush
36 + #define ProfileLibXxf86rush   NO
37 + #endif
38 + #endif
39
40
41   #if BuildDPMSLibrary
42   #ifndef SharedLibXdpms
43   #define SharedLibXdpms                NO
44 ***************
45 *** 1078,1083 ****
46 --- 1100,1117 ----
47   SharedLibReferences(XXF86DGA,Xxf86dga,$(XXF86DGALIBSRC),SOXXF86DGAREV,SharedXxf86dgaRev)
48   #else
49   ProjectUnsharedLibReferences(XXF86DGA,Xxf86dga,$(XXF86DGALIBSRC),XBuildLibDir)
50 + #endif
51 + #endif
52
53 + #if BuildXF86RushLibrary
54 +    XXF86RUSHLIBSRC = $(LIBSRC)/Xxf86rush
55 + #if SharedLibXxf86rush
56 + #ifndef SharedXxf86RushRev
57 + #define SharedXxf86RushRev 1.0
58 + #endif
59 + SharedLibReferences(XXF86RUSH,Xxf86rush,$(XXF86RUSHLIBSRC),SOXXF86RUSHREV,SharedXxf86RushRev)
60 + #else
61 + ProjectUnsharedLibReferences(XXF86RUSH,Xxf86rush,$(XXF86RUSHLIBSRC),XBuildLibDir)
62   #endif
63   #endif
64   
65 diff -c -N -r xc.old/config/cf/xfree86.cf xc/config/cf/xfree86.cf
66 *** xc.old/config/cf/xfree86.cf Mon Mar  2 03:55:22 1998
67 --- xc/config/cf/xfree86.cf     Sat Apr 11 15:34:02 1998
68 ***************
69 *** 619,624 ****
70 --- 619,627 ----
71   #ifndef BuildDPMSLibrary
72   #define BuildDPMSLibrary      YES
73   #endif
74 + #ifndef BuildXF86RushLibrary
75 + #define BuildXF86RushLibrary  YES
76 + #endif
77   
78   /*
79    * Build the XFree86-VidMode extension
80 ***************
81 *** 673,678 ****
82 --- 676,688 ----
83   #define BuildDPMSExt                  YES
84   #endif
85   
86 + /*
87 +  * Build the Rush extension support
88 +  */
89 + #ifndef BuildXF86RushExt
90 + #define BuildXF86RushExt              YES
91 + #endif
92
93   #if Malloc0ReturnsNull
94   #ifndef XtMalloc0ReturnsNullDefines
95   #define XtMalloc0ReturnsNullDefines   Malloc0ReturnsNullDefines -DXTMALLOC_BC
96 ***************
97 *** 764,769 ****
98 --- 774,785 ----
99   #define XFree86DGADefines     /**/
100   #endif
101   
102 + #if BuildXF86RushExt
103 + #define XFree86RushDefines    -DXFreeXRUSH
104 + #else
105 + #define XFree86RushDefines    /**/
106 + #endif
107
108   #ifndef MakeHasPosixVariableSubstitutions
109   #if !HasBsdMake
110   #define MakeHasPosixVariableSubstitutions     NO
111 ***************
112 *** 774,780 ****
113   
114   /* Server defines required for all OSs */
115   #ifndef XFree86ServerDefines
116 ! #define XFree86ServerDefines  -DSTATIC_COLOR -DAVOID_GLYPHBLT -DPIXPRIV LinkKitDefines XFree86DGADefines
117   #endif
118   
119   #ifndef XFree86ServerOSDefines
120 --- 790,796 ----
121   
122   /* Server defines required for all OSs */
123   #ifndef XFree86ServerDefines
124 ! #define XFree86ServerDefines  -DSTATIC_COLOR -DAVOID_GLYPHBLT -DPIXPRIV LinkKitDefines XFree86DGADefines XFree86RushDefines
125   #endif
126   
127   #ifndef XFree86ServerOSDefines
128 *** xc.old/include/extensions/Imakefile Sun Jan 12 02:39:14 1997
129 --- xc/include/extensions/Imakefile     Sun Apr  5 17:34:16 1998
130 ***************
131 *** 14,19 ****
132 --- 14,22 ----
133   #if BuildXF86DGALibrary
134   XF86DGAHEADERS = xf86dga.h xf86dgastr.h
135   #endif
136 + #if BuildXF86RushLibrary
137 + XF86RUSHHEADERS = xf86rush.h xf86rushstr.h
138 + #endif
139   #if BuildLBX
140   LBXHEADERS = lbxbuf.h lbxbufstr.h lbxdeltastr.h lbximage.h lbxopts.h lbxstr.h lbxzlib.h
141   #endif
142 ***************
143 *** 21,27 ****
144   DPMSHEADERS = dpms.h dpmsstr.h
145   #endif
146   
147 ! EXTRAHEADERS = $(SCREENSAVERHEADERS) $(XF86VIDMODEHEADERS) $(XF86DGAHEADERS) $(XF86MISCHEADERS) $(LBXHEADERS) $(DPMSHEADERS)
148   
149   
150   
151 --- 24,30 ----
152   DPMSHEADERS = dpms.h dpmsstr.h
153   #endif
154   
155 ! EXTRAHEADERS = $(SCREENSAVERHEADERS) $(XF86VIDMODEHEADERS) $(XF86DGAHEADERS) $(XF86RUSHHEADERS) $(XF86MISCHEADERS) $(LBXHEADERS) $(DPMSHEADERS)
156   
157   
158   
159 diff -c -N -r xc.old/include/extensions/xf86rush.h xc/include/extensions/xf86rush.h
160 *** xc.old/include/extensions/xf86rush.h        Wed Dec 31 16:00:00 1969
161 --- xc/include/extensions/xf86rush.h    Sun Apr 19 15:56:23 1998
162 ***************
163 *** 0 ****
164 --- 1,70 ----
165 + /* $$ */
166 + /*
167
168 + Copyright (c) 1998  Daryll Strauss
169
170 + */
171
172 + #ifndef _XF86RUSH_H_
173 + #define _XF86RUSH_H_
174
175 + #include <X11/Xfuncproto.h>
176
177 + #define X_XF86RushQueryVersion                0
178 + #define X_XF86RushLockPixmap          1
179 + #define X_XF86RushUnlockPixmap                2
180 + #define X_XF86RushUnlockAllPixmaps    3
181
182 + #define XF86RushNumberEvents          0
183
184 + #define XF86RushClientNotLocal                0
185 + #define XF86RushNumberErrors          (XF86RushClientNotLocal + 1)
186
187 + #ifndef _XF86RUSH_SERVER_
188
189 + _XFUNCPROTOBEGIN
190
191 + Bool XF86RushQueryVersion(
192 + #if NeedFunctionPrototypes
193 +     Display*          /* dpy */,
194 +     int*              /* majorVersion */,
195 +     int*              /* minorVersion */
196 + #endif
197 + );
198
199 + Bool XF86RushQueryExtension(
200 + #if NeedFunctionPrototypes
201 +     Display*          /* dpy */,
202 +     int*              /* event_base */,
203 +     int*              /* error_base */
204 + #endif
205 + );
206
207 + Bool XF86RushLockPixmap(
208 + #if NeedFunctionPrototypes
209 +     Display *         /* dpy */,
210 +     int                       /* screen */,
211 +     Pixmap            /* Pixmap */,
212 +     void **           /* Return address */
213 + #endif
214 + );
215
216 + Bool XF86RushUnlockPixmap(
217 + #if NeedFunctionPrototypes
218 +     Display *         /* dpy */,
219 +     int                       /* screen */,
220 +     Pixmap            /* Pixmap */
221 + #endif
222 + ); 
223
224 + Bool XF86RushUnlockAllPixmaps(
225 + #if NeedFunctionPrototypes
226 +     Display *         /* dpy */
227 + #endif                            
228 + );
229
230 + _XFUNCPROTOEND
231
232 + #endif /* _XF86RUSH_SERVER_ */
233
234 + #endif /* _XF86RUSH_H_ */
235 diff -c -N -r xc.old/include/extensions/xf86rushstr.h xc/include/extensions/xf86rushstr.h
236 *** xc.old/include/extensions/xf86rushstr.h     Wed Dec 31 16:00:00 1969
237 --- xc/include/extensions/xf86rushstr.h Sun Apr  5 21:44:32 1998
238 ***************
239 *** 0 ****
240 --- 1,82 ----
241 + /* $$ */
242 + /*
243
244 + Copyright (c) 1998  Daryll Strauss
245
246 + */
247
248 + #ifndef _XF86RUSHSTR_H_
249 + #define _XF86RUSHSTR_H_
250
251 + #include "xf86rush.h"
252
253 + #define XF86RUSHNAME "XFree86-Rush"
254
255 + #define XF86RUSH_MAJOR_VERSION        1       /* current version numbers */
256 + #define XF86RUSH_MINOR_VERSION        0
257
258 + typedef struct _XF86RushQueryVersion {
259 +     CARD8     reqType;                /* always RushReqCode */
260 +     CARD8     rushReqType;            /* always X_RushQueryVersion */
261 +     CARD16    length B16;
262 + } xXF86RushQueryVersionReq;
263 + #define sz_xXF86RushQueryVersionReq   4
264
265 + typedef struct {
266 +     BYTE      type;                   /* X_Reply */
267 +     BOOL      pad1;
268 +     CARD16    sequenceNumber B16;
269 +     CARD32    length B32;
270 +     CARD16    majorVersion B16;       /* major version of Rush protocol */
271 +     CARD16    minorVersion B16;       /* minor version of Rush protocol */
272 +     CARD32    pad2 B32;
273 +     CARD32    pad3 B32;
274 +     CARD32    pad4 B32;
275 +     CARD32    pad5 B32;
276 +     CARD32    pad6 B32;
277 + } xXF86RushQueryVersionReply;
278 + #define sz_xXF86RushQueryVersionReply 32
279
280 + typedef struct _XF86RushLockPixmap {
281 +     CARD8     reqType;                /* always RushReqCode */
282 +     CARD8     rushReqType;            /* always X_RushLockPixmap */
283 +     CARD16    length B16;
284 +     CARD16    screen B16;
285 +     CARD16    pad B16;
286 +     CARD32    pixmap B32;
287 + } xXF86RushLockPixmapReq;
288 + #define sz_xXF86RushLockPixmapReq     12
289
290 + typedef struct {
291 +     BYTE      type;
292 +     BOOL      pad1;
293 +     CARD16    sequenceNumber B16;
294 +     CARD32    length B32;
295 +     CARD32    addr B32;
296 +     CARD32    pad2 B32;
297 +     CARD32    pad3 B32;
298 +     CARD32    pad4 B32;
299 +     CARD32    pad5 B32;
300 +     CARD32    pad6 B32;
301 + } xXF86RushLockPixmapReply;
302 + #define sz_xXF86RushLockPixmapReply   32
303
304 + typedef struct _XF86RushUnlockPixmap {
305 +     CARD8     reqType;                /* always RushReqCode */
306 +     CARD8     rushReqType;            /* always X_RushUnlockPixmap */
307 +     CARD16    length B16;
308 +     CARD16    screen B16;
309 +     CARD16    pad B16;
310 +     CARD32    pixmap B32;
311 + } xXF86RushUnlockPixmapReq;
312 + #define sz_xXF86RushUnlockPixmapReq   12
313
314 + typedef struct _XF86RushUnlockAllPixmaps {
315 +     CARD8     reqType;                /* always RushReqCode */
316 +     CARD8     rushReqType;            /* always X_RushUnlockAllPixmaps */
317 +     CARD16      length B16;
318 + } xXF86RushUnlockAllPixmapsReq;
319 + #define sz_xXF86RushUnlockAllPixmapsReq   4
320
321 + #endif /* _XF86RUSHSTR_H_ */
322
323 diff -c -N -r xc.old/lib/Imakefile xc/lib/Imakefile
324 *** xc.old/lib/Imakefile        Sat Jul  5 08:55:33 1997
325 --- xc/lib/Imakefile    Sat Apr 11 13:24:59 1998
326 ***************
327 *** 39,45 ****
328   XF86DGALIB = Xxf86dga
329   #endif
330   
331 ! XF86EXTLIBS = $(XF86MISCLIB) $(XF86VMLIB) $(XF86DGALIB)
332   
333   #if BuildDPMSLibrary
334   XDPMSLIBDIR = Xdpms
335 --- 39,49 ----
336   XF86DGALIB = Xxf86dga
337   #endif
338   
339 ! #if BuildXF86RushLibrary
340 ! XF86RUSHLIB = Xxf86rush
341 ! #endif
342
343 ! XF86EXTLIBS = $(XF86MISCLIB) $(XF86VMLIB) $(XF86DGALIB) $(XF86RUSHLIB)
344   
345   #if BuildDPMSLibrary
346   XDPMSLIBDIR = Xdpms
347 ***************
348 *** 61,67 ****
349   
350   #if !BuildServersOnly
351   LINTSUBDIRS = Xau Xdmcp $(THRSTUBLIB) X11 oldX ICE SM Xext Xt \
352 !            $(SSLIB) $(XF86MISCLIB) $(XF86VMLIB) $(XF86DGALIB) \
353              Xmu Xaw XIE Xi Xtst FS \
354              PEX5 $(XKBLIBDIR) $(XKBUILIBDIR) $(LBXUTILDIR) $(XALIBDIR) \
355              $(XDPMSLIBDIR) \
356 --- 65,71 ----
357   
358   #if !BuildServersOnly
359   LINTSUBDIRS = Xau Xdmcp $(THRSTUBLIB) X11 oldX ICE SM Xext Xt \
360 !            $(SSLIB) $(XF86MISCLIB) $(XF86VMLIB) $(XF86DGALIB) $(XF86RUSHLIB) \
361              Xmu Xaw XIE Xi Xtst FS \
362              PEX5 $(XKBLIBDIR) $(XKBUILIBDIR) $(LBXUTILDIR) $(XALIBDIR) \
363              $(XDPMSLIBDIR) \
364 diff -c -N -r xc.old/lib/Xext/XF86Rush.c xc/lib/Xext/XF86Rush.c
365 *** xc.old/lib/Xext/XF86Rush.c  Wed Dec 31 16:00:00 1969
366 --- xc/lib/Xext/XF86Rush.c      Sun Apr  5 18:01:55 1998
367 ***************
368 *** 0 ****
369 --- 1,163 ----
370 + /* $$ */
371 + /*
372
373 + Copyright (c) 1998 Daryll Strauss
374
375 + */
376
377 + /* THIS IS NOT AN X CONSORTIUM STANDARD */
378
379 + #define NEED_EVENTS
380 + #define NEED_REPLIES
381 + #include "Xlibint.h"
382 + #include "xf86rushstr.h"
383 + #include "Xext.h"
384 + #include "extutil.h"
385
386 + static XExtensionInfo _xf86rush_info_data;
387 + static XExtensionInfo *xf86rush_info = &_xf86rush_info_data;
388 + static char *xf86rush_extension_name = XF86RUSHNAME;
389
390 + #define XF86RushCheckExtension(dpy,i,val) \
391 +   XextCheckExtension (dpy, i, xf86rush_extension_name, val)
392
393 + /*****************************************************************************
394 +  *                                                                           *
395 +  *                       private utility routines                          *
396 +  *                                                                           *
397 +  *****************************************************************************/
398
399 + static int close_display();
400 + static /* const */ XExtensionHooks xf86rush_extension_hooks = {
401 +     NULL,                             /* create_gc */
402 +     NULL,                             /* copy_gc */
403 +     NULL,                             /* flush_gc */
404 +     NULL,                             /* free_gc */
405 +     NULL,                             /* create_font */
406 +     NULL,                             /* free_font */
407 +     close_display,                    /* close_display */
408 +     NULL,                             /* wire_to_event */
409 +     NULL,                             /* event_to_wire */
410 +     NULL,                             /* error */
411 +     NULL,                             /* error_string */
412 + };
413
414 + static XEXT_GENERATE_FIND_DISPLAY (find_display, xf86rush_info, 
415 +                                  xf86rush_extension_name, 
416 +                                  &xf86rush_extension_hooks, 
417 +                                  0, NULL)
418
419 + static XEXT_GENERATE_CLOSE_DISPLAY (close_display, xf86rush_info)
420
421
422 + /*****************************************************************************
423 +  *                                                                           *
424 +  *                public XFree86-DGA Extension routines                *
425 +  *                                                                           *
426 +  *****************************************************************************/
427
428 + Bool XF86RushQueryExtension (dpy, event_basep, error_basep)
429 +     Display *dpy;
430 +     int *event_basep, *error_basep;
431 + {
432 +     XExtDisplayInfo *info = find_display (dpy);
433
434 +     if (XextHasExtension(info)) {
435 +       *event_basep = info->codes->first_event;
436 +       *error_basep = info->codes->first_error;
437 +       return True;
438 +     } else {
439 +       return False;
440 +     }
441 + }
442
443 + Bool XF86RushQueryVersion(dpy, majorVersion, minorVersion)
444 +     Display* dpy;
445 +     int* majorVersion; 
446 +     int* minorVersion;
447 + {
448 +     XExtDisplayInfo *info = find_display (dpy);
449 +     xXF86RushQueryVersionReply rep;
450 +     xXF86RushQueryVersionReq *req;
451
452 +     XF86RushCheckExtension (dpy, info, False);
453
454 +     LockDisplay(dpy);
455 +     GetReq(XF86RushQueryVersion, req);
456 +     req->reqType = info->codes->major_opcode;
457 +     req->dgaReqType = X_XF86RushQueryVersion;
458 +     if (!_XReply(dpy, (xReply *)&rep, 0, xFalse)) {
459 +       UnlockDisplay(dpy);
460 +       SyncHandle();
461 +       return False;
462 +     }
463 +     *majorVersion = rep.majorVersion;
464 +     *minorVersion = rep.minorVersion;
465 +     UnlockDisplay(dpy);
466 +     SyncHandle();
467 +     return True;
468 + }
469
470 + Bool XF86RushLockPixmap(dpy, screen, pixmap, addr)
471 +      Display *dpy;
472 +      int screen;
473 +      Pixmap pixmap;
474 +      void **addr;
475 + {
476 +   XExtDisplayInfo *info = find_display (dpy);
477 +   xXF86RushLockPixmapReply rep;
478 +   xXF86RushLockPixmapReq *req;
479
480 +   XF86RushCheckExtension (dpy, info, False);
481 +   LockDisplay(dpy);
482 +   GetReq(XF86RushLockPixmap, req);
483 +   req->reqType = info->codes->major_opcode;
484 +   req->dgaReqType = X_XF86RushLockPixmap;
485 +   req->screen=screen;
486 +   req->pixmap=pixmap;
487 +   if (!_XReply(dpy, (xReply *)&rep, 0, xFalse)) {
488 +     UnlockDisplay(dpy);
489 +     SyncHandle();
490 +     return False;
491 +   }
492 +   *addr=(void*)rep.addr;
493 +   UnlockDisplay(dpy);
494 +   SyncHandle();
495 +   return True;
496 + }
497
498 + Bool XF86RushUnlockPixmap(dpy, screen, pixmap)
499 +      Display *dpy;
500 +      int screen;
501 +      Pixmap pixmap;
502 + {
503 +   XExtDisplayInfo *info = find_display(dpy);
504 +   xXF86RushUnlockPixmapReq *req;
505
506 +   XF86RushCheckExtension (dpy, info, False);
507 +   LockDisplay(dpy);
508 +   GetReq(XF86RushUnlockPixmap, req);
509 +   req->reqType = info->codes->major_opcode;
510 +   req->dgaReqType = X_XF86RushUnlockPixmap;
511 +   req->screen=screen;
512 +   req->pixmap=pixmap;
513 +   UnlockDisplay(dpy);
514 +   SyncHandle();
515 +   return True;
516 + }
517
518 + Bool XF86RushUnlockAllPixmaps(dpy)
519 +      Display *dpy;
520 + {
521 +   XExtDisplayInfo *info = find_display(dpy);
522 +   xXF86RushUnlockAllPixmapsReq *req;
523
524 +   XF86RushCheckExtension (dpy, info, False);
525 +   LockDisplay(dpy);
526 +   GetReq(XF86RushUnlockAllPixmaps, req);
527 +   req->reqType = info->codes->major_opcode;
528 +   req->dgaReqType = X_XF86RushUnlockAllPixmaps;
529 +   UnlockDisplay(dpy);
530 +   SyncHandle();
531 +   return True;
532 + }
533 diff -c -N -r xc.old/lib/Xxf86rush/Imakefile xc/lib/Xxf86rush/Imakefile
534 *** xc.old/lib/Xxf86rush/Imakefile      Wed Dec 31 16:00:00 1969
535 --- xc/lib/Xxf86rush/Imakefile  Sat Apr 11 13:29:38 1998
536 ***************
537 *** 0 ****
538 --- 1,33 ----
539 + XCOMM $$
540 + #define DoNormalLib NormalLibXxf86rush
541 + #define DoSharedLib SharedLibXxf86rush
542 + #define DoDebugLib DebugLibXxf86rush
543 + #define DoProfileLib ProfileLibXxf86rush
544 + #define LibName Xxf86rush
545 + #define SoRev SOXXF86RUSHREV
546 + #define LibHeaders NO
547
548 + #include <Threads.tmpl>
549
550 + #ifdef SharedXxf86rushReqs
551 + REQUIREDLIBS = SharedXxf86rushReqs
552 + #endif
553
554 + XF86RUSHSRCS = XF86Rush.c
555 + XF86RUSHOBJS = XF86Rush.o
556
557 + #if Malloc0ReturnsNull
558 + ALLOC_DEFINES = -DMALLOC_0_RETURNS_NULL
559 + #endif
560
561 +       DEFINES = $(ALLOC_DEFINES)
562 +      INCLUDES = -I$(XLIBSRC) -I$(EXTINCSRC)
563 +          SRCS = $(XF86RUSHSRCS)
564 +          OBJS = $(XF86RUSHOBJS)
565 +      LINTLIBS = $(LINTXLIB)
566
567 + #include <Library.tmpl>
568
569 + DependTarget()
570
571
572 diff -c -N -r xc.old/lib/Xxf86rush/XF86Rush.c xc/lib/Xxf86rush/XF86Rush.c
573 *** xc.old/lib/Xxf86rush/XF86Rush.c     Wed Dec 31 16:00:00 1969
574 --- xc/lib/Xxf86rush/XF86Rush.c Sat Apr 11 13:55:40 1998
575 ***************
576 *** 0 ****
577 --- 1,163 ----
578 + /* $$ */
579 + /*
580
581 + Copyright (c) 1998 Daryll Strauss
582
583 + */
584
585 + /* THIS IS NOT AN X CONSORTIUM STANDARD */
586
587 + #define NEED_EVENTS
588 + #define NEED_REPLIES
589 + #include "Xlibint.h"
590 + #include "xf86rushstr.h"
591 + #include "Xext.h"
592 + #include "extutil.h"
593
594 + static XExtensionInfo _xf86rush_info_data;
595 + static XExtensionInfo *xf86rush_info = &_xf86rush_info_data;
596 + static char *xf86rush_extension_name = XF86RUSHNAME;
597
598 + #define XF86RushCheckExtension(dpy,i,val) \
599 +   XextCheckExtension (dpy, i, xf86rush_extension_name, val)
600
601 + /*****************************************************************************
602 +  *                                                                           *
603 +  *                       private utility routines                          *
604 +  *                                                                           *
605 +  *****************************************************************************/
606
607 + static int close_display();
608 + static /* const */ XExtensionHooks xf86rush_extension_hooks = {
609 +     NULL,                             /* create_gc */
610 +     NULL,                             /* copy_gc */
611 +     NULL,                             /* flush_gc */
612 +     NULL,                             /* free_gc */
613 +     NULL,                             /* create_font */
614 +     NULL,                             /* free_font */
615 +     close_display,                    /* close_display */
616 +     NULL,                             /* wire_to_event */
617 +     NULL,                             /* event_to_wire */
618 +     NULL,                             /* error */
619 +     NULL,                             /* error_string */
620 + };
621
622 + static XEXT_GENERATE_FIND_DISPLAY (find_display, xf86rush_info, 
623 +                                  xf86rush_extension_name, 
624 +                                  &xf86rush_extension_hooks, 
625 +                                  0, NULL)
626
627 + static XEXT_GENERATE_CLOSE_DISPLAY (close_display, xf86rush_info)
628
629
630 + /*****************************************************************************
631 +  *                                                                           *
632 +  *                public XFree86-DGA Extension routines                *
633 +  *                                                                           *
634 +  *****************************************************************************/
635
636 + Bool XF86RushQueryExtension (dpy, event_basep, error_basep)
637 +     Display *dpy;
638 +     int *event_basep, *error_basep;
639 + {
640 +     XExtDisplayInfo *info = find_display (dpy);
641
642 +     if (XextHasExtension(info)) {
643 +       *event_basep = info->codes->first_event;
644 +       *error_basep = info->codes->first_error;
645 +       return True;
646 +     } else {
647 +       return False;
648 +     }
649 + }
650
651 + Bool XF86RushQueryVersion(dpy, majorVersion, minorVersion)
652 +     Display* dpy;
653 +     int* majorVersion; 
654 +     int* minorVersion;
655 + {
656 +     XExtDisplayInfo *info = find_display (dpy);
657 +     xXF86RushQueryVersionReply rep;
658 +     xXF86RushQueryVersionReq *req;
659
660 +     XF86RushCheckExtension (dpy, info, False);
661
662 +     LockDisplay(dpy);
663 +     GetReq(XF86RushQueryVersion, req);
664 +     req->reqType = info->codes->major_opcode;
665 +     req->rushReqType = X_XF86RushQueryVersion;
666 +     if (!_XReply(dpy, (xReply *)&rep, 0, xFalse)) {
667 +       UnlockDisplay(dpy);
668 +       SyncHandle();
669 +       return False;
670 +     }
671 +     *majorVersion = rep.majorVersion;
672 +     *minorVersion = rep.minorVersion;
673 +     UnlockDisplay(dpy);
674 +     SyncHandle();
675 +     return True;
676 + }
677
678 + Bool XF86RushLockPixmap(dpy, screen, pixmap, addr)
679 +      Display *dpy;
680 +      int screen;
681 +      Pixmap pixmap;
682 +      void **addr;
683 + {
684 +   XExtDisplayInfo *info = find_display (dpy);
685 +   xXF86RushLockPixmapReply rep;
686 +   xXF86RushLockPixmapReq *req;
687
688 +   XF86RushCheckExtension (dpy, info, False);
689 +   LockDisplay(dpy);
690 +   GetReq(XF86RushLockPixmap, req);
691 +   req->reqType = info->codes->major_opcode;
692 +   req->rushReqType = X_XF86RushLockPixmap;
693 +   req->screen=screen;
694 +   req->pixmap=pixmap;
695 +   if (!_XReply(dpy, (xReply *)&rep, 0, xFalse)) {
696 +     UnlockDisplay(dpy);
697 +     SyncHandle();
698 +     return False;
699 +   }
700 +   *addr=(void*)rep.addr;
701 +   UnlockDisplay(dpy);
702 +   SyncHandle();
703 +   return True;
704 + }
705
706 + Bool XF86RushUnlockPixmap(dpy, screen, pixmap)
707 +      Display *dpy;
708 +      int screen;
709 +      Pixmap pixmap;
710 + {
711 +   XExtDisplayInfo *info = find_display(dpy);
712 +   xXF86RushUnlockPixmapReq *req;
713
714 +   XF86RushCheckExtension (dpy, info, False);
715 +   LockDisplay(dpy);
716 +   GetReq(XF86RushUnlockPixmap, req);
717 +   req->reqType = info->codes->major_opcode;
718 +   req->rushReqType = X_XF86RushUnlockPixmap;
719 +   req->screen=screen;
720 +   req->pixmap=pixmap;
721 +   UnlockDisplay(dpy);
722 +   SyncHandle();
723 +   return True;
724 + }
725
726 + Bool XF86RushUnlockAllPixmaps(dpy)
727 +      Display *dpy;
728 + {
729 +   XExtDisplayInfo *info = find_display(dpy);
730 +   xXF86RushUnlockAllPixmapsReq *req;
731
732 +   XF86RushCheckExtension (dpy, info, False);
733 +   LockDisplay(dpy);
734 +   GetReq(XF86RushUnlockAllPixmaps, req);
735 +   req->reqType = info->codes->major_opcode;
736 +   req->rushReqType = X_XF86RushUnlockAllPixmaps;
737 +   UnlockDisplay(dpy);
738 +   SyncHandle();
739 +   return True;
740 + }
741 diff -c -N -r xc.old/programs/Xserver/Xext/Imakefile ./Xext/Imakefile
742 *** xc.old/programs/Xserver/Xext/Imakefile      Fri Jan 23 04:35:11 1998
743 --- xc/programs/Xserver/Xext/Imakefile  Sun Apr  4 18:13:41 1999
744 ***************
745 *** 32,37 ****
746 --- 32,42 ----
747    DPMSOBJS = dpms.o
748   #endif
749   
750 + #if BuildXF86RushExt
751 +  XF86RRUSHSRCS = xf86Rush.c
752 +  XF86RUSHOBJS = xf86Rush.o
753 + #endif
754
755   #if BuildAppgroup
756     APPGROUPSRCS = appgroup.c
757     APPGROUPOBJS = appgroup.o
758 ***************
759 *** 47,59 ****
760                 mitmisc.c xtest.c xtest1di.c xtest1dd.c sleepuntil.c \
761               bigreq.c sync.c $(SCRNSAVSRC) xcmisc.c $(VIDMODESRCS) \
762               $(XF86MISCSRCS) $(XF86DGASRCS) $(SECURITYSRCS) \
763 !             $(DPMSSRCS) \
764               $(APPGROUPSRCS) xprint.c
765          OBJS = shape.o $(SHMOBJS) mbuf.o \
766                 mitmisc.o xtest.o xtest1di.o xtest1dd.o sleepuntil.o \
767                 bigreq.o sync.o $(SCRNSAVOBJ) xcmisc.o $(VIDMODEOBJS) \
768               $(XF86MISCOBJS) $(XF86DGAOBJS) $(SECURITYOBJS) \
769 !             $(DPMSOBJS) \
770               $(APPGROUPOBJS) xprint.o
771   
772   XF86INCLUDES = -I../hw/xfree86/common -I../hw/xfree86/os-support
773 --- 52,64 ----
774                 mitmisc.c xtest.c xtest1di.c xtest1dd.c sleepuntil.c \
775               bigreq.c sync.c $(SCRNSAVSRC) xcmisc.c $(VIDMODESRCS) \
776               $(XF86MISCSRCS) $(XF86DGASRCS) $(SECURITYSRCS) \
777 !             $(DPMSSRCS) $(XF86RUSHSRCS) \
778               $(APPGROUPSRCS) xprint.c
779          OBJS = shape.o $(SHMOBJS) mbuf.o \
780                 mitmisc.o xtest.o xtest1di.o xtest1dd.o sleepuntil.o \
781                 bigreq.o sync.o $(SCRNSAVOBJ) xcmisc.o $(VIDMODEOBJS) \
782               $(XF86MISCOBJS) $(XF86DGAOBJS) $(SECURITYOBJS) \
783 !             $(DPMSOBJS) $(XF86RUSHOBJS) \
784               $(APPGROUPOBJS) xprint.o
785   
786   XF86INCLUDES = -I../hw/xfree86/common -I../hw/xfree86/os-support
787 diff -c -N -r xc.old/programs/Xserver/Xext/xf86Rush.c ./Xext/xf86Rush.c
788 *** xc.old/programs/Xserver/Xext/xf86Rush.c     Wed Dec 31 16:00:00 1969
789 --- xc/programs/Xserver/Xext/xf86Rush.c Sun Apr  4 18:13:41 1999
790 ***************
791 *** 0 ****
792 --- 1,213 ----
793 + /* $XFree86: $ */
794
795 + /*
796
797 + Copyright (c) 1998 Daryll Strauss
798
799 + */
800
801 + #define NEED_REPLIES
802 + #define NEED_EVENTS
803 + #include "X.h"
804 + #include "Xproto.h"
805 + #include "misc.h"
806 + #include "dixstruct.h"
807 + #include "extnsionst.h"
808 + #include "colormapst.h"
809 + #include "cursorstr.h"
810 + #include "scrnintstr.h"
811 + #include "servermd.h"
812 + #define _XF86RUSH_SERVER_
813 + #include "xf86rushstr.h"
814 + #include "swaprep.h"
815 + #include "../hw/xfree86/common/xf86.h"
816 + #include <dlfcn.h>
817
818 + #include <X11/Xtrans.h>
819 + #include "../os/osdep.h"
820 + #include <X11/Xauth.h>
821 + #ifndef ESIX
822 + #ifndef Lynx
823 + #include <sys/socket.h>
824 + #else
825 + #include <socket.h>
826 + #endif
827 + #else
828 + #include <lan/socket.h>
829 + #endif
830
831 + extern int xf86ScreenIndex;
832 + static unsigned char RushReqCode = 0;
833 + static int RushErrorBase;
834
835 + static DISPATCH_PROC(ProcXF86RushDispatch);
836 + static DISPATCH_PROC(ProcRushQueryVersion);
837 + static DISPATCH_PROC(ProcRushLockPixmap);
838 + static DISPATCH_PROC(ProcRushUnlockPixmap);
839 + static DISPATCH_PROC(ProcRushUnlockAllPixmaps);
840
841 + static DISPATCH_PROC(SProcXF86RushDispatch);
842
843 + static void XF86RushResetProc(
844 + #if NeedFunctionPrototypes
845 +     ExtensionEntry* /* extEntry */
846 + #endif
847 + );
848
849 + void
850 + XFree86RushExtensionInit()
851 + {
852 +     ExtensionEntry* extEntry;
853
854 +     if (
855 +       (extEntry = AddExtension(XF86RUSHNAME,
856 +                               XF86RushNumberEvents,
857 +                               XF86RushNumberErrors,
858 +                               ProcXF86RushDispatch,
859 +                               SProcXF86RushDispatch,
860 +                               XF86RushResetProc,
861 +                               StandardMinorOpcode))) {
862 +       RushReqCode = (unsigned char)extEntry->base;
863 +       RushErrorBase = extEntry->errorBase;
864 +     }
865 + }
866
867 + /*ARGSUSED*/
868 + static void
869 + XF86RushResetProc (extEntry)
870 +     ExtensionEntry* extEntry;
871 + {
872 + }
873
874 + static int
875 + ProcRushQueryVersion(client)
876 +     register ClientPtr client;
877 + {
878 +     xXF86RushQueryVersionReply rep;
879 +     register int n;
880
881 +     REQUEST_SIZE_MATCH(xXF86RushQueryVersionReq);
882 +     rep.type = X_Reply;
883 +     rep.length = 0;
884 +     rep.sequenceNumber = client->sequence;
885 +     rep.majorVersion = XF86RUSH_MAJOR_VERSION;
886 +     rep.minorVersion = XF86RUSH_MINOR_VERSION;
887 +     if (client->swapped) {
888 +       swaps(&rep.sequenceNumber, n);
889 +       swapl(&rep.length, n);
890 +     }
891 +     WriteToClient(client, sizeof(xXF86RushQueryVersionReply), (char *)&rep);
892 +     return (client->noClientException);
893 + }
894
895 + static int
896 + ProcXF86RushLockPixmap(client)
897 +      register ClientPtr client;
898 + {
899 +   REQUEST(xXF86RushLockPixmapReq);
900 +   xXF86RushLockPixmapReply rep;
901 +   ScrnInfoPtr vptr;
902 +   PixmapPtr pix;
903 +   void *handle;
904 +   void *(*func)();
905
906 +   if (stuff->screen > screenInfo.numScreens)
907 +     return BadValue;
908
909 +   vptr = (ScrnInfoPtr) screenInfo.screens[stuff->screen]->devPrivates[xf86ScreenIndex].ptr;
910
911 +   REQUEST_SIZE_MATCH(xXF86RushLockPixmapReq);
912 +   rep.type = X_Reply;
913 +   rep.length = 0;
914 +   rep.sequenceNumber = client->sequence;
915 +   pix = (PixmapPtr)SecurityLookupIDByType(client,
916 +                                         stuff->pixmap, RT_PIXMAP, 
917 +                                         SecurityReadAccess);
918 +   handle=dlopen(0, 0);
919 +   if (handle) {
920 +     func=(void*(*)())dlsym(handle, "xf86LockPixmap");
921 +     dlclose(handle);
922 +   }
923 +   if (handle && func) rep.addr=(int)func(pix);
924 +   else rep.addr = 0;
925
926 +   WriteToClient(client, SIZEOF(xXF86RushLockPixmapReply), (char*)&rep);
927 +   return client->noClientException;
928 + }
929
930 + static int
931 + ProcXF86RushUnlockPixmap(client)
932 +      register ClientPtr client;
933 + {
934 +   REQUEST(xXF86RushUnlockPixmapReq);
935 +   ScrnInfoPtr vptr;
936 +   PixmapPtr pix;
937 +   void *handle;
938 +   void (*func)();
939
940 +   if (stuff->screen > screenInfo.numScreens)
941 +     return BadValue;
942
943 +   vptr = (ScrnInfoPtr) screenInfo.screens[stuff->screen]->devPrivates[xf86ScreenIndex].ptr;
944 +   REQUEST_SIZE_MATCH(xXF86RushUnlockPixmapReq);
945 +   pix = (PixmapPtr)SecurityLookupIDByType(client,
946 +                                         stuff->pixmap, RT_PIXMAP, 
947 +                                         SecurityReadAccess);
948 +   handle=dlopen(0, 0);
949 +   if (handle) {
950 +     func=(void(*)())dlsym(handle, "xf86UnlockPixmap");
951 +     dlclose(handle);
952 +   }
953 +   if (handle && func) func(pix);
954 +   return client->noClientException;
955 + }
956
957 + static int
958 + ProcXF86RushUnlockAllPixmaps(client)
959 +      register ClientPtr client;
960 + {
961 +   void *handle;
962 +   void (*func)();
963
964 +   REQUEST(xXF86RushUnlockAllPixmapsReq);
965 +   REQUEST_SIZE_MATCH(xXF86RushUnlockAllPixmapsReq);
966 +   handle=dlopen(0, 0);
967 +   if (handle) {
968 +     func=(void(*)())dlsym(handle, "xf86UnlockAllPixmaps");
969 +     dlclose(handle);
970 +   }
971 +   if (handle && func) func();
972 +   return client->noClientException;
973 + }
974
975 + ProcXF86RushDispatch (client)
976 +     register ClientPtr        client;
977 + {
978 +     REQUEST(xReq);
979
980 +     if (!LocalClient(client))
981 +       return RushErrorBase + XF86RushClientNotLocal;
982
983 +     switch (stuff->data)
984 +     {
985 +     case X_XF86RushQueryVersion:
986 +       return ProcRushQueryVersion(client);
987 +     case X_XF86RushLockPixmap:
988 +         return ProcXF86RushLockPixmap(client);
989 +     case X_XF86RushUnlockPixmap:
990 +         return ProcXF86RushUnlockPixmap(client);
991 +     case X_XF86RushUnlockAllPixmaps:
992 +         return ProcXF86RushUnlockAllPixmaps(client);
993 +     default:
994 +       return BadRequest;
995 +     }
996 + }
997
998 + SProcXF86RushDispatch (client)
999 +     register ClientPtr        client;
1000 + {
1001 +     REQUEST(xReq);
1002
1003 +     return RushErrorBase + XF86RushClientNotLocal;
1004 + }
1005
1006 diff -c -N -r xc.old/programs/Xserver/hw/xfree86/LinkKit/Imakefile ./hw/xfree86/LinkKit/Imakefile
1007 *** xc.old/programs/Xserver/hw/xfree86/LinkKit/Imakefile        Sun Jan 12 02:41:28 1997
1008 --- xc/programs/Xserver/hw/xfree86/LinkKit/Imakefile    Sun Apr  4 18:13:41 1999
1009 ***************
1010 *** 73,78 ****
1011 --- 73,79 ----
1012         LimitBoolean("BuildXF86VidModeExt", NO, BuildXF86VidModeExt) >> $@
1013         LimitBoolean("BuildXF86MiscExt", NO, BuildXF86MiscExt) >> $@
1014         LimitBoolean("BuildXF86DGA", NO, BuildXF86DGA) >> $@
1015 +       LimitBoolean("BuildXF86RushExt", NO, BuildXF86RushExt) >> $@
1016         LimitBoolean("BuildDPMSExt", BuildDPMSExt, BuildDPMSExt) >> $@
1017   
1018   clean::
1019 diff -c -N -r xc.old/programs/Xserver/hw/xfree86/common/xf86Cursor.c ./hw/xfree86/common/xf86Cursor.c
1020 *** xc.old/programs/Xserver/hw/xfree86/common/xf86Cursor.c      Sat Oct 31 12:13:18 1998
1021 --- xc/programs/Xserver/hw/xfree86/common/xf86Cursor.c  Sun Apr  4 18:13:41 1999
1022 ***************
1023 *** 138,143 ****
1024 --- 138,150 ----
1025     Bool          frameChanged = FALSE;
1026     ScrnInfoPtr   pScr = XF86SCRNINFO(pScreen);
1027   
1028 + #ifdef XFreeXDGA
1029 +   /*
1030 +    * Since we're in DGA mode we need to trash this scroll request
1031 +    */
1032 +    if (pScr->directMode&XF86DGADirectGraphics)
1033 +    return;
1034 + #endif
1035     /*
1036      * check wether (x,y) belongs to the visual part of the screen
1037      * if not, change the base of the displayed frame accoring
1038 diff -c -N -r xc.old/programs/Xserver/hw/xfree86/vga256/drivers/apm/apm_cursor.c ./hw/xfree86/vga256/drivers/apm/apm_cursor.c
1039 *** xc.old/programs/Xserver/hw/xfree86/vga256/drivers/apm/apm_cursor.c  Sun Jan 18 02:35:30 1998
1040 --- xc/programs/Xserver/hw/xfree86/vga256/drivers/apm/apm_cursor.c      Sun Apr  4 18:13:42 1999
1041 ***************
1042 *** 23,29 ****
1043   #include "apm.h"
1044   
1045   static void  ApmShowCursor(void);
1046 ! static void  ApmHideCursor(void);
1047   static Bool  ApmRealizeCursor(ScreenPtr pScr, CursorPtr pCurs);
1048   static Bool  ApmUnrealizeCursor(ScreenPtr pScr, CursorPtr pCurs);
1049   static void  ApmLoadCursorToCard(ScreenPtr pScr, CursorPtr pCurs, int x, int y);
1050 --- 23,29 ----
1051   #include "apm.h"
1052   
1053   static void  ApmShowCursor(void);
1054 ! void  ApmHideCursor(void);
1055   static Bool  ApmRealizeCursor(ScreenPtr pScr, CursorPtr pCurs);
1056   static Bool  ApmUnrealizeCursor(ScreenPtr pScr, CursorPtr pCurs);
1057   static void  ApmLoadCursorToCard(ScreenPtr pScr, CursorPtr pCurs, int x, int y);
1058 ***************
1059 *** 108,114 ****
1060    * This is also a local function, it's not called from outside.
1061    */
1062   
1063 ! static void 
1064   ApmHideCursor(void) 
1065   {
1066     ApmCheckMMIO_Init();
1067 --- 108,114 ----
1068    * This is also a local function, it's not called from outside.
1069    */
1070   
1071 ! void 
1072   ApmHideCursor(void) 
1073   {
1074     ApmCheckMMIO_Init();
1075 diff -c -N -r xc.old/programs/Xserver/hw/xfree86/vga256/drivers/apm/apm_driver.c ./hw/xfree86/vga256/drivers/apm/apm_driver.c
1076 *** xc.old/programs/Xserver/hw/xfree86/vga256/drivers/apm/apm_driver.c  Sun Feb 15 16:42:15 1998
1077 --- xc/programs/Xserver/hw/xfree86/vga256/drivers/apm/apm_driver.c      Sun Apr  4 18:13:42 1999
1078 ***************
1079 *** 610,616 ****
1080 --- 610,624 ----
1081   
1082   #ifdef XFreeXDGA
1083     if (vga256InfoRec.directMode&XF86DGADirectGraphics && !enter)
1084 +   {
1085 +     if (vgaHWCursor.Initialized == TRUE)
1086 +     {
1087 +       extern void ApmHideCursor(void);
1088 +       ApmHideCursor();
1089 +     }
1090       return;
1091 +   }
1092
1093   #endif
1094   
1095     if (enter)
1096 ***************
1097 *** 965,970 ****
1098 --- 973,985 ----
1099      */
1100     modinx(vgaIOBase + 4, 0x1c, 0x0f, (Base & 0x0f0000) >> 16);
1101   
1102 + #ifdef XFreeXDGA
1103 +         if (vga256InfoRec.directMode & XF86DGADirectGraphics) {
1104 +                 /* Wait until vertical retrace is in progress. */
1105 +                 while (inb(vgaIOBase + 0xA) & 0x08);             
1106 +                 while (!(inb(vgaIOBase + 0xA) & 0x08));             
1107 +         }
1108 + #endif   
1109   }
1110   
1111   /*
1112 diff -c -N -r xc.old/programs/Xserver/hw/xfree86/xaa/xf86cparea.c ./hw/xfree86/xaa/xf86cparea.c
1113 *** xc.old/programs/Xserver/hw/xfree86/xaa/xf86cparea.c Mon Nov 18 05:22:11 1996
1114 --- xc/programs/Xserver/hw/xfree86/xaa/xf86cparea.c     Tue Apr  6 23:51:36 1999
1115 ***************
1116 *** 85,90 ****
1117 --- 85,92 ----
1118   #include      "xf86xaa.h"
1119   #include      "xf86local.h"
1120   
1121 + #include      "xf86Priv.h"
1122 + #include      "xf86pcache.h"
1123   
1124   RegionPtr
1125   xf86CopyArea(pSrcDrawable, pDstDrawable,
1126 ***************
1127 *** 96,105 ****
1128       int width, height;
1129       int dstx, dsty;
1130   {
1131 !     if (pSrcDrawable->type == DRAWABLE_WINDOW
1132 !     && pDstDrawable->type == DRAWABLE_WINDOW) {
1133           return (*xf86GCInfoRec.cfbBitBltDispatch)(
1134 !             pSrcDrawable, pDstDrawable,
1135               pGC, srcx, srcy, width, height, dstx, dsty,
1136               xf86DoBitBlt, 0L);
1137       }
1138 --- 98,110 ----
1139       int width, height;
1140       int dstx, dsty;
1141   {
1142 !     if ((pDstDrawable->type == DRAWABLE_WINDOW) &&
1143 !       ((pSrcDrawable->type == DRAWABLE_WINDOW) ||
1144 !       ((xf86AccelInfoRec.Flags & PIXMAP_CACHE) &&
1145 !        (pSrcDrawable->type == DRAWABLE_PIXMAP) &&
1146 !        xf86CacheIsLocked((PixmapPtr)pSrcDrawable)))) {
1147           return (*xf86GCInfoRec.cfbBitBltDispatch)(
1148 !           pSrcDrawable, pDstDrawable,
1149               pGC, srcx, srcy, width, height, dstx, dsty,
1150               xf86DoBitBlt, 0L);
1151       }
1152 ***************
1153 *** 132,137 ****
1154 --- 137,154 ----
1155       int xdir;                 /* 1 = left right, -1 = right left/ */
1156       int ydir;                 /* 1 = top down, -1 = bottom up */
1157       int careful;
1158 +     extern CacheInfoPtr xf86CacheInfo;
1159 +     int i, slot;
1160
1161 +     /* Handle locked pixmaps just like screen to screen blits */
1162 +     if (pSrc->type==DRAWABLE_PIXMAP) {
1163 +       slot=((xf86PixPrivPtr)((PixmapPtr)pSrc)->devPrivates[xf86PixmapIndex].ptr)->slot;
1164 +       pptTmp=pptSrc;
1165 +       for (i=0; i<REGION_NUM_RECTS(prgnDst); i++, pptTmp++) {
1166 +       pptTmp->x+=xf86CacheInfo[slot].x;
1167 +       pptTmp->y+=xf86CacheInfo[slot].y;
1168 +       }
1169 +     }
1170   
1171       /* XXX we have to err on the side of safety when both are windows,
1172        * because we don't know if IncludeInferiors is being used.
1173 diff -c -N -r xc.old/programs/Xserver/hw/xfree86/xaa/xf86pcache.c ./hw/xfree86/xaa/xf86pcache.c
1174 *** xc.old/programs/Xserver/hw/xfree86/xaa/xf86pcache.c Sun Feb  8 07:36:25 1998
1175 --- xc/programs/Xserver/hw/xfree86/xaa/xf86pcache.c     Tue Apr 13 12:21:33 1999
1176 ***************
1177 *** 127,144 ****
1178   
1179   CacheInfoPtr xf86CacheInfo = NULL;
1180   static int MaxSlot;
1181   static int MaxWidth;
1182   static int MaxHeight;
1183   static unsigned int pixmap_cache_clock = 1;
1184   static int FirstWideSlot;
1185   static int MaxWideSlotHeight;
1186   
1187   void xf86InitPixmapCacheSlots()
1188   {
1189       ScrnInfoPtr infoRec;
1190       int memoryStart, memoryEnd;
1191 !     int width_in_bytes, cache_start_y, i;
1192 !     int height_left, standard_slots, wide_slots, wide_slot_width;
1193   
1194       infoRec = xf86AccelInfoRec.ServerInfoRec;
1195       memoryStart = xf86AccelInfoRec.PixmapCacheMemoryStart;
1196 --- 127,147 ----
1197   
1198   CacheInfoPtr xf86CacheInfo = NULL;
1199   static int MaxSlot;
1200 + static int MaxBigSlot;
1201   static int MaxWidth;
1202   static int MaxHeight;
1203   static unsigned int pixmap_cache_clock = 1;
1204   static int FirstWideSlot;
1205 + static int FirstBigSlot;
1206   static int MaxWideSlotHeight;
1207 + static int cache_start_y;
1208   
1209   void xf86InitPixmapCacheSlots()
1210   {
1211       ScrnInfoPtr infoRec;
1212       int memoryStart, memoryEnd;
1213 !     int width_in_bytes, i;
1214 !     int height_left, standard_slots, wide_slots, wide_slot_width, big_slots;
1215   
1216       infoRec = xf86AccelInfoRec.ServerInfoRec;
1217       memoryStart = xf86AccelInfoRec.PixmapCacheMemoryStart;
1218 ***************
1219 *** 228,236 ****
1220           }
1221       }
1222   
1223       MaxSlot = standard_slots + wide_slots - 1;
1224 !     xf86CacheInfo = (CacheInfoPtr)xcalloc(MaxSlot + 1, sizeof(CacheInfo));
1225       FirstWideSlot = standard_slots;
1226   
1227       ErrorF("%s %s: XAA: Using %d %dx%d ",
1228           XCONFIG_PROBED, infoRec->name, standard_slots, MaxWidth, MaxHeight);
1229 --- 231,243 ----
1230           }
1231       }
1232   
1233 +     /* Arbitrarily say you can have 10 big slots */
1234 +     big_slots = 10;
1235       MaxSlot = standard_slots + wide_slots - 1;
1236 !     MaxBigSlot = MaxSlot + big_slots;
1237 !     xf86CacheInfo = (CacheInfoPtr)xcalloc(MaxBigSlot + 1, sizeof(CacheInfo));
1238       FirstWideSlot = standard_slots;
1239 +     FirstBigSlot = standard_slots + wide_slots;
1240   
1241       ErrorF("%s %s: XAA: Using %d %dx%d ",
1242           XCONFIG_PROBED, infoRec->name, standard_slots, MaxWidth, MaxHeight);
1243 ***************
1244 *** 255,261 ****
1245           xf86CacheInfo[i + standard_slots].cache_height = min(32, height_left);
1246       }
1247   
1248 !     for (i = 0; i <= MaxSlot; i++) {
1249           xf86CacheInfo[i].id = -1;
1250           xf86CacheInfo[i].lru = pixmap_cache_clock;
1251           xf86CacheInfo[i].fg_color = 0;
1252 --- 262,268 ----
1253           xf86CacheInfo[i + standard_slots].cache_height = min(32, height_left);
1254       }
1255   
1256 !     for (i = 0; i <= MaxBigSlot; i++) {
1257           xf86CacheInfo[i].id = -1;
1258           xf86CacheInfo[i].lru = pixmap_cache_clock;
1259           xf86CacheInfo[i].fg_color = 0;
1260 ***************
1261 *** 315,321 ****
1262   #ifdef PIXPRIV
1263       devPriv = (xf86PixPrivPtr)(pix->devPrivates[xf86PixmapIndex].ptr);
1264   
1265 !     if (devPriv->slot == MaxSlot + 1)
1266           /*
1267            * Special value indicates that this pattern was found to be
1268            * non-cachable.
1269 --- 322,328 ----
1270   #ifdef PIXPRIV
1271       devPriv = (xf86PixPrivPtr)(pix->devPrivates[xf86PixmapIndex].ptr);
1272   
1273 !     if (devPriv->slot == MaxBigSlot + 1)
1274           /*
1275            * Special value indicates that this pattern was found to be
1276            * non-cachable.
1277 ***************
1278 *** 344,350 ****
1279                * pattern, but can't, and ScreenToScreencopy doesn't have
1280                * the required support for transparency.
1281                */
1282 !             devPriv->slot = MaxSlot + 1;
1283               return 0;
1284           }
1285           devPriv->slot = slot;
1286 --- 351,357 ----
1287                * pattern, but can't, and ScreenToScreencopy doesn't have
1288                * the required support for transparency.
1289                */
1290 !             devPriv->slot = MaxBigSlot + 1;
1291               return 0;
1292           }
1293           devPriv->slot = slot;
1294 ***************
1295 *** 893,898 ****
1296 --- 900,906 ----
1297       pci->flags = 0;
1298       pci->lru = pixmap_cache_clock;
1299       pci->id = pix->drawable.serialNumber;
1300 +     pci->locked = FALSE;
1301   
1302       reducible_status = TILE_UNKNOWN;
1303   
1304 ***************
1305 *** 1303,1305 ****
1306 --- 1311,1483 ----
1307      return (pix->drawable.width <= MaxWidth &&
1308          pix->drawable.height <= MaxHeight);
1309   }
1310
1311 + /* Rush extension support */
1312
1313 + int testOverlap(pcipix)
1314 +      CacheInfoPtr pcipix;
1315 + {
1316 +   int slot;
1317 +   CacheInfoPtr pcitest;
1318
1319 +   for (slot=FirstBigSlot; slot<=MaxBigSlot; slot++) {
1320 +     if (xf86CacheInfo[slot].id>0) {
1321 +       pcitest=&xf86CacheInfo[slot];
1322 +       if (!((pcipix->x+pcipix->w<pcitest->x || 
1323 +          pcipix->x>pcitest->x+pcitest->w) &&
1324 +         (pcipix->y+pcipix->h<pcitest->y || 
1325 +          pcipix->y>pcitest->y+pcitest->w)))
1326 +       return 1;
1327 +     }
1328 +   }
1329 +   return 0;
1330 + }
1331 +      
1332
1333 + /*
1334 +   Dividing up the extra memory among X and Glide is difficult.
1335 +   We'll take what we're given and then try to stick up to big_slots
1336 +   pixmaps within it. big_slots should be small to keep this efficient.
1337 +   To fit the pixmap we'll try to put it next to and below each
1338 +   existing pixmap. Then we'll check if it overlaps anything.
1339 + */
1340 + static int
1341 + findPosition(pci, pix)
1342 +      CacheInfoPtr pci;
1343 +      PixmapPtr pix;
1344 + {
1345 +   int slot, bestx, besty;
1346
1347 +   bestx=-2;
1348 +   for (slot=FirstBigSlot; slot<=MaxBigSlot; slot++) {
1349 +     if (xf86CacheInfo[slot].id>0) {
1350 +       if (bestx==-2) bestx==-1;
1351 +       /* Check for fit to right */
1352 +       pci->x=xf86CacheInfo[slot].x+xf86CacheInfo[slot].w;
1353 +       pci->y=xf86CacheInfo[slot].y;
1354 +       if (bestx<0 || (bestx+besty>pci->x+pci->y)) {
1355 +       if (!testOverlap(pci, &xf86CacheInfo[slot])) {
1356 +         bestx=pci->x;
1357 +         besty=pci->y;
1358 +       }
1359 +       }
1360 +       /* Check for fit below */
1361 +       pci->x=xf86CacheInfo[slot].x;
1362 +       pci->y=xf86CacheInfo[slot].y+xf86CacheInfo[slot].h;
1363 +       if (bestx<0 || (bestx+besty>pci->x+pci->y)) {
1364 +       if (!testOverlap(pci, &xf86CacheInfo[slot])) {
1365 +         bestx=pci->x;
1366 +         besty=pci->y;
1367 +       }
1368 +       }
1369 +     }
1370 +   }
1371 +   if (bestx==-2) { /* Nothing in the list yet */
1372 +     bestx=0;
1373 +     besty=cache_start_y+MaxHeight;
1374 +   }
1375 +   if (bestx==-1) { /* Doesn't fit */
1376 +     return 0;
1377 +   }
1378 +   pci->x=bestx;
1379 +   pci->y=besty;
1380 + }
1381
1382 + void *
1383 + xf86LockPixmap(pix)
1384 +      PixmapPtr pix;
1385 + {
1386 +   xf86PixPrivPtr devPriv =
1387 +     (xf86PixPrivPtr)(pix->devPrivates[xf86PixmapIndex].ptr);
1388 +   int slot, size;
1389 +   ScrnInfoPtr infoRec;
1390 +   CacheInfoPtr pci;
1391
1392 +   switch (xf86AccelInfoRec.BitsPerPixel) {
1393 +   case 8:
1394 +     size=1;
1395 +     break;
1396 +   case 16:
1397 +     size=2;
1398 +     break;
1399 +   case 24:
1400 +     size=3;
1401 +     break;
1402 +   case 32:
1403 +     size=4;
1404 +     break;
1405 +   case 1:
1406 +   case 4:
1407 +   default:
1408 +     return 0;
1409 +   }
1410 +   for (slot=FirstBigSlot; slot<MaxBigSlot ; slot++) {
1411 +     if (slot==-1) break;
1412 +   }
1413 +   if (slot==MaxBigSlot) return 0;
1414 +   /* Assign the slot */
1415 +   IncrementCacheLRU(slot);
1416 +   devPriv->slot = slot;
1417 +   /* Fill in the cache entry */
1418 +   pci = &xf86CacheInfo[devPriv->slot];
1419 +   pci->pix_w = pix->drawable.width;
1420 +   pci->pix_h = pix->drawable.height;
1421 +   pci->nx = 1;
1422 +   pci->ny = 1;
1423 +   pci->w = pci->pix_w;
1424 +   pci->h = pci->pix_h;
1425 +   pci->fg_color = 0;
1426 +   pci->bg_color = 0;
1427 +   pci->flags = 0;
1428 +   pci->lru = pixmap_cache_clock;
1429 +   pci->locked = TRUE;
1430 +   /* Assign X & Y position */
1431 +   if (!findPosition(pci, pix)) return 0;
1432 +   pci->id = pix->drawable.serialNumber;
1433 +   xf86AccelInfoRec.ImageWrite(pci->x, pci->y, pci->pix_w, pci->pix_h,
1434 +                             pix->devPrivate.ptr, pix->devKind, GXcopy, 
1435 +                             0xFFFFFFFF);
1436 +   infoRec=xf86AccelInfoRec.ServerInfoRec;
1437 +   return (void*)(infoRec->physBase +
1438 +                (xf86CacheInfo[slot].x +
1439 +                 xf86CacheInfo[slot].y*infoRec->displayWidth) * size);
1440 + }
1441
1442 + void
1443 + xf86UnlockPixmap(pix)
1444 +      PixmapPtr pix;
1445 + {
1446 +   xf86PixPrivPtr devPriv =
1447 +     (xf86PixPrivPtr)(pix->devPrivates[xf86PixmapIndex].ptr);
1448 +   if (devPriv->slot<0) return;
1449 +   xf86CacheInfo[devPriv->slot].locked = FALSE;
1450 +   xf86CacheInfo[devPriv->slot].id = -1;
1451 +   devPriv->slot = 0;
1452 + }
1453
1454 + void
1455 + xf86UnlockAllPixmaps()
1456 + {
1457 +   int i;
1458
1459 +   for (i=FirstBigSlot; i<=MaxBigSlot; i++) {
1460 +     if (xf86CacheInfo[i].id>0 && xf86CacheInfo[i].locked) {
1461 +       xf86CacheInfo[i].locked = FALSE;
1462 +       xf86CacheInfo[i].id = -1;
1463 +     }
1464 +   }
1465 + }
1466
1467 + int
1468 + xf86CacheIsLocked(pix)
1469 +      PixmapPtr pix;
1470 + {
1471 +   xf86PixPrivPtr devPriv = 
1472 +     (xf86PixPrivPtr)(pix->devPrivates[xf86PixmapIndex].ptr);
1473 +   int slot;
1474
1475 +   slot=devPriv->slot;
1476 +   if (slot<FirstBigSlot || slot>MaxBigSlot) return 0;
1477 +   return xf86CacheInfo[slot].locked;
1478 + }
1479
1480 diff -c -N -r xc.old/programs/Xserver/hw/xfree86/xaa/xf86pcache.h ./hw/xfree86/xaa/xf86pcache.h
1481 *** xc.old/programs/Xserver/hw/xfree86/xaa/xf86pcache.h Fri Jan 17 22:57:28 1997
1482 --- xc/programs/Xserver/hw/xfree86/xaa/xf86pcache.h     Sun Apr  4 18:13:42 1999
1483 ***************
1484 *** 19,24 ****
1485 --- 19,25 ----
1486       int pattern0;       /* if fixed pattern, pattern 0 register contents */
1487       int pattern1;       /* if fixed pattern, pattern 1 register contents */
1488       unsigned int lru;   /* lru counter */
1489 +     Bool locked;
1490   } CacheInfo, *CacheInfoPtr;
1491   
1492   #ifdef PIXPRIV
1493 ***************
1494 *** 43,45 ****
1495 --- 44,47 ----
1496   void xf86InitPixmapCacheSlots();
1497   
1498   void xf86InvalidatePixmapCache();
1499
1500 diff -c -N -r xc.old/programs/Xserver/mi/Imakefile ./mi/Imakefile
1501 *** xc.old/programs/Xserver/mi/Imakefile        Sat May  3 02:50:45 1997
1502 --- xc/programs/Xserver/mi/Imakefile    Sun Apr  4 18:13:42 1999
1503 ***************
1504 *** 32,38 ****
1505    * Make sure XINPUT, XF86VidTune, etc aren't defined for the miinitext.o 
1506    * used by Xnest, Xvfb 
1507    */
1508 ! EXT_DEFINES = ExtensionDefines -UXINPUT -UXF86VIDMODE -UXFreeXDGA -UXF86MISC
1509   #else
1510   EXT_DEFINES = ExtensionDefines
1511   #endif
1512 --- 32,39 ----
1513    * Make sure XINPUT, XF86VidTune, etc aren't defined for the miinitext.o 
1514    * used by Xnest, Xvfb 
1515    */
1516 ! EXT_DEFINES = ExtensionDefines -UXINPUT -UXF86VIDMODE -UXFreeXDGA -UXF86MISC \
1517 !       -UXFreeXRUSH
1518   #else
1519   EXT_DEFINES = ExtensionDefines
1520   #endif
1521 diff -c -N -r xc.old/programs/Xserver/mi/miinitext.c ./mi/miinitext.c
1522 *** xc.old/programs/Xserver/mi/miinitext.c      Thu May 22 07:00:46 1997
1523 --- xc/programs/Xserver/mi/miinitext.c  Sun Apr  4 18:13:42 1999
1524 ***************
1525 *** 155,160 ****
1526 --- 155,163 ----
1527   #ifdef XFreeXDGA
1528   extern void XFree86DGAExtensionInit(INITARGS);
1529   #endif
1530 + #ifdef XFreeXRUSH
1531 + extern void XFree86RushExtensionInit(INITARGS);
1532 + #endif
1533   #ifdef DPMSExtension
1534   extern void DPMSExtensionInit(INITARGS);
1535   #endif
1536 ***************
1537 *** 264,269 ****
1538 --- 267,275 ----
1539   #endif
1540   #if defined(XFreeXDGA) && !defined(PRINT_ONLY_SERVER)
1541       XFree86DGAExtensionInit();
1542 + #endif
1543 + #if defined(XFreeXRUSH) && !defined(PRINT_ONLY_SERVER)
1544 +     XFree86RushExtensionInit();
1545   #endif
1546   #if defined(DPMSExtension) && !defined(PRINT_ONLY_SERVER)
1547       DPMSExtensionInit();
This page took 0.126594 seconds and 3 git commands to generate.